Merge branch 'fix_20230911_UAT' into 'master'

OTA管理

See merge request laws-nio/laws-weilai!364
This commit is contained in:
高嵩
2023-10-26 10:15:14 +00:00
139 changed files with 12654 additions and 6032 deletions
@@ -1205,16 +1205,16 @@ MODIFY COLUMN `work_progress_cn` text CHARACTER SET utf8mb4 COLLATE utf8mb4_gene
MODIFY COLUMN `work_progress_en` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'NIO工作进展英文' AFTER `work_progress_cn`;
--参数收集清单 添加英文
--参数收集清单 添加英文 已同步生产环境
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Control Component' WHERE `id` = '84fec4a260dc646dc570cbf7cb581dab';
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Component Value' WHERE `id` = '5d468613746f413a53fa0b485089839b';
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Validate Component' WHERE `id` = '608274a6a6dfed0e183093d9ea357436';
--平台件项目库数据标识
--平台件项目库数据标识 已同步生产环境
ALTER TABLE `laws_weilai`.`project_library_base`
ADD COLUMN `platform` varchar(255) NULL COMMENT '平台件项目库数据(platform=YES' AFTER `brand`;
--平台件合规认证计划
--平台件合规认证计划 已同步生产环境
CREATE TABLE `laws_weilai`.`platform_task_planning` (
`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 '创建人',
@@ -1229,7 +1229,7 @@ CREATE TABLE `laws_weilai`.`platform_task_planning` (
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
--车型项目库法规清单关联平台件表2023-09-19
--车型项目库法规清单关联平台件表2023-09-19 已同步生产环境
CREATE TABLE `laws_inventory_platform` (
`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 '创建人',
@@ -1242,14 +1242,14 @@ CREATE TABLE `laws_inventory_platform` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
--车修改字段长度2023-09-28
--车修改字段长度2023-09-28 已同步生产环境
ALTER TABLE `project_certification_directory`
MODIFY COLUMN `directory_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目录名称' AFTER `project_library_id`,
MODIFY COLUMN `lot` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次' AFTER `directory_name`,
MODIFY COLUMN `detection_report_location` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检测报告位置' AFTER `experiment_file`,
MODIFY COLUMN `explain_info` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `detection_report_location`;
--添加平台件项目库字段2023-10-09
--添加平台件项目库字段2023-10-09 已同步生产环境
ALTER TABLE `project_library_base`
ADD COLUMN `power` varchar(255) NULL COMMENT '功率' AFTER `platform`,
ADD COLUMN `producer` varchar(255) NULL COMMENT '生产商' AFTER `power`,
@@ -1280,11 +1280,11 @@ ADD COLUMN `cooling_method` varchar(255) NULL COMMENT '冷却方式' AFTER `modu
ADD COLUMN `filing_completion_time` datetime(0) NULL COMMENT '备案完成时间' AFTER `cooling_method`,
ADD COLUMN `remark` varchar(1000) NULL COMMENT '备注' AFTER `filing_completion_time`;
--平台件合规认证计划添加标识字段2023-10-09
--平台件合规认证计划添加标识字段2023-10-09 已同步生产环境
ALTER TABLE `platform_task_planning`
ADD COLUMN `flag` varchar(255) NULL COMMENT '位置标识(用来区分上下两部分数据,up->上,down->下)' AFTER `project_id`
--平台件合规认证计划初始化数据 2023-10-10
--平台件合规认证计划初始化数据 2023-10-10 已同步生产环境
INSERT INTO `platform_task_planning`(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `node_name`, `node_time`, `project_id`, `flag`) VALUES ('08ecf06f4f947836d0e95285fd8afb96', NULL, NULL, NULL, NULL, NULL, 'KO', NULL, NULL, 'up');
INSERT INTO `platform_task_planning`(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `node_name`, `node_time`, `project_id`, `flag`) VALUES ('09e577fa7afa3a8cb26b9c8f29eaf8d9', NULL, NULL, NULL, NULL, NULL, 'RF', NULL, NULL, 'up');
INSERT INTO `platform_task_planning`(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `node_name`, `node_time`, `project_id`, `flag`) VALUES ('17323a3d13e747e493c41e2e09bedc92', NULL, NULL, NULL, NULL, NULL, 'ADF', NULL, NULL, 'up');
@@ -1300,4 +1300,71 @@ INSERT INTO `platform_task_planning`(`id`, `create_by`, `create_time`, `update_b
INSERT INTO `platform_task_planning`(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `node_name`, `node_time`, `project_id`, `flag`) VALUES ('e611b793756bf9caeb4a1c09526ceb76', NULL, NULL, NULL, NULL, NULL, 'E-markCDF前)', NULL, NULL, 'down');
INSERT INTO `platform_task_planning`(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `node_name`, `node_time`, `project_id`, `flag`) VALUES ('e76e63a251aa6d64cac96125315805e1', NULL, NULL, NULL, NULL, NULL, 'CAMDS提交(CDF前)', NULL, NULL, 'down');
INSERT INTO `platform_task_planning`(`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `node_name`, `node_time`, `project_id`, `flag`) VALUES ('ee85c1b1964586e512ef0b2b401b16b5', NULL, NULL, NULL, NULL, NULL, '验证检查(ESO', NULL, NULL, 'down');
--平台件合规认证计划初始化数据->合规管理阀点相关字段初始化值修改 2023-10-18 已同步生产环境
UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `update_by` = NULL, `update_time` = NULL, `sys_org_code` = NULL, `node_name` = '法规清单', `node_time` = NULL, `project_id` = NULL, `flag` = 'down' WHERE `id` = '85fa6eb0b58d93d4cc76b8fb1d5248ca';
UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `update_by` = NULL, `update_time` = NULL, `sys_org_code` = NULL, `node_name` = '责任确认', `node_time` = NULL, `project_id` = NULL, `flag` = 'down' WHERE `id` = '97aaf07d156b6a4278e0ac3627566c8b';
UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `update_by` = NULL, `update_time` = NULL, `sys_org_code` = NULL, `node_name` = '设计核查', `node_time` = NULL, `project_id` = NULL, `flag` = 'down' WHERE `id` = 'a533416284ab81c7f6ee95b5e9e06d38';
UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `update_by` = NULL, `update_time` = NULL, `sys_org_code` = NULL, `node_name` = '强检报告', `node_time` = NULL, `project_id` = NULL, `flag` = 'down' WHERE `id` = 'cd7d6332a42dd3855f0117ffb188f5b1';
UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `update_by` = NULL, `update_time` = NULL, `sys_org_code` = NULL, `node_name` = 'E-mark', `node_time` = NULL, `project_id` = NULL, `flag` = 'down' WHERE `id` = 'e611b793756bf9caeb4a1c09526ceb76';
UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `update_by` = NULL, `update_time` = NULL, `sys_org_code` = NULL, `node_name` = 'CAMDS提交', `node_time` = NULL, `project_id` = NULL, `flag` = 'down' WHERE `id` = 'e76e63a251aa6d64cac96125315805e1';
UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `update_by` = NULL, `update_time` = NULL, `sys_org_code` = NULL, `node_name` = '验证检查', `node_time` = NULL, `project_id` = NULL, `flag` = 'down' WHERE `id` = 'ee85c1b1964586e512ef0b2b401b16b5';
--项目库添加平台件类型字段 2023-10-18 已同步生产环境
ALTER TABLE `project_library_base` ADD COLUMN `platform_type` varchar(255) NULL COMMENT '平台件类型' AFTER `remark`;
--ota_manage_receive_nsdp添加数量字段 2023-10-18 已同步生产环境
ALTER TABLE `ota_manage_receive_nsdp`
ADD COLUMN `extension_item_count` int(10) NULL COMMENT '扩展任务数量' AFTER `created_at`;
-- 法规月报填写添加保存状态字段 2023-10-20 已同步生产环境
ALTER TABLE `laws_monthly_report_write`
ADD COLUMN `save_state` varchar(10) NULL COMMENT '保存状态(0->暂存,1->提交)' AFTER `technology_territory_en`;
-- 问题管理添加问题优先级字段 2023-10-20 已同步生产环境
ALTER TABLE `problem_management`
ADD COLUMN `problem_priority` varchar(36) NULL COMMENT '问题优先级' AFTER `approval_evidence_link`;
-- OTA添加主键 2023-10-20 已同步生产环境
ALTER TABLE `ota_manage_apply`
ADD COLUMN `vdr_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'vdr_id' AFTER `remark`;
ALTER TABLE `ota_manage_receive`
ADD COLUMN `vdr_id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键id' FIRST ,
ADD COLUMN `is_del` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '是否被删除(0:否;1:是)' AFTER `release_date`,
DROP PRIMARY KEY,
ADD PRIMARY KEY (`vdr_id`);
ALTER TABLE `params_report`
ADD COLUMN `project_version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关项目版本' AFTER `target_market`;
-- 问题管理添加相关项目类型字段 2023-10-24
ALTER TABLE `problem_management`
ADD COLUMN `project_type` varchar(255) NULL COMMENT '相关项目类型' AFTER `problem_priority`;
@@ -17,12 +17,17 @@ public class DictModel implements Serializable{
public DictModel() {
}
public DictModel(String value, String text) {
this.value = value;
this.text = text;
}
public DictModel(String id,String value, String text) {
this.id = id;
this.value = value;
this.text = text;
}
private String id;
/**
* 字典value
*/
@@ -7,6 +7,8 @@ public enum DicCodeEnum {
REGION("适用地区","1493782108399820801","region"),
DUTY_TERRITORY("责任领域","1513417672023441409","duty_territory"),
PROBLEM_TYPE("问题类型","1697066042058821634","wen4_ti2_lei4_xing2"),
PROBLEM_PRIORITY("问题优先级","1716030928484503553","wen4_ti2_you1_xian1_ji2"),
CERTIFICATION_PROGRESS("认证清单-认证进度","1524311122804346881","certification_progress"),
;
String name;
@@ -6,30 +6,32 @@ import org.apache.commons.lang3.StringUtils;
* 项目角色枚举类
*/
public enum ProjectRoleEnum {
STUDIO_ENGINEER("studio工程师","0","R&H Studio"),
REGULATI_ENGINEER("法规工程师","1","studio"),
HOMOLOGATION_ENGINEER("认证工程师","2","homo"),
REGULATI_AND_HOMOLOGATION_ENGINEER("法规工程师/认证工程师","4","Regulatory Engineer/Certification Engineer"),
MANAGER("领导角色","11","R&H Manager"),
ADMIN("系统管理员","12","admin"),
VIEWER("Viewer","13","Viewer"),
BRAND_ADMINISTRATOR("品牌管理员","14","BrandAdministrator"),
STUDIO_ENGINEER("studio工程师","0","R&H Studio","R&H Studio"),
REGULATI_ENGINEER("法规工程师","1","studio","Regulation"),
HOMOLOGATION_ENGINEER("认证工程师","2","homo","homo"),
REGULATI_AND_HOMOLOGATION_ENGINEER("法规工程师/认证工程师","4","Regulatory Engineer/Certification Engineer","Regulatory Engineer/Certification Engineer"),
MANAGER("领导角色","11","R&H Manager","R&H Manager"),
ADMIN("系统管理员","12","admin","admin"),
VIEWER("Viewer","13","Viewer","Viewer"),
BRAND_ADMINISTRATOR("品牌管理员","14","BrandAdministrator","BrandAdministrator"),
//法规清单使用
INTERFACE_PERSON1("工程接口人","30","Interface person"),
PERSON_LIABLE1("责任人","31","Person liable"),
INTERFACE_PERSON1("工程接口人","30","Interface person","Interface person"),
PERSON_LIABLE1("责任人","31","Person liable","Person liable"),
// 项目库-认证清单使用。
INTERFACE_PERSON("工程接口人","20","Interface person"),
PERSON_LIABLE("责任人","21","Person liable"),
INTERFACE_PERSON("工程接口人","20","Interface person","Interface person"),
PERSON_LIABLE("责任人","21","Person liable","Person liable"),
;
String name;
String value;
String code;
String enName;
private ProjectRoleEnum(String name, String value, String code) {
private ProjectRoleEnum(String name, String value, String code, String enName) {
this.name = name;
this.value = value;
this.code = code;
this.enName = enName;
}
public static ProjectRoleEnum getByValue(String value) {
@@ -77,4 +79,8 @@ public enum ProjectRoleEnum {
public int getIntValue() {
return Integer.valueOf(value);
}
public String getEnName() {
return enName;
}
}
@@ -26,7 +26,7 @@ public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
@Select("SELECT sys_dict_item.* FROM sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id WHERE DICT_CODE = #{dictCode} order by sys_dict_item.item_text asc")
public List<SysDictItem> selectItemsOrderBySortOrder(String dictCode);
@Select("SELECT sys_dict.dict_code,sys_dict_item.* from sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id where status = 1 and sys_dict_item.del_flag = 0")
@Select("SELECT sys_dict.dict_code,sys_dict_item.* from sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id where status = 1 and sys_dict_item.del_flag = 0 ORDER BY sys_dict_item.sort_order ASC")
List<SysDictItem> selectItemsAll();
/**
@@ -4,7 +4,7 @@
<!-- 通过字典code获取字典数据 -->
<select id="queryDictItemsByCode" parameterType="String" resultType="com.jero.common.system.vo.DictModel">
select s.item_value as "value",s.item_text as "text", s.en_name as "textEn" from sys_dict_item s
select s.id as "id", s.item_value as "value",s.item_text as "text", s.en_name as "textEn" from sys_dict_item s
where dict_id = (select id from sys_dict where dict_code = #{code}) and del_flag = '0'
order by s.sort_order asc
</select>
@@ -2,21 +2,24 @@ package com.jero.modules.system.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.CacheConstant;
import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.enums.DictCodeEnum;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.mapper.SysDictItemMapper;
import com.jero.modules.system.service.ISysDictItemService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -275,16 +278,11 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
}
return flag;
}).collect(Collectors.toList());
Map<String, List<SysDictItem>> result = null;
if(CollectionUtils.isNotEmpty(sysDictItemByDictCode)){
result = sysDictItems.stream().filter(sysDict -> {
boolean flag = false;
if (StringUtils.isNotEmpty(sysDict.getStatNode())) {
flag = true;
}
return flag;
}).collect(Collectors.groupingBy(SysDictItem::getStatNode));
List<String> statNodeList = sysDictItemByDictCode.stream().map(SysDictItem::getStatNode).distinct().collect(Collectors.toList());
Map<String, List<SysDictItem>> result = new LinkedHashMap<>();
for (String node : statNodeList) {
List<SysDictItem> collect = sysDictItemByDictCode.stream().filter(e -> node.equals(e.getStatNode())).collect(Collectors.toList());
result.put(node,collect);
}
return result;
}
@@ -0,0 +1,43 @@
package com.jero.modules.system.util;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.vo.DictModel;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @description
* @date 2023/10/18 10:59
* @auth zhn
*/
public class DictItemUtil {
public static String getDictItemText(String cut, String value, List<DictModel> dictModelAll) {
if (StringUtils.isBlank(value)) {
return "";
}
List<DictModel> dictModelList = new ArrayList<>();
for (String s : value.split(",")) {
List<DictModel> dictModelListTemp = dictModelAll.stream()
.filter(e -> s.equals(e.getValue())).collect(Collectors.toList());
dictModelList.addAll(dictModelListTemp);
}
String targetMarket = "";
if (dictModelList.size() != 0) {
StringBuilder sb = new StringBuilder();
for (DictModel dictModel : dictModelList) {
if (CutEnum.CN.getValue().equals(cut)) {
sb.append(dictModel.getText() + ",");
} else {
sb.append(dictModel.getTextEn() + ",");
}
}
if (com.jero.modules.system.util.StringUtils.isNotBlank(sb)) {
targetMarket = sb.substring(0, sb.length() - 1);
}
}
return targetMarket;
}
}
@@ -1,30 +1,36 @@
package com.jero.modules.authDummy.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.authDummy.service.IAuthDummyInventoryInfoEOService;
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.modules.dummy.entity.DummyInventoryInfoEO;
import lombok.extern.slf4j.Slf4j;
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.authDummy.entity.AuthDummyInventoryInfoEO;
import com.jero.modules.authDummy.service.IAuthDummyInventoryInfoEOService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
/**
@@ -68,6 +74,9 @@ public class AuthDummyInventoryInfoEOController extends JeroController<AuthDummy
}else {
queryWrapper.orderByDesc("create_time");
}
if(StringUtils.isNotBlank(authDummyInventoryInfoEO.getFirstLevelDutyTerritory())){
queryWrapper.lambda().eq(AuthDummyInventoryInfoEO::getDutyDepart,authDummyInventoryInfoEO.getFirstLevelDutyTerritory());
}
Page<AuthDummyInventoryInfoEO> page = new Page<AuthDummyInventoryInfoEO>(pageNo, pageSize);
IPage<AuthDummyInventoryInfoEO> pageList = this.authDummyInventoryInfoEOService.page(page, queryWrapper);
this.authDummyInventoryInfoEOService.disposeData(pageList.getRecords(),authDummyInventoryInfoEO.getCut());
@@ -1,22 +1,19 @@
package com.jero.modules.authDummy.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.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
@@ -166,4 +163,8 @@ public class AuthDummyInventoryInfoEO implements Serializable {
@ApiModelProperty(value = "备注")
@Excel(name = "备注", width = 50)
private String remark;
@ApiModelProperty(value = "责任部门")
@TableField(exist = false)
private String firstLevelDutyTerritory;
}
@@ -10,6 +10,7 @@ import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
import com.jero.modules.cert.collect.service.IParamsCollectManifestHistoryEOService;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
@@ -43,6 +44,8 @@ import java.util.stream.Collectors;
public class ParamsCollectManifestEOController extends JeroController<ParamsCollectManifestEO, IParamsCollectManifestEOService> {
@Autowired
private IParamsCollectManifestEOService paramsCollectManifestEOService;
@Autowired
private IParamsCollectManifestHistoryEOService paramsCollectManifestHistoryEOService;
@Autowired
private ISysUserService sysUserService;
@@ -531,7 +534,12 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
public void exportAll(ParamsCollectManifestVO paramsCollectManifestVO,
HttpServletResponse response,
HttpServletRequest request) {
paramsCollectManifestEOService.exportAll(paramsCollectManifestVO, response, request);
if(StringUtils.isNotBlank(paramsCollectManifestVO.getIsHistory())&&paramsCollectManifestVO.getIsHistory().equals("1")){
paramsCollectManifestHistoryEOService.exportAll(paramsCollectManifestVO, response, request);
}else{
paramsCollectManifestEOService.exportAll(paramsCollectManifestVO, response, request);
}
}
@ApiOperation(value = "参数项收集清单-填写人角色下导出")
@@ -698,4 +706,27 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
public Result<?> queryDutyTerritory(@RequestParam(name="id",required=true) String id) {
return this.paramsCollectManifestEOService.queryDutyTerritory(id);
}
/**
* 查询本清单所有责任领域
*/
@AutoLog(value = "参数项历史收集清单-查询本清单所有责任领域")
@ApiOperation(value="参数项历史收集清单-查询本清单所有责任领域", notes="参数项历史收集清单-查询本清单所有责任领域")
@GetMapping(value = "/queryDutyTerritoryHistory")
public Result<?> queryDutyTerritoryHistory(@RequestParam(name="id",required=true) String id) {
return this.paramsCollectManifestEOService.queryDutyTerritoryHistory(id);
}
/**
* 某个项目责任领域下-工程接口人
*
* @return
*/
@AutoLog(value = "某个项目责任领域下-工程接口人")
@ApiOperation(value="某个项目责任领域下-工程接口人", notes="某个项目责任领域下-工程接口人")
@GetMapping(value = "/getSdtList")
public Result<List<Map<String,String>>> getSdtList(String projectId,String projectVersion,String dutyTerritory) {
List<Map<String,String>> sdtList = paramsCollectManifestEOService.getSdtList(projectId,projectVersion,dutyTerritory);
return Result.OK(sdtList);
}
}
@@ -1,5 +1,6 @@
package com.jero.modules.cert.collect.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
@@ -37,4 +38,7 @@ public class ParamsCollectManifestHistoryEO extends ParamsCollectManifestBaseEO
@ApiModelProperty(value = "参考列")
private String referencesCol;
@TableField(exist = false)
private String userTypes;//用户类型
}
@@ -1,11 +1,9 @@
package com.jero.modules.cert.collect.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.entity.ParamsManifestEO;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -41,5 +39,7 @@ public interface ParamsCollectManifestEOMapper extends BaseMapper<ParamsCollectM
List<String> queryDutyTerritory(@Param("paramsManifestId") String paramsManifestId);
List<String> queryDutyTerritoryHistory(@Param("paramsManifestId") String paramsManifestId);
}
@@ -159,5 +159,8 @@
<select id="queryDutyTerritory" resultType="java.lang.String">
SELECT duty_territory FROM params_collect_manifest WHERE params_manifest_id = #{paramsManifestId} GROUP BY duty_territory
</select>
<select id="queryDutyTerritoryHistory" resultType="java.lang.String">
SELECT duty_territory FROM params_collect_manifest_history WHERE params_manifest_id = #{paramsManifestId} GROUP BY duty_territory
</select>
</mapper>
@@ -84,7 +84,7 @@
#{item}
</foreach>
</if>
and control_type != '11'
order by nio_number asc
</select>
</mapper>
@@ -113,6 +113,8 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
List<Map<String,String>> querySdtList(ParamsCollectManifestVO paramsCollectManifestVO);
List<Map<String,String>> getSdtList(String projectId,String projectVersion,String dutyTerritory);
List<Map<String, String>> getLoginUserTypes(ParamsCollectManifestVO paramsCollectManifestVO, String cut);
Map<String, Object> isCollectFinished(String paramsManifestId);
@@ -204,4 +206,5 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
List<ParamsCollectManifestEO> getList(Map<String,Object> params);
Result<?> queryDutyTerritory(String id);
Result<?> queryDutyTerritoryHistory(String id);
}
@@ -3,8 +3,10 @@ package com.jero.modules.cert.collect.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestHistoryEO;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@@ -42,4 +44,7 @@ public interface IParamsCollectManifestHistoryEOService extends IService<ParamsC
*/
boolean deleteByIds(List<String> ids);
void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request);
}
@@ -78,4 +78,6 @@ public interface IParamsConfigDataEOService extends IService<ParamsConfigDataEO>
* @return
*/
List<ParamsConfigDataEO> queryListByConfigIdList(List<String> configIdList);
void handleData();
}
@@ -30,5 +30,5 @@ public interface IParamsConfigDataHistoryEOService extends IService<ParamsConfig
List<ParamsConfigDataHistoryEO> queryListByConfigIdList(List<String> configIdList);
int deleteByParamsCollectManifestIdList(List<String> paramsCollectManifestIdList);
void handleData();
}
@@ -13,7 +13,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.*;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.constant.enums.MessageType2Enum;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.MsgColorEnum;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.query.QueryRuleEnum;
@@ -21,15 +26,42 @@ import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.cert.collect.entity.*;
import com.jero.modules.cert.collect.enums.*;
import com.jero.modules.cert.collect.entity.ParamsCollectExport;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestBaseEO;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestLogEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigEO;
import com.jero.modules.cert.collect.entity.ParamsManifestEO;
import com.jero.modules.cert.collect.enums.CollectManifestChangeFlagEnum;
import com.jero.modules.cert.collect.enums.CollectManifestRoleIdEnum;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.CollectManifestUserTypeEnum;
import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum;
import com.jero.modules.cert.collect.enums.ConfigLockEnum;
import com.jero.modules.cert.collect.enums.ExportStateEnum;
import com.jero.modules.cert.collect.enums.ManifestStateEnum;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
import com.jero.modules.cert.collect.service.*;
import com.jero.modules.cert.collect.service.IParamsCollectExportService;
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
import com.jero.modules.cert.collect.service.IParamsCollectManifestLogEOService;
import com.jero.modules.cert.collect.service.IParamsCollectManifestUserTypeLogEOService;
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.vo.ParamsCollectManifestVO;
import com.jero.modules.cert.collect.vo.ParamsConfigDataVO;
import com.jero.modules.cert.collect.vo.ParamsManifestVO;
import com.jero.modules.cert.report.entity.*;
import com.jero.modules.cert.report.service.*;
import com.jero.modules.cert.report.entity.ParamsReportConfigDataEO;
import com.jero.modules.cert.report.entity.ParamsReportConfigEO;
import com.jero.modules.cert.report.entity.ParamsReportDetailEO;
import com.jero.modules.cert.report.entity.ParamsReportEO;
import com.jero.modules.cert.report.entity.ReportCertCategoryParamsInfoEO;
import com.jero.modules.cert.report.service.IParamsReportConfigDataEOService;
import com.jero.modules.cert.report.service.IParamsReportConfigEOService;
import com.jero.modules.cert.report.service.IParamsReportDetailEOService;
import com.jero.modules.cert.report.service.IParamsReportEOService;
import com.jero.modules.cert.report.service.IReportCertCategoryParamsInfoEOService;
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO;
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
import com.jero.modules.cert.template.enums.ControlTypeEnum;
@@ -61,22 +93,34 @@ import com.jero.modules.split.common.ReadExcel;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.entity.SysUserRole;
import com.jero.modules.system.service.IProjectUserDutyTerritoryService;
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;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
import org.aspectj.util.FileUtil;
import org.springframework.beans.BeanUtils;
@@ -92,15 +136,33 @@ import org.yaml.snakeyaml.util.UriEncoder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.text.Collator;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.UUID;
import java.util.stream.Collectors;
import static com.jero.modules.split.util.ExcelUtil.checkObjAllFieldsIsNull;
@@ -701,8 +763,19 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
if (StringUtils.isNotEmpty(paramsCollectManifestVO.getState())) {
paramsCollectManifestVO.setDre(paramsCollectManifestVO.getState().replaceAll("'", "\'"));
sqlJoinSb.append(" and state = '").append(paramsCollectManifestVO.getDre()).append("'");
String state = paramsCollectManifestVO.getState().replaceAll("'", "\'");
// state = "1,2,3,9";
StringBuilder sb = new StringBuilder();
for (String s : Arrays.asList(state.split(","))) {
sb.append("'"+s+"',");
}
String substring = sb.substring(0,sb.length() - 1);
sqlJoinSb.append(" and state in ( ").append(substring).append(" )");
}
// if (StringUtils.isNotEmpty(paramsCollectManifestVO.getState())) {
// paramsCollectManifestVO.setDre(paramsCollectManifestVO.getState().replaceAll("'", "\'"));
// sqlJoinSb.append(" and state = '").append(paramsCollectManifestVO.getDre()).append("'");
// }
if (StringUtils.isNotEmpty(paramsCollectManifestVO.getCertCategory())) {
sqlJoinSb.append(" and cert_category like '%").append(paramsCollectManifestVO.getCertCategory()).append("%'");
}
@@ -797,10 +870,12 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String referencesCol = collectManifestEO.getReferencesCol();
if (StringUtils.isNotBlank(referencesCol)) {
String[] referencesColArr = referencesCol.split("</br>");
int index = 0;
for (String col : referencesColArr) {
List<ParamsConfigDataVO> referencesColVOList = getReferencesColList(controlType, col, collectManifestEO, userTypes); // 重新组合配置数据
String key = UUID.randomUUID().toString().replaceAll("-","");
String key = index+"+"+UUID.randomUUID().toString().replaceAll("-","");
referencesColConfigDataVOMap.put(key,referencesColVOList);
index++;
}
referencesColMap.put("controlType", controlType);
@@ -810,7 +885,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
List<ParamsConfigDataVO> referencesColVOList = getReferencesColList(controlType, " # # #", collectManifestEO, userTypes); // 重新组合配置数据
referencesColMap.put("controlType", controlType);
String key = UUID.randomUUID().toString().replaceAll("-","");
String key = "0+"+UUID.randomUUID().toString().replaceAll("-","");
referencesColConfigDataVOMap.put(key,referencesColVOList);
referencesColMap.put("paramsConfigData", referencesColConfigDataVOMap);
manifestMap.put("referencesCol", referencesColMap);
@@ -836,7 +911,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
});
for (ParamsConfigDataEO paramsConfigDataEO : paramsConfigDatas) {
List<ParamsConfigDataVO> paramsConfigDataVOList = this.getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据
paramsConfigDataVO.put(paramsConfigDataEO.getOrderNum() + "+" + paramsConfigDataEO.getId(), paramsConfigDataVOList);
String num = "0";
if(ObjectUtil.isNotEmpty(paramsConfigDataEO.getOrderNum())){
num = String.valueOf(paramsConfigDataEO.getOrderNum());
}
paramsConfigDataVO.put(num + "+" + paramsConfigDataEO.getId(), paramsConfigDataVOList);
}
}else{
ParamsConfigDataEO paramsConfigDataEO = this.getConfigDataEOByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId, paramsConfigDataEOList); // 参数配置数据
@@ -1519,7 +1598,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));
String[] references = projectName.split("-");
// map.put("db_field_txt", references[0] + "-" + references[1] + "-" + paramsManifestEO.getReferencesColName() + " " + onlCgformField.getDbFieldTxt());//字段中文名
map.put("db_field_txt", paramsManifestEO.getReferencesColName() + " " + onlCgformField.getDbFieldTxt());//字段中文名
// map.put("db_field_txt", paramsManifestEO.getReferencesColName() + " " + onlCgformField.getDbFieldTxt());//字段中文名
map.put("db_field_txt", onlCgformField.getDbFieldTxt()+projectName+" "+paramsManifestEO.getReferencesColName());//字段中文名
map.put("db_field_id", paramsManifestEO.getReferencesColId());
map.put("references_col", true);
} else {
@@ -1537,7 +1617,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
map.put("db_field_name", LineHumpUtil.lineToHump(dbFieldName));
String[] references = projectName.split("-");
// map.put("db_field_txt", references[0] + "-" + references[1] + "-" + paramsManifestEO.getReferencesColName() + " " + onlCgformField.getDbFieldEnName());//字段中文名
map.put("db_field_txt", projectName + "-" + paramsManifestEO.getReferencesColName() + " " + onlCgformField.getDbFieldEnName());//字段中文名
// map.put("db_field_txt", projectName + "-" + paramsManifestEO.getReferencesColName() + " " + onlCgformField.getDbFieldEnName());//字段中文名
map.put("db_field_txt", onlCgformField.getDbFieldEnName()+" "+projectName + " " + paramsManifestEO.getReferencesColName());//字段英文名
map.put("db_field_id", paramsManifestEO.getReferencesColId());
map.put("references_col", true);
@@ -1962,6 +2043,30 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
return sdtList;
}
@Override
public List<Map<String, String>> getSdtList(String projectId,String projectVersion,String dutyTerritory) {
// 根据主项目ID 查询 相关项目版本的项目ID
String projectVersionId = projectLibraryBaseService.getIdByVersionAndParentId(projectVersion, projectId);
List<Map<String, String>> sdtList = new ArrayList<>();
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectVersionId, dutyTerritory);
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtIds = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (StringUtils.isNotBlank(sdtIds)) {
String[] sdtIdStr = sdtIds.split(",");
for (int i = 0; i < sdtIdStr.length; i++) {
SysUser sysUser = sysUserService.getById(sdtIdStr[i]);
if (ObjectUtil.isNotEmpty(sysUser)) {
Map<String, String> userMap = new HashMap<>();
userMap.put("userName", sysUser.getUsername());
userMap.put("id", sysUser.getId());
sdtList.add(userMap);
}
}
}
}
return sdtList;
}
@Override
public List<Map<String, String>> getLoginUserTypes(ParamsCollectManifestVO paramsCollectManifestVO, String cut) {
@@ -3521,6 +3626,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
addReportEO.setId(reportId);
addReportEO.setOldParamsManifestId(paramsManifestId);
addReportEO.setVersion(paramsManifestEO.getVersion());
addReportEO.setProjectVersion(paramsManifestEO.getProjectVersion());
addReportEO.setParamsTemplatePublishVersion(paramsManifestEO.getParamsTemplatePublishVersion());
paramsReportEOService.add(addReportEO);
}
@@ -3562,6 +3668,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
@Override
public boolean bringSdtInto(ParamsCollectManifestVO paramsCollectManifestVO) {
if(StringUtils.isBlank(paramsCollectManifestVO.getIds())){
return false;
}
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
String projectId = paramsCollectManifestVO.getProjectId();
@@ -3572,18 +3681,29 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
List<ParamsCollectManifestEO> list = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO);
// 过滤出 状态为待发起收集且工程接口人处为空的参数项
list = list.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())).collect(Collectors.toList());
//带入逻辑修改为只带入勾选的条目
if(StringUtils.isNotBlank(paramsCollectManifestVO.getIds())){
list = list.stream().filter(e->paramsCollectManifestVO.getIds().contains(e.getId())).collect(Collectors.toList());
}
// 过滤出 状态为待发起收集或变更且工程接口人处为空的参数项
list = list.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).collect(Collectors.toList());
// list = list.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())).collect(Collectors.toList());
//以下为新需求 2023-10-25----------------
//变更状态下允许带入接口人
//带入逻辑修改为只带入勾选的条目
//原有B或空相关人A=A相关人BC=B相关人AC=
List<ParamsCollectManifestEO> updateCollectManifestEOList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(list)) {
list.forEach(collectManifestEO -> {
String sdt = collectManifestEO.getSdt();
// 根据负责领域处理工程接口人零个一个多个 领域中仅有一个人时添加该字段
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectVersionId(), collectManifestEO.getDutyTerritory());
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时添加该字段
if (StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时添加该字段
SysUser sysUser = sysUserService.getById(sdtId);
if (ObjectUtil.isNotEmpty(sysUser)) {
ParamsCollectManifestEO updateCollectManifestEO = new ParamsCollectManifestEO();
@@ -3593,6 +3713,20 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
updateCollectManifestEOList.add(updateCollectManifestEO);
}
}
List<SysUser> sysUserList = sysUserService.listByIds(Arrays.asList(sdtId.split(",")));
List<String> userNameList = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList());
if (StringUtils.isNotBlank(sdt)
&& ObjectUtils.isNotEmpty(userNameList)
&& sdtId.contains(",")
&& !userNameList.contains(sdt)) {
ParamsCollectManifestEO updateCollectManifestEO = new ParamsCollectManifestEO();
updateCollectManifestEO.setId(collectManifestEO.getId());
updateCollectManifestEO.setSdt("");
updateCollectManifestEOList.add(updateCollectManifestEO);
}
}
});
@@ -3600,10 +3734,50 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
return updateBatchById(updateCollectManifestEOList);
}
// @Override
// public boolean bringSdtInto(ParamsCollectManifestVO paramsCollectManifestVO) {
// String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
// String projectId = paramsCollectManifestVO.getProjectId();
//
// // 查询参数清单
// ParamsManifestEO paramsManifestEO = paramsManifestEOService.getById(paramsManifestId);
//
// // 查询所有收集参数项
// ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
// paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
// List<ParamsCollectManifestEO> list = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO);
// // 过滤出 状态为待发起收集且工程接口人处为空的参数项
// list = list.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())).collect(Collectors.toList());
//
// List<ParamsCollectManifestEO> updateCollectManifestEOList = new ArrayList<>();
// if (CollectionUtil.isNotEmpty(list)) {
// list.forEach(collectManifestEO -> {
//
// // 根据负责领域处理工程接口人零个一个多个 领域中仅有一个人时添加该字段
// ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectVersionId(), collectManifestEO.getDutyTerritory());
// if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
// String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
// if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时添加该字段
// SysUser sysUser = sysUserService.getById(sdtId);
// if (ObjectUtil.isNotEmpty(sysUser)) {
// ParamsCollectManifestEO updateCollectManifestEO = new ParamsCollectManifestEO();
// updateCollectManifestEO.setId(collectManifestEO.getId());
// updateCollectManifestEO.setSdt(sysUser.getUsername());
//
// updateCollectManifestEOList.add(updateCollectManifestEO);
// }
// }
// }
// });
//
// }
//
// return updateBatchById(updateCollectManifestEOList);
// }
@Override
public void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
// OutputStream os = null;
OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "参数项清单导出信息";
@@ -3717,7 +3891,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
"attachment; filename=\"" + ReadExcel.encodeFileName(fileOriName + ".zip", request) + "\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
// os = response.getOutputStream();
workbook.write(excelOS);
excelOS.flush();
excelOS.close();
@@ -3762,8 +3936,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
// webSocket.sendMessage(obj.toJSONString());
//
// uploadFileio.close();
os.flush();
os.close(); // 后开先关
// os.flush();
// os.close(); // 后开先关
// fis.close(); // 先开后关
pce.setState(ExportStateEnum.SUCCESSFULLY.getValue());
pce.setFileId(ossFile.getId());
@@ -3782,7 +3956,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
}
} finally {
IOUtils.closeQuietly(os);
// IOUtils.closeQuietly(os);
IOUtils.closeQuietly(excelOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
@@ -7492,4 +7666,22 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
return Result.OK(resList);
}
@Override
public Result<?> queryDutyTerritoryHistory(String paramsManifestId) {
List<String> dtList = paramsCollectManifestEOMapper.queryDutyTerritoryHistory(paramsManifestId);
List<SysDictItem> dtSdiList = sysDictItemService.selectItemsByDictCode("duty_territory");
Map<String,String> dictItemsMap = dtSdiList.stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getEnName));
JSONArray resList = new JSONArray();
if(ObjectUtils.isNotEmpty(dtList)){
for (String dtId : dtList) {
if(StringUtils.isNotBlank(dtId)){
JSONObject dt = new JSONObject();
dt.put("key",dtId);
dt.put("value",dictItemsMap.get(dtId));
resList.add(dt);
}
}
}
return Result.OK(resList);
}
}
@@ -2,38 +2,94 @@ package com.jero.modules.cert.collect.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ZipUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.constant.enums.ModuleEnum;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.cert.collect.entity.*;
import com.jero.modules.cert.collect.entity.ParamsCollectExport;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestHistoryEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO;
import com.jero.modules.cert.collect.entity.ParamsConfigEO;
import com.jero.modules.cert.collect.entity.ParamsConfigHistoryEO;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.CollectManifestUserTypeEnum;
import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum;
import com.jero.modules.cert.collect.enums.ExportStateEnum;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestHistoryEOMapper;
import com.jero.modules.cert.collect.service.IParamsCollectExportService;
import com.jero.modules.cert.collect.service.IParamsCollectManifestHistoryEOService;
import com.jero.modules.cert.collect.service.IParamsConfigDataHistoryEOService;
import com.jero.modules.cert.collect.service.IParamsConfigHistoryEOService;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.cert.collect.vo.ParamsConfigDataVO;
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO;
import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.cert.template.service.ICertCategoryParamsInfoPublishEOService;
import com.jero.modules.ocr.util.LineHumpUtil;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.split.common.ReadExcel;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.service.IProjectUserDutyTerritoryService;
import com.jero.modules.system.service.ISysDictItemService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
import org.aspectj.util.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.stream.Collectors;
/**
@@ -62,6 +118,14 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
@Autowired
private IOSSFileService ossFileService;
@Autowired
private IParamsCollectExportService paramsCollectExportService;
@Autowired
private ICertCategoryParamsInfoPublishEOService certCategoryParamsInfoPublishEOService;
@Autowired
private IProjectUserDutyTerritoryService projectUserDutyTerritoryService;
@Value(value = "${jero.path.upload}")
private String uploadpath;
private ParamsConfigDataHistoryEO getConfigDataEOByConfigIdAndCollectManifestId(String configId, String collectManifestId, List<ParamsConfigDataHistoryEO> paramsConfigDataEOList) {
@@ -88,6 +152,25 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
.orderByAsc(ParamsCollectManifestHistoryEO::getNioNumber);
String paramsManifestId = paramsCollectManifestHistoryEO.getParamsManifestId();
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
String userTypes = paramsCollectManifestHistoryEO.getUserTypes();
if (CollectManifestUserTypeEnum.SDT.getValue().equals(userTypes)) {
queryWrapper.lambda().eq(ParamsCollectManifestHistoryEO::getSdt,loginUser.getUsername());
queryWrapper.lambda().in(ParamsCollectManifestHistoryEO::getState,new ArrayList<String>(Arrays.asList("2","4","5","6","7","8")));
} else if (CollectManifestUserTypeEnum.DRE.getValue().equals(userTypes)) {
queryWrapper.lambda().eq(ParamsCollectManifestHistoryEO::getDre,loginUser.getUsername());
queryWrapper.lambda().in(ParamsCollectManifestHistoryEO::getState,new ArrayList<String>(Arrays.asList("4","6","7","8")));
} else if (CollectManifestUserTypeEnum.GUEST.getValue().equals(userTypes)) {
return page;
} else if (CollectManifestUserTypeEnum.VIEWER.getValue().equals(userTypes)) {
List<String> dutyTerritoryList = projectUserDutyTerritoryService.queryDutyTerritoryByUserId(loginUser.getId());
queryWrapper.lambda().and(q->{
q.eq(ParamsCollectManifestHistoryEO::getSdt,loginUser.getUsername());
q.or().eq(ParamsCollectManifestHistoryEO::getDre,loginUser.getUsername());
q.or().in(ParamsCollectManifestHistoryEO::getDutyTerritory,dutyTerritoryList);
});
}
IPage pageInfo = page(page, queryWrapper); // 查询固定列
// IPage pageInfo = paramsCollectManifestHistoryEOMapper.pageInfo(page, paramsCollectManifestEO); // 查询固定列
@@ -177,7 +260,11 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
});
for (ParamsConfigDataHistoryEO paramsConfigDataEO : configDataEOList) {
List<ParamsConfigDataVO> paramsConfigDataVOList = this.getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据
paramsConfigDataVO.put(paramsConfigDataEO.getOrderNum()+"+"+paramsConfigDataEO.getId(), paramsConfigDataVOList);
String num = "0";
if(ObjectUtil.isNotEmpty(paramsConfigDataEO.getOrderNum())){
num = String.valueOf(paramsConfigDataEO.getOrderNum());
}
paramsConfigDataVO.put(num+"+"+paramsConfigDataEO.getId(), paramsConfigDataVOList);
}
}else{
ParamsConfigDataHistoryEO paramsConfigDataEO = this.getConfigDataEOByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId, paramsConfigDataEOList); // 参数配置数据
@@ -602,4 +689,531 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
// }
// return map;
// }
@Override
public void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
OutputStream excelOS = null;
XSSFWorkbook workbook = new XSSFWorkbook();
String fileOriName = "参数项清单导出信息";
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
fileOriName = "Params info export data";
}
if (StringUtils.isNotEmpty(paramsCollectManifestVO.getExportName())) {
fileOriName = paramsCollectManifestVO.getExportName();
}
//创建导出记录
ParamsCollectExport pce = new ParamsCollectExport();
String pceId = UUID.randomUUID().toString().replace("-", "");
pce.setId(pceId);
pce.setParamsManifestId(paramsCollectManifestVO.getParamsManifestId());
pce.setState(ExportStateEnum.EXPORTING.getValue());
pce.setFileName(fileOriName+ ".zip");
Thread thread1 = new Thread(new Runnable() {
@Override
public void run() {
paramsCollectExportService.add(pce);
}
});
thread1.start();
//创建临时文件夹
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-", "") + File.separator + fileOriName;
File nowFile = new File(fileNowPath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
try {
String fileName = fileOriName + ".xlsx";
// 设置表格相关属性
String sheetName = "参数项清单信息";
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
sheetName = "Params data";
}
XSSFSheet sheetItems = workbook.createSheet(sheetName);
String[] titles = getWorkbookTitleForExport(paramsCollectManifestVO); // 获取表头
String[] headers = titles[1].split(",");
XSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setWrapText(true);
// cellStyle.setAlignment(XSSFCellStyle.ALIGN_CENTER);
cellStyle.setVerticalAlignment(XSSFCellStyle.VERTICAL_CENTER);
XSSFCellStyle cellStyle1 = workbook.createCellStyle();
cellStyle1.setAlignment(XSSFCellStyle.ALIGN_CENTER);
XSSFCellStyle cellStyleLink = workbook.createCellStyle();
XSSFFont font = workbook.createFont();
font.setColor(HSSFColor.LIGHT_BLUE.index);
cellStyleLink.setFont(font);
cellStyleLink.setWrapText(true);
// 查询需要导出的字段
String field = titles[0]; // 字符串形式
List<String> fieldList = Arrays.asList(field.split(",")); // list形式
// 查询导出数据
List<Map<String, Object>> allParamsInfoList = queryForExportAll(paramsCollectManifestVO); // id记得去掉
// 开始处理工作表
List<OSSFile> allRelevFileList = new ArrayList<>();
// 在excel表中添加表头
XSSFRow row = sheetItems.createRow(0);
for (int i = 0; i < headers.length; i++) {
XSSFCell cell = row.createCell(i);
XSSFRichTextString text = new XSSFRichTextString(headers[i]);
cell.setCellValue(text);
cell.setCellStyle(cellStyle1);
sheetItems.setColumnWidth(i, 20 * 256); // 设置单元格宽度
}
Map<String, String> fileNowPathMap = new HashMap<>();
//放文字内容
int allRow = 0;
for (int rowNum = 0; rowNum < allParamsInfoList.size(); rowNum++) {
Map<String, Object> exportDto = allParamsInfoList.get(rowNum);
// 处理文件
List<OSSFile> fileList = (List<OSSFile>) exportDto.get("fileList");
if (CollectionUtil.isNotEmpty(fileList)) {
allRelevFileList.addAll(fileList);
fileList.forEach(file -> {
fileNowPathMap.put(file.getId(), fileNowPath + File.separator + exportDto.get("nio_number"));
});
}
allRow++;
XSSFRow row1 = sheetItems.createRow(allRow);
for (int cellNum = 0; cellNum < fieldList.size(); cellNum++) {
if (ObjectUtils.isNotEmpty(exportDto.get(fieldList.get(cellNum)))) {
row1.createCell(cellNum).setCellValue(exportDto.get(fieldList.get(cellNum)).toString());
row1.getCell(cellNum).setCellStyle(cellStyle);
}
}
}
//下载关联文件内容
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList, fileNowPathMap);
}
String repFileName = fileName.replaceAll("/", "_");
excelOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
response.setHeader("Content-Disposition",
"attachment; filename=\"" + ReadExcel.encodeFileName(fileOriName + ".zip", request) + "\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(excelOS);
excelOS.flush();
excelOS.close();
ZipUtil.zip(fileNowPath, fileNowPath + ".zip");
// FileInputStream fis = new FileInputStream(fileNowPath + ".zip");
// int len = 0;
// while ((len = fis.read()) != -1) {
// os.write(len);
// }
// 将导出文件上传到cos上
String uploadFileName = fileOriName + ".zip";
InputStream uploadFileio = new FileInputStream(new File(fileNowPath+".zip"));
MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, "text/plain", uploadFileio); // 用于上传
OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/manifest", "", CutEnum.CN.getValue()); // 上传导出的压缩包
//
// // 系统向用户发消息
// LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人
// String msgTitle = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated.";
// String content = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click download.";
//
// String href = "<a href='/jero-boot/sys/common/downLoadFile?id=" + ossFile.getId() + "'" + " target='_blank'>download</a>.";
// String contentInfo = "The file " + paramsCollectManifestVO.getExportName() + " that you exported has been generated, please click " + href;
//
// SysAnnouncement sysAnnouncement = new SysAnnouncement();
// sysAnnouncement.setDelFlag("0");
// sysAnnouncement.setSendStatus("0");
// sysAnnouncement.setSendTime(new Date());
// sysAnnouncement.setMsgCategory(MessageTypeEnum.PUSH.getValue()); //消息类型:转发推送
// sysAnnouncement.setInitiator(MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); // 发起人:系统
// sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
// sysAnnouncement.setTitile(msgTitle);
// sysAnnouncement.setMsgContent(content);
// sysAnnouncement.setMsgContentInfo(contentInfo);
// sysAnnouncement.setUserIds(currentUser.getId()); // 发送给当前导出人
// sysAnnouncementService.saveAnnouncement(sysAnnouncement);
//
// JSONObject obj = new JSONObject();
// obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
// obj.put(WebsocketConst.MSG_ID, currentUser.getId());
// obj.put(WebsocketConst.MSG_TXT, contentInfo);
// webSocket.sendMessage(obj.toJSONString());
//
// uploadFileio.close();
os.flush();
os.close(); // 后开先关
// fis.close(); // 先开后关
pce.setState(ExportStateEnum.SUCCESSFULLY.getValue());
pce.setFileId(ossFile.getId());
paramsCollectExportService.updateById(pce);
} catch (Exception e) {
pce.setState(ExportStateEnum.FAILURE.getValue());
paramsCollectExportService.updateById(pce);
if (e instanceof JeroBootException) {
throw new JeroBootException(e.getMessage());
} else {
log.error(e.getMessage(), e);
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
throw new JeroBootException("Failed to download file, please try again");
} else {
throw new JeroBootException("下载文件失败,请重试");
}
}
} finally {
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(excelOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
}
}
private String[] getWorkbookTitleForExport(ParamsCollectManifestVO paramsCollectManifestVO) {
String cut = paramsCollectManifestVO.getCut();
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.PARAMS_COLLECT_MANIFEST.getValue());
List<String> dbFieldNameList = new LinkedList<>();
List<String> dbFieldList = new LinkedList<>();
if (fieldList.size() != 0) {
//过滤列表字段(is_show_list-->列表是否显示0否 1是)
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue().equals(String.valueOf(e.getIsShowList()))).collect(Collectors.toList());
}
// 固定列
int indexOfDescription = 1; // 参数名称的位置
for (int i = 0; i < fieldList.size(); i++) {
OnlCgformField onlCgformField = fieldList.get(i);
String dbFieldName = onlCgformField.getDbFieldName();
if (!"deadline".equals(dbFieldName) && !"cert_category".equals(dbFieldName)) {
dbFieldList.add(dbFieldName);
if (CutEnum.CN.getValue().equals(cut)) {
dbFieldNameList.add(onlCgformField.getDbFieldTxt()); // 字段中文名
} else {
dbFieldNameList.add(onlCgformField.getDbFieldEnName()); // 字段英文名
}
if ("params_name".equals(dbFieldName)) {
indexOfDescription = i;
}
}
}
// 认证类别列
List<String> dbFieldNameListCC = new LinkedList<>();
List<String> dbFieldListCC = new LinkedList<>();
// 查询所有认证类别
List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByDictCode("cert_category");
if (CutEnum.EN.getValue().equals(cut)) {
sysDictItemList.forEach(sysDictItem -> {
dbFieldListCC.add(sysDictItem.getItemValue());
dbFieldNameListCC.add(sysDictItem.getEnName() + " Number");
});
} else {
sysDictItemList.forEach(sysDictItem -> {
dbFieldListCC.add(sysDictItem.getItemValue());
dbFieldNameListCC.add(sysDictItem.getItemText() + "编号");
});
}
// 配置列
List<String> dbFieldNameListConfig = new LinkedList<>();
List<String> dbFieldListConfig = new LinkedList<>();
List<ParamsConfigHistoryEO> paramsConfigEOList = paramsConfigHistoryEOService.queryList(paramsManifestId);
for (ParamsConfigHistoryEO paramsConfigEO : paramsConfigEOList) {
dbFieldListConfig.add(paramsConfigEO.getId());
dbFieldNameListConfig.add(paramsConfigEO.getConfigName());
}
// 插入认证类别列
dbFieldList.addAll(indexOfDescription, dbFieldListCC);
dbFieldNameList.addAll(indexOfDescription, dbFieldNameListCC);
// 插入配置列
dbFieldList.addAll(dbFieldListConfig);
dbFieldNameList.addAll(dbFieldNameListConfig);
String[] title = new String[2];
String dbFieldStr = StringUtils.join(dbFieldList, ",");
String dbFieldNameStr = StringUtils.join(dbFieldNameList, ",");
title[0] = dbFieldStr;
title[1] = dbFieldNameStr;
return title;
}
private List<Map<String, Object>> queryForExportAll(ParamsCollectManifestVO paramsCollectManifestVO) {
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
String paramsTemplateId = paramsCollectManifestVO.getParamsTemplateId();
Integer paramsTemplatePublishVersion = paramsCollectManifestVO.getParamsTemplatePublishVersion();
String cut = paramsCollectManifestVO.getCut();
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ParamsCollectManifestEO queryEO = new ParamsCollectManifestEO();
queryEO.setParamsManifestId(paramsManifestId);
String userTypes = paramsCollectManifestVO.getUserTypes();
if (userTypes != null && CollectManifestUserTypeEnum.SDT.getValue().equals(userTypes)) {
queryEO.setUserTypes(CollectManifestUserTypeEnum.SDT.getValue());
queryEO.setSdt(loginUser.getUsername());
}
List<Map<String, Object>> dataList = paramsCollectManifestHistoryEOMapper.listInfoForExport(queryEO, null); // 查询导出数据
if (dataList == null || dataList.isEmpty()) {
// 没有查到数据,进行提示
if (CutEnum.EN.getValue().equals(paramsCollectManifestVO.getCut())) {
throw new JeroBootException("No data, unable to export");
} else {
throw new JeroBootException("无数据,无法导出");
}
}
List<ParamsConfigHistoryEO> paramsConfigEOList = paramsConfigHistoryEOService.queryList(paramsManifestId); // 查询所有配置列
List<String> paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList());
List<ParamsConfigDataHistoryEO> paramsConfigDataEOList = paramsConfigDataHistoryEOService.queryListByConfigIdList(paramsConfigIdList); // 查询所有配置数据
List<Map<String,Object>> exportDataList = new ArrayList<>();
// 配置列多行数据处理
for (Map<String, Object> data : dataList) {
String controlType = (String)data.get("control_type");
if("0".equals(paramsCollectManifestVO.getExportOption()) && "11".equals(controlType)){
//不要标题
continue;
}
String id = (String) data.get("id");
Map<String, List<ParamsConfigDataHistoryEO>> paramsConfigDataMap = paramsConfigDataEOList.stream().filter(configDataEO -> {
boolean flag = false;
if (StringUtils.equals(configDataEO.getParamsCollectManifestId(), id)) {
flag = true;
}
return flag;
}).collect(Collectors.groupingBy(configDataEO -> configDataEO.getParamsConfigId()));
List<Map<String, Object>> paramsConfigDataCountList = new ArrayList<>();
for (Map.Entry<String, List<ParamsConfigDataHistoryEO>> map : paramsConfigDataMap.entrySet()) {
Map<String, Object> paramsConfigDataCountMap = new HashMap<>();
paramsConfigDataCountMap.put("key", map.getKey());
paramsConfigDataCountMap.put("paramsConfigDataCount", map.getValue().size());
paramsConfigDataCountMap.put("value", map.getValue());
paramsConfigDataCountList.add(paramsConfigDataCountMap);
}
// 排序 配置数据总数倒序排序
Collections.sort(paramsConfigDataCountList, new Comparator<Map<String, Object>>() {
@Override
public int compare(Map<String, Object> o1, Map<String, Object> o2) {
return o2.get("paramsConfigDataCount").toString().compareTo(o1.get("paramsConfigDataCount").toString());
}
});
// 获取出最多行的配置列。
if (!paramsConfigDataCountList.isEmpty()) {
Map<String, Object> paramsConfigDataMaxCountMap = paramsConfigDataCountList.get(0);
String key = (String) paramsConfigDataMaxCountMap.get("key");
List<ParamsConfigDataHistoryEO> paramsConfigDataEOs = paramsConfigDataMap.get(key);
for (ParamsConfigDataHistoryEO paramsConfigDataEO : paramsConfigDataEOs) {
Map<String, Object> dataTemp = new HashMap<>();
data.entrySet().forEach(o -> dataTemp.put(o.getKey(), o.getValue()));
exportDataList.add(dataTemp);
}
} else {
exportDataList.add(data);
}
}
List<String> nioNumberList = dataList.stream().map(m -> (String) m.get("nio_number")).collect(Collectors.toList());
List<CertCategoryParamsInfoPublishEO> certCategoryParamsInfoPublishEOList = certCategoryParamsInfoPublishEOService.queryListByVersionAndNio(paramsTemplateId, paramsTemplatePublishVersion, nioNumberList); //查询所有认证类别参数项
// 查询责任领域数据字典
List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByDictCode("duty_territory");
Map<String, String> dutyTerritoryMap = new HashMap<>();
if (CutEnum.EN.getValue().equals(cut)) {
dutyTerritoryMap = sysDictItemList.stream().collect(Collectors.toMap(c -> c.getItemValue(), c -> c.getEnName()));
} else {
dutyTerritoryMap = sysDictItemList.stream().collect(Collectors.toMap(c -> c.getItemValue(), c -> c.getItemText()));
}
// 状态
Map<String, String> stateMap = CollectManifestStateEnum.toMap(cut);
// 插入配置列和认证类别列数据
for (Map<String, Object> record1 : exportDataList) {
String paramsCollectManifestId = (String) record1.get("id");
String nioNumber = (String) record1.get("nio_number");
String dutyTerritory = (String) record1.get("duty_territory");
String state = (String) record1.get("state");
String control_type = record1.get("control_type").toString();
//references_col -> #a# #
if (!Objects.isNull(record1.get("references_col"))) {
String references_col = record1.get("references_col").toString();
if (StringUtils.isNotEmpty(references_col)) {
String[] references_colArr = references_col.split("#");
if (StringUtils.equals(control_type, ControlTypeEnum.FILE.getValue())) {
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#" + references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
} else if (StringUtils.equals(control_type, ControlTypeEnum.TEXT_FILE.getValue())
|| StringUtils.equals(control_type, ControlTypeEnum.PULL_SINGLE_FILE.getValue())
|| StringUtils.equals(control_type, ControlTypeEnum.PULL_MORE_FILE.getValue())) {
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#" + references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
} else if (StringUtils.equals(control_type, ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue())) {
String fileId = references_colArr[2];
List<OSSFile> fileInfos = this.ossFileService.getFileInfos(fileId);
String fileName = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
references_col = "#" + references_colArr[0] + "#" + references_colArr[1] + "#" + fileName;
}
StringBuilder references_colSb = new StringBuilder();
for (String col : references_col.split("#")) {
if (StringUtils.isNotEmpty(col) && !StringUtils.equals(col, " ")) {
references_colSb.append(col).append("#");
}
}
if (StringUtils.isNotEmpty(references_colSb)) {
references_col = references_colSb.substring(0, references_colSb.length() - 1);
} else {
references_col = references_colSb.toString();
}
record1.put("references_col", references_col);
}
}
// 处理负责领域
record1.put("duty_territory", dutyTerritoryMap.get(dutyTerritory));
// 处理状态
record1.put("state", stateMap.get(state));
// 认证类别列
List<CertCategoryParamsInfoPublishEO> certCategoryParamsInfoPublishEOS = certCategoryParamsInfoPublishEOList.stream().filter(e -> nioNumber.equals(e.getNioNumber())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(certCategoryParamsInfoPublishEOS)) {
certCategoryParamsInfoPublishEOS.forEach(certCategoryParamsInfoPublishEO -> {
record1.put(certCategoryParamsInfoPublishEO.getCertCategory(), certCategoryParamsInfoPublishEO.getParamsNumber());
});
}
// 配置列
if (CollectionUtil.isNotEmpty(paramsConfigEOList)) {
List<OSSFile> fileList = new ArrayList<>();
paramsConfigEOList.forEach(paramsConfigEO -> { // 参数配置
String paramsConfigId = paramsConfigEO.getId();
List<ParamsConfigDataHistoryEO> paramsConfigDataEOS = paramsConfigDataEOList.stream().filter(e -> {
boolean flag = false;
if(StringUtils.equals(paramsConfigId,e.getParamsConfigId()) && StringUtils.equals(paramsCollectManifestId,e.getParamsCollectManifestId())){
flag = true;
}
return flag;
}).collect(Collectors.toList()); // 参数配置数据
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
if (CollectionUtil.isNotEmpty(paramsConfigDataEOS)) {
ParamsConfigDataHistoryEO paramsConfigDataEO = paramsConfigDataEOS.get(0);
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataBuilder.append(paramsConfigDataEO.getTextData()).append("#");
}
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataBuilder.append(paramsConfigDataEO.getPullData()).append("#");
}
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
configDataBuilder.append(nioNumber).append("/").append(ossFileList.get(0).getFileName()).append("#");
fileList.addAll(ossFileList);
}
}
Iterator<ParamsConfigDataHistoryEO> iterator = paramsConfigDataEOList.iterator();
while (iterator.hasNext()) {
ParamsConfigDataHistoryEO element = iterator.next();
if (element.getId().equals(paramsConfigDataEO.getId())) {
iterator.remove();
break;
}
}
}
String configData = configDataBuilder.toString();
if (configData.contains("#")) {
configData = configData.substring(0, configData.lastIndexOf("#"));
}
record1.put(paramsConfigEO.getId(), configData);
});
record1.put("fileList", fileList);
}
}
return exportDataList;
}
private void downLoadFileList(List<OSSFile> fileTemplateList, Map<String, String> fileNowPathMap) {
for (OSSFile fileExportDto : fileTemplateList) {
String fileNowPath = fileNowPathMap.get(fileExportDto.getId());
File nowFile = new File(fileNowPath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
String oldPath = fileExportDto.getUrl();
String newPath = fileNowPath + File.separator + fileExportDto.getFileName();
if (CosBootUtil.doesObjectExist(oldPath)) {
try (InputStream in = CosBootUtil.download(oldPath);) {
copyFile(in, newPath);
} catch (IOException e) {
e.printStackTrace();
log.error(e.getMessage(), e);
}
}
}
}
private void copyFile(InputStream in, String destPath) throws IOException {
BufferedInputStream bis = new BufferedInputStream(in);
BufferedOutputStream bos =
new BufferedOutputStream(Files.newOutputStream(Paths.get(destPath),
StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING,
StandardOpenOption.WRITE));
// 打开输入流
// FileInputStream fis = new FileInputStream(srcPath);
// 打开输出流
// FileOutputStream fos = new FileOutputStream(destPath);
// 读取和写入信息
byte[] bytes = new byte[1024 * 1024];
int len;
while ((len = bis.read(bytes)) > 0) {
bos.write(bytes, 0, len);
}
// 关闭流 先开后关 后开先关
bos.close(); // 后开先关
bis.close(); // 先开后关
}
}
@@ -11,8 +11,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
* @Description: 参数配置数据
@@ -111,6 +110,7 @@ public class ParamsConfigDataEOServiceImpl extends ServiceImpl<ParamsConfigDataE
LambdaQueryWrapper<ParamsConfigDataEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ParamsConfigDataEO::getParamsConfigId, paramsConfigId);
queryWrapper.eq(ParamsConfigDataEO::getParamsCollectManifestId, paramsCollectManifestId);
queryWrapper.orderByAsc(ParamsConfigDataEO::getOrderNum);
return this.list(queryWrapper);
}
@@ -134,8 +134,45 @@ public class ParamsConfigDataEOServiceImpl extends ServiceImpl<ParamsConfigDataE
if (CollectionUtil.isNotEmpty(configIdList)) {
LambdaQueryWrapper<ParamsConfigDataEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsConfigDataEO::getParamsConfigId, configIdList);
queryWrapper.orderByAsc(ParamsConfigDataEO::getOrderNum);
return list(queryWrapper);
}
return null;
}
public void handleData() {
List<ParamsConfigDataEO> list = this.list();
Map<String, List<ParamsConfigDataEO>> map = new HashMap<>();
for (ParamsConfigDataEO prcd : list) {
String pid = prcd.getParamsCollectManifestId()+"+"+prcd.getParamsConfigId();
List<ParamsConfigDataEO> dataList = null;
if(map.containsKey(pid)){
dataList = map.get(pid);
}else{
dataList = new ArrayList<>();
}
dataList.add(prcd);
map.put(pid,dataList);
}
List<ParamsConfigDataEO> updateList = new ArrayList<>();
for (List<ParamsConfigDataEO> dataList:map.values()) {
Collections.sort(dataList, new Comparator<ParamsConfigDataEO>() {
@Override
public int compare(ParamsConfigDataEO o1, ParamsConfigDataEO o2) {
return Integer.compare(o1.getOrderNum(), o2.getOrderNum());
}
});
int num = 0;
for (ParamsConfigDataEO prcd:dataList) {
prcd.setOrderNum(num);
updateList.add(prcd);
num++;
}
}
if(CollectionUtil.isNotEmpty(updateList)){
this.updateBatchById(updateList);
}
}
}
@@ -10,7 +10,7 @@ import com.jero.modules.cert.collect.service.IParamsConfigDataHistoryEOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.*;
/**
* @Description: 参数配置数据历史版本
@@ -50,6 +50,7 @@ public class ParamsConfigDataHistoryEOServiceImpl extends ServiceImpl<ParamsConf
if (CollectionUtil.isNotEmpty(configIdList)) {
LambdaQueryWrapper<ParamsConfigDataHistoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsConfigDataHistoryEO::getParamsConfigId, configIdList);
queryWrapper.orderByAsc(ParamsConfigDataHistoryEO::getOrderNum);
return list(queryWrapper);
}
return null;
@@ -62,4 +63,40 @@ public class ParamsConfigDataHistoryEOServiceImpl extends ServiceImpl<ParamsConf
return paramsConfigDataHistoryEOMapper.delete(queryWrapper);
}
public void handleData() {
List<ParamsConfigDataHistoryEO> list = this.list();
Map<String, List<ParamsConfigDataHistoryEO>> map = new HashMap<>();
for (ParamsConfigDataHistoryEO prcd : list) {
String pid = prcd.getParamsCollectManifestId()+"+"+prcd.getParamsConfigId();
List<ParamsConfigDataHistoryEO> dataList = null;
if(map.containsKey(pid)){
dataList = map.get(pid);
}else{
dataList = new ArrayList<>();
}
dataList.add(prcd);
map.put(pid,dataList);
}
List<ParamsConfigDataHistoryEO> updateList = new ArrayList<>();
for (List<ParamsConfigDataHistoryEO> dataList:map.values()) {
Collections.sort(dataList, new Comparator<ParamsConfigDataHistoryEO>() {
@Override
public int compare(ParamsConfigDataHistoryEO o1, ParamsConfigDataHistoryEO o2) {
return Integer.compare(o1.getOrderNum(), o2.getOrderNum());
}
});
int num = 0;
for (ParamsConfigDataHistoryEO prcd:dataList) {
prcd.setOrderNum(num);
updateList.add(prcd);
num++;
}
}
if(CollectionUtil.isNotEmpty(updateList)){
this.updateBatchById(updateList);
}
}
}
@@ -14,9 +14,7 @@ import com.jero.common.system.vo.DictModel;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestHistoryEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO;
import com.jero.modules.cert.collect.entity.ParamsConfigEO;
import com.jero.modules.cert.collect.entity.ParamsConfigHistoryEO;
import com.jero.modules.cert.collect.entity.ParamsManifestEO;
import com.jero.modules.cert.collect.entity.ParamsManifestHistoryEO;
import com.jero.modules.cert.collect.enums.CollectManifestChangeFlagEnum;
@@ -36,7 +34,9 @@ import com.jero.modules.cert.collect.service.IParamsManifestEOService;
import com.jero.modules.cert.collect.service.IParamsManifestHistoryEOService;
import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO;
import com.jero.modules.cert.collect.vo.ParamsManifestVO;
import com.jero.modules.cert.report.entity.ParamsReportConfigEO;
import com.jero.modules.cert.report.entity.ParamsReportEO;
import com.jero.modules.cert.report.service.IParamsReportConfigEOService;
import com.jero.modules.cert.report.service.IParamsReportDetailEOService;
import com.jero.modules.cert.report.service.IParamsReportEOService;
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
@@ -125,6 +125,8 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
@Autowired
private IParamsConfigHistoryEOService paramsConfigHistoryEOService;
@Autowired
private IParamsReportConfigEOService paramsReportConfigEOService;
@Autowired
private IParamsConfigDataEOService paramsConfigDataEOService;
@@ -183,7 +185,21 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
return p2.getCreateTime().compareTo(p1.getCreateTime());
}
});
//处理中英文切换--状态字段
for (ParamsManifestEO manifestEO : resList) {
String state = manifestEO.getState();
if(CutEnum.EN.getValue().equals(paramsManifestEO.getCut())){
if(ManifestStateEnum.UNCOLLECTED.getName().equals(state)){
manifestEO.setState(ManifestStateEnum.UNCOLLECTED.getEnName());
}
if(ManifestStateEnum.COLLECTING.getName().equals(state)){
manifestEO.setState(ManifestStateEnum.COLLECTING.getEnName());
}
if(ManifestStateEnum.FINISHED.getName().equals(state)){
manifestEO.setState(ManifestStateEnum.FINISHED.getEnName());
}
}
}
return resList;
}
@@ -700,57 +716,49 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
if (StringUtils.isNotEmpty(paramsInfoPublishEO.getFileTemplateConnectId())) {
updateCollectManifestEO.setFileTemplateConnectId(paramsInfoPublishEO.getFileTemplateConnectId());
}
updateCollectManifestEOList.add(updateCollectManifestEO);
}
}
//删除旧的参数数据
List<String> oldDataList = oldParamsCollectManifestEOList.stream().map(ParamsCollectManifestEO::getId).collect(Collectors.toList());
paramsConfigDataEOService.deleteByParamsCollectManifestIdList(oldDataList);
// 查询配置信息
List<String> configIdList = paramsConfigEOService.queryList(id).stream().map(ParamsConfigEO::getId).collect(Collectors.toList());
List<ParamsConfigDataEO> paramsConfigDataEOList = paramsConfigDataEOService.queryListByConfigIdList(configIdList);
// 按照上报库参数项配置数据 更新 参数收集清单配置数据
List<Map<String, Object>> reportConfigDataEOList = new ArrayList<>();
List<ParamsConfigDataEO> configDataEOList = new ArrayList<>();
for (ParamsCollectManifestEO updateCollectManifestEO : updateCollectManifestEOList) {
for (String configId : configIdList) {
reportConfigDataEOList = paramsReportConfigDataList.stream().filter(e -> updateCollectManifestEO.getNioNumber().equals(e.get("nio_number"))
&& configId.equals(e.get("old_params_config_id"))).collect(Collectors.toList());
configDataEOList = paramsConfigDataEOList.stream().filter(e -> updateCollectManifestEO.getId().equals(e.getParamsCollectManifestId())
&& configId.equals(e.getParamsConfigId())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(reportConfigDataEOList) && CollectionUtil.isNotEmpty(configDataEOList)) {
ParamsConfigDataEO updateParamsConfigDataEO = new ParamsConfigDataEO();
updateParamsConfigDataEO.setId(String.valueOf(configDataEOList.get(0).getId()));
updateParamsConfigDataEO.setTextData((String) reportConfigDataEOList.get(0).get("text_data"));
updateParamsConfigDataEO.setPullData((String) reportConfigDataEOList.get(0).get("pull_data"));
updateParamsConfigDataEO.setFileConnectId((String) reportConfigDataEOList.get(0).get("file_connect_id"));
updateParamsConfigDataEO.setOrderNum((Integer) reportConfigDataEOList.get(0).get("order_num"));
updateConfigDataEOList.add(updateParamsConfigDataEO);
} else if (CollectionUtil.isNotEmpty(reportConfigDataEOList) && CollectionUtil.isEmpty(configDataEOList)) {
ParamsConfigDataEO addParamsConfigDataEO = new ParamsConfigDataEO();
addParamsConfigDataEO.setId(UUID.randomUUID().toString().replace("-", ""));
addParamsConfigDataEO.setTextData((String) reportConfigDataEOList.get(0).get("text_data"));
addParamsConfigDataEO.setPullData((String) reportConfigDataEOList.get(0).get("pull_data"));
addParamsConfigDataEO.setFileConnectId((String) reportConfigDataEOList.get(0).get("file_connect_id"));
addParamsConfigDataEO.setOrderNum((Integer) reportConfigDataEOList.get(0).get("order_num"));
addParamsConfigDataEO.setParamsConfigId(configId);
addParamsConfigDataEO.setParamsCollectManifestId(updateCollectManifestEO.getId());
updateConfigDataEOList.add(addParamsConfigDataEO);
if (CollectionUtil.isNotEmpty(reportConfigDataEOList)) {
for (Map<String, Object> rcdMap : reportConfigDataEOList) {
ParamsConfigDataEO addParamsConfigDataEO = new ParamsConfigDataEO();
addParamsConfigDataEO.setId(UUID.randomUUID().toString().replace("-", ""));
addParamsConfigDataEO.setTextData((String) rcdMap.get("text_data"));
addParamsConfigDataEO.setPullData((String) rcdMap.get("pull_data"));
addParamsConfigDataEO.setFileConnectId((String) rcdMap.get("file_connect_id"));
addParamsConfigDataEO.setOrderNum((Integer) rcdMap.get("order_num"));
addParamsConfigDataEO.setParamsConfigId(configId);
addParamsConfigDataEO.setParamsCollectManifestId(updateCollectManifestEO.getId());
updateConfigDataEOList.add(addParamsConfigDataEO);
}
}
}
}
if (CollectionUtil.isNotEmpty(updateConfigDataEOList)) {
paramsConfigDataEOService.saveOrUpdateBatch(updateConfigDataEOList);
}
// 删除参数项配置数据
if (CollectionUtil.isNotEmpty(delCollectManifestIdList)) {
paramsConfigDataEOService.deleteByParamsCollectManifestIdList(delCollectManifestIdList);
}
// 更新项目参数项
paramsCollectManifestEOService.updateBatchById(updateCollectManifestEOList);
// 参数清单版本加 1
ParamsManifestEO updateManifestEO = new ParamsManifestEO();
updateManifestEO.setId(id);
@@ -814,6 +822,13 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
// 查询上报库的项目所有参数项的配置数据
ParamsReportEO paramsReportEO = paramsReportEOService.queryByOldParamsManifestId(paramsManifestHistoryEO.getSourceParamsManifestId(), paramsManifestHistoryEO.getVersion());
if(ObjectUtil.isEmpty(paramsReportEO)){
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("无法找到对应版本上报库,无法发起变更!");
} else {
throw new JeroBootException("Cannot find the corresponding version report, and cannot be initiated change!");
}
}
List<Map<String, Object>> paramsReportConfigDataList = paramsReportDetailEOService.listInfoForChange(paramsReportEO.getId());
// 比较模板参数项 项目参数项
@@ -898,26 +913,41 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
// 查询配置信息
List<ParamsConfigEO> configEOList = new ArrayList<>();
List<String> configIdList = new ArrayList<>();
List<ParamsConfigHistoryEO> configList = paramsConfigHistoryEOService.queryList(paramsManifestHistoryEO.getId());
for (ParamsConfigHistoryEO config : configList) {
List<ParamsReportConfigEO> prcList = paramsReportConfigEOService.queryList(paramsReportEO.getId());
for (ParamsReportConfigEO config : prcList) {
ParamsConfigEO newConfig = new ParamsConfigEO();
BeanUtils.copyProperties(config,newConfig);
newConfig.setParamsManifestId(paramsManifestHistoryEO.getSourceParamsManifestId());
configEOList.add(newConfig);
configIdList.add(newConfig.getId());
}
if (CollectionUtil.isNotEmpty(configList)) {
if (CollectionUtil.isNotEmpty(configEOList)) {
paramsConfigEOService.saveOrUpdateBatch(configEOList);
}
List<ParamsConfigDataEO> configDataEOList = new ArrayList<>();
List<ParamsConfigDataHistoryEO> paramsConfigDataEOList = paramsConfigDataHistoryEOService.queryListByConfigIdList(configIdList);
for (ParamsConfigDataHistoryEO configData : paramsConfigDataEOList) {
ParamsConfigDataEO newConfigData = new ParamsConfigDataEO();
BeanUtils.copyProperties(configData,newConfigData);
configDataEOList.add(newConfigData);
// 按照上报库参数项配置数据 更新 参数收集清单配置数据
List<Map<String, Object>> reportConfigDataEOList = new ArrayList<>();
for (ParamsCollectManifestEO updateCollectManifestEO : updateCollectManifestEOList) {
for (String configId : configIdList) {
reportConfigDataEOList = paramsReportConfigDataList.stream().filter(e -> updateCollectManifestEO.getNioNumber().equals(e.get("nio_number"))
&& configId.equals(e.get("params_config_id"))).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(reportConfigDataEOList)) {
for (Map<String, Object> rcdMap : reportConfigDataEOList) {
ParamsConfigDataEO addParamsConfigDataEO = new ParamsConfigDataEO();
addParamsConfigDataEO.setId(UUID.randomUUID().toString().replace("-", ""));
addParamsConfigDataEO.setTextData((String) rcdMap.get("text_data"));
addParamsConfigDataEO.setPullData((String) rcdMap.get("pull_data"));
addParamsConfigDataEO.setFileConnectId((String) rcdMap.get("file_connect_id"));
addParamsConfigDataEO.setOrderNum((Integer) rcdMap.get("order_num"));
addParamsConfigDataEO.setParamsConfigId(configId);
addParamsConfigDataEO.setParamsCollectManifestId(updateCollectManifestEO.getId());
updateConfigDataEOList.add(addParamsConfigDataEO);
}
}
}
}
if (CollectionUtil.isNotEmpty(configDataEOList)) {
paramsConfigDataEOService.saveOrUpdateBatch(configDataEOList);
if (CollectionUtil.isNotEmpty(updateConfigDataEOList)) {
paramsConfigDataEOService.saveOrUpdateBatch(updateConfigDataEOList);
}
// 更新项目参数项
@@ -110,4 +110,8 @@ public class ParamsCollectManifestVO {
//是否导出标题 1 0
@TableField(exist = false)
private String exportOption;
//是否是历史版本 1 0
@TableField(exist = false)
private String isHistory;
}
@@ -6,10 +6,13 @@ import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.cert.collect.service.IParamsConfigDataEOService;
import com.jero.modules.cert.collect.service.IParamsConfigDataHistoryEOService;
import com.jero.modules.cert.report.entity.ParamsReportConfigEO;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.cert.report.entity.ParamsReportEO;
import com.jero.modules.cert.report.entity.ParamsReportExportHistoryEO;
import com.jero.modules.cert.report.service.IParamsReportConfigDataEOService;
import com.jero.modules.cert.report.service.IParamsReportConfigEOService;
import com.jero.modules.cert.report.service.IParamsReportEOService;
import com.jero.modules.cert.report.service.IParamsReportExportHistoryEOService;
@@ -70,6 +73,18 @@ public class ParamsReportEOController extends JeroController<ParamsReportEO, IPa
@Autowired
private ISysDictService sysDictService;
@Autowired
private IParamsReportConfigDataEOService paramsReportConfigDataEOService;
@Autowired
private IParamsConfigDataEOService paramsConfigDataEOService;
@Autowired
private IParamsConfigDataHistoryEOService paramsConfigDataHistoryEOService;
/**
* 分页列表查询
*
@@ -108,14 +123,20 @@ public class ParamsReportEOController extends JeroController<ParamsReportEO, IPa
String market = getMarket(paramsReportEO, targetMarketList, row);
if(StringUtils.isNotBlank(row.getProjectName())){
if(StringUtils.isBlank(market)){
row.setProjectName(row.getProjectName()+ "-00");
row.setProjectName(row.getProjectName());
}else{
row.setProjectName(row.getProjectName()+"-" +market+ "-00");
row.setProjectName(row.getProjectName()+"-" +market);
}
row.setPageName(row.getProjectName());
}else{
row.setPageName("");
}
String projectVersion = row.getProjectVersion();
if(StringUtils.isNotBlank(row.getProjectVersion())){
row.setProjectName(row.getProjectName() + "-" + row.getProjectVersion());
}else{
row.setProjectName(row.getProjectName()+"-00");
}
}
String orderBy = paramsReportEO.getOrderBy();
String orderByField = paramsReportEO.getOrderByField();
@@ -402,4 +423,15 @@ public class ParamsReportEOController extends JeroController<ParamsReportEO, IPa
}
return Result.OK(paramsReportConfigEO);
}
@AutoLog(value = "上报库配置-handleData")
@ApiOperation(value="上报库配置-handleData", notes="上报库配置-handleData")
@GetMapping(value = "/handleData")
public Result<?> handleData() {
paramsReportConfigDataEOService.handleData();
paramsConfigDataEOService.handleData();
paramsConfigDataHistoryEOService.handleData();
return Result.OK();
}
}
@@ -81,6 +81,9 @@ public class ParamsReportEO implements Serializable {
@ApiModelProperty(value = "目标市场")
private String targetMarket;
@ApiModelProperty(value = "相关项目版本")
private String projectVersion;
@TableField(exist = false)
private String cut;
@@ -22,6 +22,7 @@
pr.id as id,
pr.old_params_manifest_id as old_params_manifest_id,
pr.version as version,
pr.project_version,
pr.params_template_publish_version as params_template_publish_version,
pr.create_by as create_by,
pr.create_time as create_time,
@@ -42,4 +42,6 @@ public interface IParamsReportConfigDataEOService extends IService<ParamsReportC
List<ParamsReportConfigDataEO> queryListByCollectManifestIdList(List<String> paramsCollectManifestIdList);
void handleData();
}
@@ -8,7 +8,7 @@ import com.jero.modules.cert.report.mapper.ParamsReportConfigDataEOMapper;
import com.jero.modules.cert.report.service.IParamsReportConfigDataEOService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.*;
/**
* @Description: 上报库参数配置数据
@@ -66,6 +66,7 @@ public class ParamsReportConfigDataEOServiceImpl extends ServiceImpl<ParamsRepor
if (CollectionUtil.isNotEmpty(configIdList)) {
LambdaQueryWrapper<ParamsReportConfigDataEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsReportConfigDataEO::getParamsConfigId, configIdList);
queryWrapper.orderByAsc(ParamsReportConfigDataEO::getOrderNum);
return list(queryWrapper);
}
return null;
@@ -93,4 +94,41 @@ public class ParamsReportConfigDataEOServiceImpl extends ServiceImpl<ParamsRepor
queryWrapper.orderByDesc(ParamsReportConfigDataEO::getOrderNum);
return this.list(queryWrapper);
}
public void handleData() {
List<ParamsReportConfigDataEO> list = this.list();
Map<String, List<ParamsReportConfigDataEO>> map = new HashMap<>();
for (ParamsReportConfigDataEO prcd : list) {
String pid = prcd.getParamsCollectManifestId()+"+"+prcd.getParamsConfigId();
List<ParamsReportConfigDataEO> dataList = null;
if(map.containsKey(pid)){
dataList = map.get(pid);
}else{
dataList = new ArrayList<>();
}
dataList.add(prcd);
map.put(pid,dataList);
}
List<ParamsReportConfigDataEO> updateList = new ArrayList<>();
for (List<ParamsReportConfigDataEO> dataList:map.values()) {
Collections.sort(dataList, new Comparator<ParamsReportConfigDataEO>() {
@Override
public int compare(ParamsReportConfigDataEO o1, ParamsReportConfigDataEO o2) {
return Integer.compare(o1.getOrderNum(), o2.getOrderNum());
}
});
int num = 0;
for (ParamsReportConfigDataEO prcd:dataList) {
prcd.setOrderNum(num);
updateList.add(prcd);
num++;
}
}
if(CollectionUtil.isNotEmpty(updateList)){
this.updateBatchById(updateList);
}
}
}
@@ -523,4 +523,12 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
int count = bussDocumentLibraryEOService.updateES();
return Result.OK(count);
}
@ApiOperation(value="根据ID查询文档库数据", notes="根据ID查询文档库数据")
@GetMapping(value = "/queryListByIds")
public Result<?> queryListByIds(String ids,String cut) {
List<Map<String,Object>> res = bussDocumentLibraryEOService.queryListByIds(ids);
return Result.OK(res);
}
}
@@ -5,7 +5,6 @@ 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 com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -336,6 +335,10 @@ public class DummyInventoryInfoEO implements Serializable {
@TableField(exist = false)
private String orderByField;
/**一级责任领域**/
@TableField(exist = false)
private String firstLevelDutyTerritory;
@@ -46,8 +46,19 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
@@ -65,11 +76,25 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.Collator;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl.copyFile;
@@ -168,6 +193,10 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
}
});
}
//责任部门查询
if(StringUtils.isNotBlank(dummyInventoryInfoEO.getFirstLevelDutyTerritory())){
queryWrapper.lambda().eq(DummyInventoryInfoEO::getDutyDepart,dummyInventoryInfoEO.getFirstLevelDutyTerritory());
}
Page<DummyInventoryInfoEO> page = new Page<DummyInventoryInfoEO>(dummyInventoryInfoEO.getPageNo(), dummyInventoryInfoEO.getPageSize());
IPage<DummyInventoryInfoEO> pageInfo = this.page(page, queryWrapper);
@@ -53,7 +53,7 @@ public class LawsOpinionGatherRemindJob implements Job {
String endTime = sdf.format(lawsOpinionGatherEO.getEndTime());
int days = 0;
try {
days = (int) (sdf.parse(endTime).getTime() - sdf.parse(now).getTime()) / (24 * 60 * 60 * 1000);
days = (int) ((sdf.parse(endTime).getTime() - sdf.parse(now).getTime()) / (24 * 60 * 60 * 1000));
} catch (Exception e) {
e.printStackTrace();
throw new JeroBootException("日期转换错误");
@@ -62,6 +62,9 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
@ApiModelProperty(value = "VDR_ID")
private java.lang.String vdrId;
@ApiModelProperty(value = "VDR")
private java.lang.String vdr;
@@ -199,6 +202,10 @@ public class OtaManageApplyEO implements Serializable {
@TableField(exist = false)
private boolean disabled;
@ApiModelProperty(value = "是否丢弃置灰")
@TableField(exist = false)
private boolean discard;
@TableField(exist = false)
@ApiModelProperty(value = "表头排序字段")
private java.lang.String orderByField;
@@ -229,5 +236,16 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "中英文切换")
private String cut;
@TableField(exist = false)
@ApiModelProperty(value = "扩展任务数量")
private Integer extensionItemCount;
@TableField(exist = false)
@ApiModelProperty(value = "是否被删除(0:否;1:是)")
private String isDel;
@TableField(exist = false)
private String attestationScheduleText;
}
@@ -32,9 +32,14 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
public class OtaManageReceive implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String vdrId;
/**VDR*/
@ApiModelProperty(value = "VDR")
private String id;
/**创建人*/
@@ -126,6 +131,9 @@ public class OtaManageReceive implements Serializable {
@ApiModelProperty(value = "发布类型")
private String releaseType;
/**是否被删除(0:否;1:是)*/
@Excel(name = "是否被删除(0:否;1:是)", width = 15)
@ApiModelProperty(value = "是否被删除(0:否;1:是)")
private String isDel;
}
@@ -1,22 +1,19 @@
package com.jero.modules.ota.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.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
@@ -113,4 +110,7 @@ public class OtaManageReceiveNsdp implements Serializable {
@ApiModelProperty(value = "排序")
private java.lang.String orderBy;
@ApiModelProperty(value = "扩展任务数量")
private java.lang.Integer extensionItemCount;
}
@@ -2,10 +2,12 @@ package com.jero.modules.ota.job;
import com.jero.modules.ota.entity.OtaManageReceive;
import com.jero.modules.ota.entity.OtaManageReceiveNsdp;
import com.jero.modules.ota.enums.OtaHomoImpactEnum;
import com.jero.modules.ota.service.IOtaManageReceiveNsdpService;
import com.jero.modules.ota.service.IOtaManageReceiveService;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
@@ -43,26 +45,48 @@ public class OtaDataUpdate implements Job {
List<OtaManageReceive> omrSyncList = otaManageReceiveService.getReceiveSync();
for (OtaManageReceive omrSync : omrSyncList) {
String plannedBpLaunchBatch = omrSync.getPlannedBpLaunchBatch();
if (StringUtils.isNotEmpty(plannedBpLaunchBatch)) {
Matcher matcher = pattern.matcher(plannedBpLaunchBatch);
if (matcher.find()) {
omrSync.setPlannedBpLaunchBatch(matcher.group());
}
}
}
List<OtaManageReceive> omrList = otaManageReceiveService.queryList();
List<OtaManageReceive> addList = new ArrayList<>();
List<String> delList = new ArrayList<>();
List<OtaManageReceive> updateList = new ArrayList<>();
for (OtaManageReceive omr : omrList) {
boolean delFlag = true;
for (OtaManageReceive omrSync : omrSyncList) {
if(StringUtils.isBlank(omrSync.getPlannedBpLaunchBatch())){
continue;
}
if (omr.getId().equals(omrSync.getId())) {
delFlag = false;
if (!compareReceive(omr, omrSync)) {
if (1 == compareReceive(omr, omrSync)) {
updateList.add(omrSync);
} else if (2 == compareReceive(omr, omrSync)) {
boolean have = false;
for (OtaManageReceive omr1 : omrList) {
if(omrSync.getPlannedBpLaunchBatch().equals(omr1.getPlannedBpLaunchBatch())){
have = true;
break;
}
}
if(!have){
//逻辑删除 但保留在原软件版本列表中
omr.setIsDel("1");
updateList.add(omr);
//同步数据中新增
omrSync.setVdrId(UUID.randomUUID().toString().replace("-",""));
addList.add(omrSync);
}
}
}
}
if (delFlag) {
//同步数据中被删除
delList.add(omr.getId());
}
}
for (OtaManageReceive omrSync : omrSyncList) {
@@ -74,27 +98,28 @@ public class OtaDataUpdate implements Job {
}
if (addFlag) {
//同步数据中新增
String plannedBpLaunchBatch = omrSync.getPlannedBpLaunchBatch();
if (StringUtils.isNotEmpty(plannedBpLaunchBatch)) {
Matcher matcher = pattern.matcher(plannedBpLaunchBatch);
if (matcher.find()) {
omrSync.setPlannedBpLaunchBatch(matcher.group());
}
}
omrSync.setVdrId(UUID.randomUUID().toString().replace("-",""));
addList.add(omrSync);
}
}
if (CollectionUtils.isNotEmpty(addList)) {
otaManageReceiveService.saveBatch(addList);
}
if (CollectionUtils.isNotEmpty(addList)) {
otaManageReceiveService.deleteByIds(delList);
}
if (CollectionUtils.isNotEmpty(updateList)) {
otaManageReceiveService.updateBatchById(updateList);
}
List<OtaManageReceiveNsdp> omrnSyncList = otaManageReceiveNsdpService.getOtaManageReceiveNsdpSync();
for (OtaManageReceiveNsdp omrnSync : omrnSyncList) {
String plannedBpLaunchBatch = omrnSync.getReleaseName();
if (StringUtils.isNotEmpty(plannedBpLaunchBatch)) {
Matcher matcher = pattern.matcher(plannedBpLaunchBatch);
if (matcher.find()) {
omrnSync.setReleaseName(matcher.group());
}
}
}
List<OtaManageReceiveNsdp> omrnList = otaManageReceiveNsdpService.queryList();
List<OtaManageReceiveNsdp> addNsdpList = new ArrayList<>();
@@ -126,13 +151,7 @@ public class OtaDataUpdate implements Job {
}
if (addFlag) {
//同步数据中新增
String releaseName = omrnSync.getReleaseName();
if (StringUtils.isNotEmpty(releaseName)) {
Matcher matcher = pattern.matcher(releaseName);
if (matcher.find()) {
omrnSync.setReleaseName(matcher.group());
}
}
addNsdpList.add(omrnSync);
}
@@ -152,26 +171,24 @@ public class OtaDataUpdate implements Job {
Map<String, Date> releaceDateMap = new HashMap<>();
//记录车型列表
Map<String ,Set<String>> omrnVehicleMap = new HashMap<>();
Map<String ,String> releaceTypeMap = new HashMap<>();
Date today = new Date();
List<OtaManageReceiveNsdp> omrnLastList = otaManageReceiveNsdpService.queryList();
for (OtaManageReceiveNsdp omrn : omrnLastList) {
//找到最快来临的发布时间
Date releaceDate = releaceDateMap.get(omrn.getReleaseName());
try {
Date syncDate = sdf.parse(omrn.getReleaseDate());
if (null == releaceDate) {
releaceDateMap.put(omrn.getReleaseName(), syncDate);
} else {
if (syncDate.after(today) && syncDate.before(releaceDate)) {
if (StringUtils.isNotBlank(omrn.getDateName()) && omrn.getDateName().equals("PLM")) {
try {
Date syncDate = sdf.parse(omrn.getReleaseDate());
if (null == releaceDate) {
releaceDateMap.put(omrn.getReleaseName(), syncDate);
} else {
if (syncDate.before(releaceDate)) {
releaceDateMap.put(omrn.getReleaseName(), syncDate);
}
}
} catch (ParseException e) {
e.printStackTrace();
}
} catch (ParseException e) {
e.printStackTrace();
}
//处理车型字符串
Set<String> vehicleSet = omrnVehicleMap.get(omrn.getReleaseName());
@@ -247,6 +264,26 @@ public class OtaDataUpdate implements Job {
if (CollectionUtils.isNotEmpty(dateUpdateList)) {
otaManageReceiveService.updateBatchById(dateUpdateList);
}
//扩展任务数量的值为Homo Extension - Paperwork和Homo Extension - Retest的数量和
List<OtaManageReceive> otaManageReceiveList = otaManageReceiveService.queryList();
List<OtaManageReceiveNsdp> otaManageReceiveNsdpList = otaManageReceiveNsdpService.queryList();
for (OtaManageReceiveNsdp otaManageReceiveNsdp : otaManageReceiveNsdpList) {
List<OtaManageReceive> collect = otaManageReceiveList.stream()
.filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch())
&& e.getPlannedBpLaunchBatch().equals(otaManageReceiveNsdp.getReleaseName())).collect(Collectors.toList());
List<OtaManageReceive> collect1 = collect.stream()
.filter(e -> OtaHomoImpactEnum.HOMOEX_PAPERWORK.getValue().equals(e.getHomologationImpact())
|| OtaHomoImpactEnum.HOMOEX_RETEST.getValue().equals(e.getHomologationImpact())).collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect1)){
otaManageReceiveNsdp.setExtensionItemCount(collect1.size());
}else{
otaManageReceiveNsdp.setExtensionItemCount(0);
}
}
otaManageReceiveNsdpService.updateBatchById(otaManageReceiveNsdpList);
System.out.println("===============================OtaDataUpdate定时任务结束===============================");
}
@@ -266,35 +303,49 @@ public class OtaDataUpdate implements Job {
if (!StringUtils.equals(omrn.getVehicle(), omrnSync.getVehicle())) {
return false;
}
if (!StringUtils.equals(omrn.getReleaseName(), omrnSync.getReleaseName())) {
return false;
}
return true;
}
private boolean compareReceive(OtaManageReceive omr, OtaManageReceive omrSync) {
/**
* 对比VDR数据
* 返回状态
* 0无变化
* 1有变化
* 2改变版本号
*/
private int compareReceive(OtaManageReceive omr, OtaManageReceive omrSync) {
int res = 0;
if (!StringUtils.equals(omr.getSummary(), omrSync.getSummary())) {
return false;
res = 1;
}
if (!StringUtils.equals(omr.getStatus(), omrSync.getStatus())) {
return false;
res = 1;
}
if (!StringUtils.equals(omr.getHomologationImpact(), omrSync.getHomologationImpact())) {
return false;
res = 1;
}
if (!StringUtils.equals(omr.getHomologation(), omrSync.getHomologation())) {
return false;
res = 1;
}
if (!StringUtils.equals(omr.getImpactCnHomo(), omrSync.getImpactCnHomo())) {
return false;
res = 1;
}
if (!StringUtils.equals(omr.getImpactEuHomo(), omrSync.getImpactEuHomo())) {
return false;
res = 1;
}
if (!StringUtils.equals(omr.getMasterDomain(), omrSync.getMasterDomain())) {
return false;
res = 1;
}
if (!StringUtils.equals(omr.getAppliedVehicleProject(), omrSync.getAppliedVehicleProject())) {
return false;
res = 1;
}
return true;
if (!StringUtils.equals(omr.getPlannedBpLaunchBatch(), omrSync.getPlannedBpLaunchBatch())) {
res = 2;
}
return res;
}
@@ -68,14 +68,14 @@
</select>
<select id="getOtaCarPage" resultType="com.jero.modules.ota.entity.OtaManageApplyEO">
select omr.id as vdr,omr.planned_bp_launch_batch,omr.update_date,
select omr.vdr_id,omr.id as vdr,omr.planned_bp_launch_batch,omr.update_date,
omr.summary,omr.status,
omr.homologation_impact,omr.homologation,
omr.impact_cn_homo,omr.impact_eu_homo,
omr.master_domain,omr.applied_vehicle_project,omr.vehicle_match,
omr.master_domain,omr.applied_vehicle_project,omr.vehicle_match,omr.is_del,
oma.id,oma.project_version,oma.attestation_schedule,oma.match_status,oma.remark,oma.vehicle_type
from ota_manage_receive omr
left join ota_manage_apply oma on oma.vdr = omr.id
left join ota_manage_apply oma on oma.vdr_id = omr.vdr_id
<where>
1=1
<if test="otaManageApplyEO.plannedBpLaunchBatch != null and otaManageApplyEO.plannedBpLaunchBatch != ''">
@@ -158,7 +158,7 @@
LEFT JOIN ota_manage_apply oma ON oma.project_version = plb.id
LEFT JOIN project_name_info pni ON pni.id = plb.project_name_id
LEFT JOIN project_year_name_info pyni ON pyni.project_name_id = pni.id
WHERE oma.vdr = #{vdr}
WHERE oma.vdr_id = #{vdr}
GROUP BY plb.id
</select>
@@ -11,12 +11,20 @@ import com.jero.common.util.oConvertUtils;
import com.jero.modules.dummy.enums.OrderEnum;
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
import com.jero.modules.feishu.service.IFeishuService;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.entity.OtaManageApplyEO;
import com.jero.modules.ota.entity.OtaManageHistory;
import com.jero.modules.ota.entity.OtaManagePermission;
import com.jero.modules.ota.entity.OtaManageReceive;
import com.jero.modules.ota.entity.OtaManageReceiveNsdp;
import com.jero.modules.ota.enums.OtaCarEnum;
import com.jero.modules.ota.enums.OtaHomoImpactEnum;
import com.jero.modules.ota.enums.OtaStatusEnum;
import com.jero.modules.ota.mapper.OtaManageApplyEOMapper;
import com.jero.modules.ota.service.*;
import com.jero.modules.ota.service.IOtaManageApplyEOService;
import com.jero.modules.ota.service.IOtaManageHistoryService;
import com.jero.modules.ota.service.IOtaManagePermissionService;
import com.jero.modules.ota.service.IOtaManageReceiveNsdpService;
import com.jero.modules.ota.service.IOtaManageReceiveService;
import com.jero.modules.ota.vo.AllCarExportCnVO;
import com.jero.modules.ota.vo.AllCarExportEnVO;
import com.jero.modules.ota.vo.OneCarExportCnVO;
@@ -57,7 +65,6 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.text.Collator;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -119,8 +126,6 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Value(value = "${jero.backUrlPhone}")
private String backUrlPhone;
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
/**
* 保存
@@ -197,7 +202,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
public List<OtaManageApplyEO> getNsdpList(OtaManageApplyEO otaManageApplyEO) {
Date today = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
List<OtaManageApplyEO> resList = new ArrayList<>();
List<OtaManageReceiveNsdp> dataList = otaManageReceiveNsdpService.queryList();
Map<String, List<OtaManageReceiveNsdp>> dataMap = dataList.stream().collect(Collectors.groupingBy(OtaManageReceiveNsdp::getReleaseName));
@@ -213,20 +218,28 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
Set<String> marketSet = new HashSet<>();
//车型
Set<String> vehicleSet = new HashSet<>();
int extensionItemCount = 0;
for (OtaManageReceiveNsdp omrn : valList) {
if(ObjectUtils.isEmpty(omrn.getExtensionItemCount())){
extensionItemCount = 0;
}else{
extensionItemCount = omrn.getExtensionItemCount();
}
//找到最快来临的发布时间
try {
if(StringUtils.isNotBlank(omrn.getReleaseDate())){
Date syncDate = sdf.parse(omrn.getReleaseDate());
if (null == releaseDate) {
releaseDate = syncDate;
} else {
if (syncDate.after(today) && syncDate.before(releaseDate)) {
if(StringUtils.isNotBlank(omrn.getDateName())&&omrn.getDateName().equals("PLM")){
if(StringUtils.isNotBlank(omrn.getReleaseDate())){
Date syncDate = sdf.parse(omrn.getReleaseDate());
if (null == releaseDate) {
releaseDate = syncDate;
} else {
if (syncDate.before(releaseDate)) {
releaseDate = syncDate;
}
}
}
}
} catch (ParseException e) {
} catch (Exception e) {
e.printStackTrace();
}
String appliedVehicleProject = omrn.getVehicle();
@@ -269,6 +282,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
oma.setCreatedAt(omrn.getCreatedAt());
oma.setReleaseType(omrn.getReleaseType());
oma.setExtensionItemCount(extensionItemCount);
resList.add(oma);
}
}
@@ -286,11 +300,13 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
public List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO) {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
boolean otaManager = isOtaManager();
boolean regulationOwner = isRegulationOwner();
List<OtaManageApplyEO> otaManageApplyEOList = this.getNsdpList(otaManageApplyEO);
List<OtaManageApplyEO> dataList = new ArrayList<>();
//去跟manager和studio权限
if (otaManager) {
if (otaManager || regulationOwner) {
dataList = otaManageApplyEOList;
} else {
List<OtaManagePermission> managePermissionList = otaManagePermissionService.queryByUserId(currentUser.getId());
@@ -300,76 +316,6 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
dataList = collect;
}
}
// List<OtaManageApplyEO> result = new ArrayList<>();
// if (!dataList.isEmpty()) {
// List<String> otaNameList = OtaCarEnum.getOtaNameList();
// List<String> plannedBpLaunchBatchList = dataList.stream()
// .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
// .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
// if (!plannedBpLaunchBatchList.isEmpty()) {
// for (String plannedBpLaunchBatch : plannedBpLaunchBatchList) {
// OtaManageApplyEO manageApplyEO = new OtaManageApplyEO();
// manageApplyEO.setPlannedBpLaunchBatch(plannedBpLaunchBatch);
// manageApplyEO.setId(plannedBpLaunchBatch);
//
// List<OtaManageApplyEO> otaManageApplyEOS = dataList.stream()
// .filter(e -> plannedBpLaunchBatch.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
// if (!otaManageApplyEOS.isEmpty()) {
// //发布时间
// manageApplyEO.setReleaseDate(otaManageApplyEOS.get(0).getReleaseDate());
//
// List<String> appliedVehicleProjectList = otaManageApplyEOS.stream()
// .filter(e -> StringUtils.isNotBlank(e.getAppliedVehicleProject()))
// .map(OtaManageApplyEO::getAppliedVehicleProject).collect(Collectors.toList());
// List<String> carList = new ArrayList<>();
// for (String appliedVehicleProject : appliedVehicleProjectList) {
// carList.addAll(Arrays.asList(appliedVehicleProject.split(",")));
// }
// if (!carList.isEmpty()) {
// //适用车型
// carList = carList.stream().distinct().collect(Collectors.toList());
// manageApplyEO.setAppliedVehicleProject(StringUtils.join(carList, ","));
// //市场
// Set<String> marketSet = new HashSet<>();
// for (String appliedVehicleProject : carList) {
// if(otaNameList.contains(appliedVehicleProject)){
// marketSet.add(appliedVehicleProject);
// }else{
// for (String s : appliedVehicleProject.split(",")) {
// String[] split = s.split(" ");
// if (split.length == 2) {
// if (!otaNameList.contains(s)) {
// marketSet.add(split[1]);
// }
// } else if (split.length == 3) {
// if (!otaNameList.contains(s)) {
// marketSet.add(split[2]);
// }
// }
// }
// }
// }
// if (!marketSet.isEmpty()) {
// manageApplyEO.setMarket(StringUtils.join(marketSet, ","));
// }
// }
// }
// result.add(manageApplyEO);
// }
// }
// }
// if (ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeStart())) {
// result = result.stream()
// .filter(e -> StringUtils.isNotBlank(e.getReleaseDate())
// && (e.getReleaseNameDate().after(otaManageApplyEO.getSoftwareIssueTimeStart())
// || e.getReleaseNameDate().equals(otaManageApplyEO.getSoftwareIssueTimeStart()))).collect(Collectors.toList());
// }
// if (ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeEnd())) {
// result = result.stream().filter(e -> StringUtils.isNotBlank(e.getReleaseDate())
// && (e.getReleaseNameDate().before(otaManageApplyEO.getSoftwareIssueTimeEnd())
// || e.getReleaseNameDate().equals(otaManageApplyEO.getSoftwareIssueTimeEnd()))).collect(Collectors.toList());
// }
if (!dataList.isEmpty()) {
//表头排序
heartSort(otaManageApplyEO, dataList);
@@ -390,7 +336,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
//studio数据权限
if (isOtaManager()) {
if (isOtaManager() || isRegulationOwner()) {
otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
} else {
otaManageApplyEOList = getStudioData(otaManageApplyEO, otaManageApplyEOList);
@@ -781,15 +727,15 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
if(StringUtils.isEmpty(otaManageApplyEO.getOrderByField())){
Collections.sort(otaManageApplyEOList, (e1, e2) -> {
Date e1CreatedAt = ObjectUtils.isNotEmpty(e1.getCreatedAt()) ? e1.getCreatedAt() : new Date(0);
Date e2CreatedAt = ObjectUtils.isNotEmpty(e2.getCreatedAt()) ? e2.getCreatedAt() : new Date(0);
return e2CreatedAt.compareTo(e1CreatedAt);
String e1ReleaseName = StringUtils.isNotBlank(e1.getReleaseDate()) ? e1.getReleaseDate() : "";
String e2ReleaseName = StringUtils.isNotBlank(e2.getReleaseDate()) ? e2.getReleaseDate() : "";
return comparator.compare(e2ReleaseName, e1ReleaseName);
});
}
}
private boolean hasPermission(String plannedBpLaunchBatch){
if(isOtaManager()){
if(isOtaManager()||isRegulationOwner()){
return true;
}
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
@@ -814,6 +760,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
if(!hasPermission(otaManageApplyEO.getPlannedBpLaunchBatch())){
return new ArrayList<>();
}
boolean isStudio = isStudio();
boolean isRegulationOwner = isRegulationOwner();
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO);
List<OtaManageApplyEO> list = new ArrayList<>();
Map<String, OtaManageApplyEO> omaMap = new HashMap<>();
@@ -864,6 +813,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
}
List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode(DicCodeEnum.CERTIFICATION_PROGRESS.getCode());
list = new ArrayList<>(omaMap.values());
if (!list.isEmpty()) {
List<VersionVO> vprojectVersionList = getProjectVersionList(otaManageApplyEO.getAppliedVehicleProject(), null);
@@ -940,7 +890,15 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
//项目版本
List<VersionVO> collect = vprojectVersionList.stream().filter(e -> e.getProjectId().equals(manageApplyEO.getProjectVersion())).distinct().collect(Collectors.toList());
if (!collect.isEmpty()) {
manageApplyEO.setProjectVersionText(collect.get(0).getCar() + "-" + collect.get(0).getYearName() + "-" + collect.get(0).getMarket());
if("NA".equals(collect.get(0).getProjectId())){
if (CutEnum.CN.getValue().equals(cut)) {
manageApplyEO.setProjectVersionText("不涉及");
} else {
manageApplyEO.setProjectVersionText("NA");
}
}else{
manageApplyEO.setProjectVersionText(collect.get(0).getCar() + "-" + collect.get(0).getYearName() + "-" + collect.get(0).getMarket());
}
}
}else{
//没有设置项目版本的情况
@@ -956,6 +914,23 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
manageApplyEO.setMatchStatus(OtaStatusEnum.NA.getKey());
manageApplyEO.setDisabled(true);
}
if(isRegulationOwner && !isStudio){
manageApplyEO.setDisabled(true);
}
if ((StringUtils.isNotBlank(manageApplyEO.getIsDel()) && manageApplyEO.getIsDel().equals("1"))
|| (StringUtils.isNotBlank(manageApplyEO.getStatus()) && manageApplyEO.getStatus().equals("Discard"))) {
manageApplyEO.setDiscard(true);
manageApplyEO.setDisabled(true);
}
if (StringUtils.isNotBlank(manageApplyEO.getAttestationSchedule())) {
List<SysDictItem> collect = regionDictList.stream()
.filter(e -> e.getItemValue().equals(manageApplyEO.getAttestationSchedule())).collect(Collectors.toList());
if (CutEnum.CN.getValue().equals(cut)) {
manageApplyEO.setAttestationScheduleText(collect.get(0).getItemText());
} else {
manageApplyEO.setAttestationScheduleText(collect.get(0).getEnName());
}
}
if (StringUtils.isBlank(manageApplyEO.getMatchStatus())) {
manageApplyEO.setMatchStatus(OtaStatusEnum.TO_BE_MATCHED.getKey());
if (CutEnum.CN.getValue().equals(cut)) {
@@ -1330,7 +1305,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
//认证进度数据字典 certification_progress
List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode("certification_progress");
List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode(DicCodeEnum.CERTIFICATION_PROGRESS.getCode());
List<DictModel> regionList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
@@ -1574,6 +1549,22 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
return false;
}
/**
* 是否为法规工程师
*/
private boolean isRegulationOwner() {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId())); // 查询用户所有角色
if (CollectionUtils.isNotEmpty(userRoleList)) {
for (SysUserRole role : userRoleList) {
if (role.getRoleId().equals(RoleEnum.REGULATION_OWNER.getId())) {
return true;
}
}
}
return false;
}
private boolean isStudio() {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId())); // 查询用户所有角色
@@ -1636,6 +1627,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
public void temporarySave(List<OtaManageApplyEO> list, boolean isSubmit, String cut) {
if (!isOtaManager() || !isStudio()) {
return;
}
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (CollectionUtils.isNotEmpty(list)) {
List<String> idList = list.stream()
@@ -7,8 +7,9 @@ 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.vo.DictModel;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.platform.service.IPlatformProjectLibraryBaseService;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.entity.ProjectLibraryBase;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -307,4 +308,17 @@ public class PlatformProjectLibraryBaseController extends JeroController<Project
public Result<?> overallReplacementUser(@RequestBody JSONObject json){
return this.platformIProjectLibraryBaseService.overallReplacementUser(json);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "平台被哪些法规引用")
@ApiOperation(value="平台被哪些法规引用", notes="平台被哪些法规引用")
@GetMapping(value = "/queryQuoteList")
public Result<List<ProjectLawsInventoryEO>> queryQuoteList(String platformLawsInventoryId,String cut) {
List<ProjectLawsInventoryEO> list = platformIProjectLibraryBaseService.queryQuoteList(platformLawsInventoryId,cut);
return Result.OK(list);
}
}
@@ -80,6 +80,7 @@
plb.cooling_method,
plb.filing_completion_time,
plb.remark,
plb.platform_type,
sdi.item_text brandText,
sdi.en_name brandTextEn
from project_library_base as plb
@@ -264,7 +264,21 @@ public interface IPlatformProjectLawsInventoryEOService extends IService<Project
* @param projectLawsInventoryEOList
* @return
*/
List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
// List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
/**
* 设计任务确认
* @param projectLawsInventoryEOList
* @return
*/
List<Map<String, Object>> getDesignTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
/**
* 验证任务确认
* @param projectLawsInventoryEOList
* @return
*/
List<Map<String, Object>> getVerifyTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
/**
* 获取设计符合性统计信息
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.entity.ProjectLibraryBase;
import javax.servlet.http.HttpServletRequest;
@@ -188,4 +189,11 @@ public interface IPlatformProjectLibraryBaseService extends IService<ProjectLibr
List<ProjectLibraryBase> queryList(List<String> projectIdList);
List<ProjectLibraryBase> getListByIds(List<String> projectIdList);
/**
* 平台被哪些法规引用
*
* @return
*/
List<ProjectLawsInventoryEO> queryQuoteList(String platformLawsInventoryId, String cut);
}
@@ -57,7 +57,6 @@ import com.jero.modules.project.enums.ProjectMessageEnum;
import com.jero.modules.project.enums.ProjectUserLocationEnum;
import com.jero.modules.project.enums.ReviewResultEnum;
import com.jero.modules.project.enums.RoleRelModelTypeEnum;
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
import com.jero.modules.project.enums.TaskStatusEnum;
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
import com.jero.modules.project.service.IProjectCertificationInventoryLogEOService;
@@ -80,7 +79,6 @@ import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
@@ -1710,7 +1708,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getName());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getCode());
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getEnName());
}
sysRoles.add(sysRole);
}
@@ -1726,7 +1724,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
sysRole.setRoleName(ProjectRoleEnum.INTERFACE_PERSON.getName());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
sysRole.setRoleName(ProjectRoleEnum.INTERFACE_PERSON.getCode());
sysRole.setRoleName(ProjectRoleEnum.INTERFACE_PERSON.getEnName());
}
sysRoles.add(sysRole);
}
@@ -1742,7 +1740,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
sysRole.setRoleName(ProjectRoleEnum.PERSON_LIABLE.getName());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
sysRole.setRoleName(ProjectRoleEnum.PERSON_LIABLE.getCode());
sysRole.setRoleName(ProjectRoleEnum.PERSON_LIABLE.getEnName());
}
sysRoles.add(sysRole);
}
@@ -1774,22 +1772,22 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
if (manager.size() != 0) {
manager.get(0).setRoleCode(ProjectRoleEnum.MANAGER.getValue());
manager.get(0).setRoleName(ProjectRoleEnum.MANAGER.getCode());
manager.get(0).setRoleName(ProjectRoleEnum.MANAGER.getEnName());
sysRoles.addAll(manager);
}
if (admin.size() != 0) {
admin.get(0).setRoleCode(ProjectRoleEnum.ADMIN.getValue());
admin.get(0).setRoleName(ProjectRoleEnum.ADMIN.getCode());
admin.get(0).setRoleName(ProjectRoleEnum.ADMIN.getEnName());
sysRoles.addAll(admin);
}
if (Viewer.size() != 0) {
Viewer.get(0).setRoleCode(ProjectRoleEnum.VIEWER.getValue());
Viewer.get(0).setRoleName(ProjectRoleEnum.VIEWER.getCode());
Viewer.get(0).setRoleName(ProjectRoleEnum.VIEWER.getEnName());
sysRoles.addAll(Viewer);
}
if (brandAdministrator.size() != 0) {
brandAdministrator.get(0).setRoleCode(ProjectRoleEnum.BRAND_ADMINISTRATOR.getValue());
brandAdministrator.get(0).setRoleName(ProjectRoleEnum.BRAND_ADMINISTRATOR.getCode());
brandAdministrator.get(0).setRoleName(ProjectRoleEnum.BRAND_ADMINISTRATOR.getEnName());
sysRoles.addAll(brandAdministrator);
}
}
@@ -3376,28 +3374,36 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
public List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectCertificationInventoryEO> pciEoList) {
List<Map<String,Object>> result = new ArrayList<>();
int notStartedCount = 0;
int toConfirmCount = 0;
int acceptedCount = 0;
int rejectedCount = 0;
// int listToBeReleasedCount = 0;//清单待发布
int taskToBeInitiatedCount = 0;//任务待发起
int taskToBeConfirmedCount = 0;//任务待确认
int acceptedCount = 0;//责任人接受
int rejectedCount = 0;//责任人拒绝
if(CollectionUtils.isNotEmpty(pciEoList)){
// 未发起
notStartedCount = (int) pciEoList.stream().filter(pciEo -> {
// 清单待发布
// listToBeReleasedCount = (int) pciEoList.stream().filter(pciEo -> {
// boolean flag = (
// StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
// );
// return flag;
// }).count();
// 任务待发起
taskToBeInitiatedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
);
return flag;
}).count();
// 待确认
toConfirmCount = (int) pciEoList.stream().filter(pciEo -> {
// 任务待确认
taskToBeConfirmedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
);
return flag;
}).count();
// 接受
// 责任人接受
acceptedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
@@ -3407,7 +3413,7 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
);
return flag;
}).count();
// 拒绝
// 责任人拒绝
rejectedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())
@@ -3415,25 +3421,31 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
return flag;
}).count();
}
Map<String,Object> notStartedMap = new HashMap<>();
Map<String,Object> toConfirmMap = new HashMap<>();
// Map<String,Object> listToBeReleasedMap = new HashMap<>();
Map<String,Object> taskToBeInitiatedMap = new HashMap<>();
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();
Map<String,Object> acceptedMap = new HashMap<>();
Map<String,Object> rejectedMap = new HashMap<>();
notStartedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
notStartedMap.put("taskAffirmStatusCount",notStartedCount);
// listToBeReleasedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
// listToBeReleasedMap.put("taskAffirmStatusCount",listToBeReleasedCount);
toConfirmMap.put("taskAffirmStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
toConfirmMap.put("taskAffirmStatusCount",toConfirmCount);
taskToBeInitiatedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
taskToBeInitiatedMap.put("taskAffirmStatusCount",taskToBeInitiatedCount);
acceptedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.ACCEPTED.getValue());
taskToBeConfirmedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("taskAffirmStatusCount",taskToBeConfirmedCount);
acceptedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.ACCEPTED_OF_RESPONSIBLE_PERSON.getValue());
acceptedMap.put("taskAffirmStatusCount",acceptedCount);
rejectedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.REJECTED.getValue());
rejectedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue());
rejectedMap.put("taskAffirmStatusCount",rejectedCount);
result.add(notStartedMap);
result.add(toConfirmMap);
// result.add(listToBeReleasedMap);
result.add(taskToBeInitiatedMap);
result.add(taskToBeConfirmedMap);
result.add(acceptedMap);
result.add(rejectedMap);
return result;
@@ -3443,67 +3455,82 @@ public class PlatformProjectCertificationInventoryEOServiceImpl extends ServiceI
public List<Map<String, Object>> getPrehomoStatistice(List<ProjectCertificationInventoryEO> pciEoList) {
List<Map<String,Object>> result = new ArrayList<>();
int notStartedCount = 0;
int toConfirmCount = 0;
int acceptedCount = 0;
int rejectedCount = 0;
int taskToBeConfirmedCount = 0;//任务待确认
int resultsToBeSubmittedCount = 0;//结果待提交
int resultsToBeReviewedCount = 0;//结果待审查
int reviewAndPassCount = 0;//审查通过
int reviewAndReturnCount = 0;//审查退回
if(CollectionUtils.isNotEmpty(pciEoList)){
// 未发起
notStartedCount = (int) pciEoList.stream().filter(pciEo -> {
// 任务待确认
taskToBeConfirmedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())
// StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
// || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
// || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
// || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())
);
return flag;
}).count();
// 待确认
toConfirmCount = (int) pciEoList.stream().filter(pciEo -> {
// 结果待提交
resultsToBeSubmittedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
);
return flag;
}).count();
// 结果待审查
resultsToBeReviewedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
);
return flag;
}).count();
// 审查通过
acceptedCount = (int) pciEoList.stream().filter(pciEo -> {
reviewAndPassCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue())
);
return flag;
}).count();
// 审查退回
rejectedCount = (int) pciEoList.stream().filter(pciEo -> {
reviewAndReturnCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue())
);
return flag;
}).count();
}
Map<String,Object> notStartedMap = new HashMap<>();
Map<String,Object> toConfirmMap = new HashMap<>();
Map<String,Object> acceptedMap = new HashMap<>();
Map<String,Object> rejectedMap = new HashMap<>();
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();
Map<String,Object> resultsToBeSubmittedMap = new HashMap<>();
Map<String,Object> resultsToBeReviewedMap = new HashMap<>();
Map<String,Object> reviewAndPassMap = new HashMap<>();
Map<String,Object> reviewAndReturnMap = new HashMap<>();
notStartedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
notStartedMap.put("taskAffirmStatusCount",notStartedCount);
taskToBeConfirmedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("taskAffirmStatusCount",taskToBeConfirmedCount);
toConfirmMap.put("taskAffirmStatus", TodoCenterStatusEnum.TO_SUBMIT.getValue());
// toConfirmMap.put("taskAffirmStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
toConfirmMap.put("taskAffirmStatusCount",toConfirmCount);
resultsToBeSubmittedMap.put("taskAffirmStatus", CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
resultsToBeSubmittedMap.put("taskAffirmStatusCount",resultsToBeSubmittedCount);
acceptedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
acceptedMap.put("taskAffirmStatusCount",acceptedCount);
resultsToBeReviewedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
resultsToBeReviewedMap.put("taskAffirmStatusCount",resultsToBeReviewedCount);
rejectedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
rejectedMap.put("taskAffirmStatusCount",rejectedCount);
reviewAndPassMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
reviewAndPassMap.put("taskAffirmStatusCount",reviewAndPassCount);
result.add(notStartedMap);
result.add(toConfirmMap);
result.add(acceptedMap);
result.add(rejectedMap);
reviewAndReturnMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
reviewAndReturnMap.put("taskAffirmStatusCount",reviewAndReturnCount);
result.add(taskToBeConfirmedMap);
result.add(resultsToBeSubmittedMap);
result.add(resultsToBeReviewedMap);
result.add(reviewAndPassMap);
result.add(reviewAndReturnMap);
return result;
}
@@ -365,6 +365,8 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
LambdaQueryWrapper<ProjectLawsInventoryEO> wrapperTemp = new LambdaQueryWrapper<>();
wrapperTemp.in(ProjectLawsInventoryEO::getProjectLibraryId, projectLawsInventoryEO.getProjectLibraryId());
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.list(wrapperTemp);
//项目信息
ProjectLibraryBase projectLibraryBase = projectLibraryBaseService.getById(projectLawsInventoryEO.getProjectLibraryId());
//调取
String dummyInventoryBaseId = projectLawsInventoryEO.getDummyInventoryBaseId();
if (StringUtils.isNotBlank(projectLawsInventoryEO.getDummyids())) {
@@ -403,6 +405,8 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
projectLawsInventoryEOTemp.setVerifyFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
projectLawsInventoryEOTemp.setCreateTime(new Date());
projectLawsInventoryEOTemp.setUpdateTime(new Date());
projectLawsInventoryEOTemp.setRegulationOwnerId(projectLibraryBase.getRegulationOwnerId());
projectLawsInventoryEOTemp.setEngineeringInterfacePerson(projectLibraryBase.getEngineeringInterfacePerson());
projectLawsInventoryEOS.add(projectLawsInventoryEOTemp);
}
} else {
@@ -414,7 +418,7 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
if (collect.size() != 0) {
for (ProjectLawsInventoryEO lawsInventoryEO : collect) {
//数据对比
ProjectLawsInventoryEO projectLawsInventoryEOTemp = dataCompare(lawsInventoryEO, dummyInventoryInfoEO);
ProjectLawsInventoryEO projectLawsInventoryEOTemp = dataCompare(lawsInventoryEO, dummyInventoryInfoEO,projectLibraryBase);
projectLawsInventoryEOListTemp.add(projectLawsInventoryEOTemp);
}
} else {
@@ -429,6 +433,8 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
projectLawsInventoryEOTemp.setVerifyFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
projectLawsInventoryEOTemp.setCreateTime(new Date());
projectLawsInventoryEOTemp.setUpdateTime(new Date());
projectLawsInventoryEOTemp.setRegulationOwnerId(projectLibraryBase.getRegulationOwnerId());
projectLawsInventoryEOTemp.setEngineeringInterfacePerson(projectLibraryBase.getEngineeringInterfacePerson());
projectLawsInventoryEOS.add(projectLawsInventoryEOTemp);
}
}
@@ -3685,10 +3691,12 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
}
private ProjectLawsInventoryEO dataCompare(ProjectLawsInventoryEO projectLawsInventoryEO, DummyInventoryInfoEO dummyInventoryInfoEO) {
private ProjectLawsInventoryEO dataCompare(ProjectLawsInventoryEO projectLawsInventoryEO,
DummyInventoryInfoEO dummyInventoryInfoEO,
ProjectLibraryBase projectLibraryBase) {
//编号
if (StringUtils.isBlank(projectLawsInventoryEO.getSerialNumber())) {
projectLawsInventoryEO.setSendMsgFlag(dummyInventoryInfoEO.getSerialNumber());
projectLawsInventoryEO.setSerialNumber(dummyInventoryInfoEO.getSerialNumber());
}
//标题
if (StringUtils.isBlank(projectLawsInventoryEO.getTitle())) {
@@ -3788,6 +3796,14 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
if (StringUtils.isBlank(projectLawsInventoryEO.getVerifyDuty())) {
projectLawsInventoryEO.setVerifyDuty(dummyInventoryInfoEO.getVerifyDuty());
}
//法规工程师
if(StringUtils.isBlank(projectLawsInventoryEO.getRegulationOwnerId())){
projectLawsInventoryEO.setRegulationOwnerId(projectLibraryBase.getRegulationOwnerId());
}
//工程接口人
if(StringUtils.isBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())){
projectLawsInventoryEO.setEngineeringInterfacePerson(projectLibraryBase.getEngineeringInterfacePerson());
}
return projectLawsInventoryEO;
}
@@ -8741,7 +8757,7 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getName());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getCode());
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getEnName());
}
sysRoles.add(sysRole);
}
@@ -8759,7 +8775,7 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getName());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getCode());
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getEnName());
}
sysRoles.add(sysRole);
}
@@ -8776,7 +8792,7 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.INTERFACE_PERSON1.getName());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.INTERFACE_PERSON1.getCode());
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.INTERFACE_PERSON1.getEnName());
}
sysRoles.add(sysRole);
}
@@ -8795,7 +8811,7 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
if (StringUtils.equals(cut, CutEnum.CN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.PERSON_LIABLE1.getName());
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.PERSON_LIABLE1.getCode());
sysRole.setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.PERSON_LIABLE1.getEnName());
}
sysRoles.add(sysRole);
}
@@ -8823,17 +8839,17 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
} else if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
if (manager.size() != 0) {
manager.get(0).setRoleCode(com.jero.modules.system.enums.ProjectRoleEnum.MANAGER.getValue());
manager.get(0).setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.MANAGER.getCode());
manager.get(0).setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.MANAGER.getEnName());
sysRoles.addAll(manager);
}
if (admin.size() != 0) {
admin.get(0).setRoleCode(com.jero.modules.system.enums.ProjectRoleEnum.ADMIN.getValue());
admin.get(0).setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.ADMIN.getCode());
admin.get(0).setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.ADMIN.getEnName());
sysRoles.addAll(admin);
}
if (Viewer.size() != 0) {
Viewer.get(0).setRoleCode(com.jero.modules.system.enums.ProjectRoleEnum.VIEWER.getValue());
Viewer.get(0).setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.VIEWER.getCode());
Viewer.get(0).setRoleName(com.jero.modules.system.enums.ProjectRoleEnum.VIEWER.getEnName());
sysRoles.addAll(Viewer);
}
@@ -10026,60 +10042,126 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
}
@Override
public List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
public List<Map<String, Object>> getDesignTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
List<Map<String,Object>> result = new ArrayList<>();
int notStartedCount = 0;
int toConfirmCount = 0;
int acceptedCount = 0;
int rejectedCount = 0;
// int listToBeReleasedCount = 0;//清单待发布
int taskToBeInitiatedCount = 0;//任务待发起
int taskToBeConfirmedCount = 0;//任务待确认
int acceptedCount = 0;//责任人接收
int rejectedCount = 0;//责任人拒绝
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
// 未发起
int designNotStartedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
);
return flag;
}).count();
int verifyNotStartedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
);
return flag;
}).count();
notStartedCount = designNotStartedCount + verifyNotStartedCount;
// 清单待发布
// listToBeReleasedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
// );
// return flag;
// }).count();
// 待确认
int designToConfirmCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 任务待发起
taskToBeInitiatedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
);
return flag;
}).count();
// 任务待确认
taskToBeConfirmedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
);
return flag;
}).count();
int verifyToConfirmCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 责任人接收
acceptedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
// 责任人拒绝
rejectedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
);
return flag;
}).count();
}
// Map<String,Object> listToBeReleasedMap = new HashMap<>();//清单待发布
Map<String,Object> taskToBeInitiatedMap = new HashMap<>();//任务待发起
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();//任务待确认
Map<String,Object> acceptedMap = new HashMap<>();//责任人接收
Map<String,Object> rejectedMap = new HashMap<>();//责任人拒绝
// listToBeReleasedMap.put("designTaskAffirmStatus",ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
// listToBeReleasedMap.put("designTaskAffirmStatusCount",listToBeReleasedCount);
taskToBeInitiatedMap.put("designTaskAffirmStatus",ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
taskToBeInitiatedMap.put("designTaskAffirmStatusCount",taskToBeInitiatedCount);
taskToBeConfirmedMap.put("designTaskAffirmStatus",ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("designTaskAffirmStatusCount",taskToBeConfirmedCount);
acceptedMap.put("designTaskAffirmStatus",ComplianceFlowStatusEnum.DUTY_PERSON_ACCEPTED.getValue());
acceptedMap.put("designTaskAffirmStatusCount",acceptedCount);
rejectedMap.put("designTaskAffirmStatus",ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue());
rejectedMap.put("designTaskAffirmStatusCount",rejectedCount);
// result.add(listToBeReleasedMap);
result.add(taskToBeInitiatedMap);
result.add(taskToBeConfirmedMap);
result.add(acceptedMap);
result.add(rejectedMap);
return result;
}
@Override
public List<Map<String, Object>> getVerifyTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
List<Map<String,Object>> result = new ArrayList<>();
// int listToBeReleasedCount = 0;//清单待发布
int taskToBeInitiatedCount = 0;//任务待发起
int taskToBeConfirmedCount = 0;//任务待确认
int acceptedCount = 0;//责任人接收
int rejectedCount = 0;//责任人拒绝
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
// 清单待发布
// listToBeReleasedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
// );
// return flag;
// }).count();
// 任务待发起
taskToBeInitiatedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
);
return flag;
}).count();
// 任务待确认
taskToBeConfirmedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
);
return flag;
}).count();
toConfirmCount = designToConfirmCount + verifyToConfirmCount;
// 接受
int designAcceptedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
int verifyAcceptedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 责任人接收
acceptedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
@@ -10089,76 +10171,188 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
);
return flag;
}).count();
acceptedCount = designAcceptedCount + verifyAcceptedCount;
// 拒绝
int designRejectedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
);
return flag;
}).count();
int verifyRejectedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 责任人拒绝
rejectedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
);
return flag;
}).count();
rejectedCount = designRejectedCount + verifyRejectedCount;
}
Map<String,Object> notStartedMap = new HashMap<>();
Map<String,Object> toConfirmMap = new HashMap<>();
Map<String,Object> acceptedMap = new HashMap<>();
Map<String,Object> rejectedMap = new HashMap<>();
// Map<String,Object> listToBeReleasedMap = new HashMap<>();//清单待发布
Map<String,Object> taskToBeInitiatedMap = new HashMap<>();//任务待发起
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();//任务待确认
Map<String,Object> acceptedMap = new HashMap<>();//责任人接收
Map<String,Object> rejectedMap = new HashMap<>();//责任人拒绝
notStartedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
notStartedMap.put("taskAffirmStatusCount",notStartedCount);
// listToBeReleasedMap.put("verifyTaskAffirmStatus",ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
// listToBeReleasedMap.put("verifyTaskAffirmStatusCount",listToBeReleasedCount);
toConfirmMap.put("taskAffirmStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
toConfirmMap.put("taskAffirmStatusCount",toConfirmCount);
taskToBeInitiatedMap.put("verifyTaskAffirmStatus",ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
taskToBeInitiatedMap.put("verifyTaskAffirmStatusCount",taskToBeInitiatedCount);
acceptedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.ACCEPTED.getValue());
acceptedMap.put("taskAffirmStatusCount",acceptedCount);
taskToBeConfirmedMap.put("verifyTaskAffirmStatus",ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("verifyTaskAffirmStatusCount",taskToBeConfirmedCount);
rejectedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.REJECTED.getValue());
rejectedMap.put("taskAffirmStatusCount",rejectedCount);
acceptedMap.put("verifyTaskAffirmStatus",ComplianceFlowStatusEnum.DUTY_PERSON_ACCEPTED.getValue());
acceptedMap.put("verifyTaskAffirmStatusCount",acceptedCount);
result.add(notStartedMap);
result.add(toConfirmMap);
rejectedMap.put("verifyTaskAffirmStatus",ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue());
rejectedMap.put("verifyTaskAffirmStatusCount",rejectedCount);
// result.add(listToBeReleasedMap);
result.add(taskToBeInitiatedMap);
result.add(taskToBeConfirmedMap);
result.add(acceptedMap);
result.add(rejectedMap);
return result;
}
// @Override
// public List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
// List<Map<String,Object>> result = new ArrayList<>();
//
// int notStartedCount = 0;
// int toConfirmCount = 0;
// int acceptedCount = 0;
// int rejectedCount = 0;
// if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
// // 未发起
// int designNotStartedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
// );
// return flag;
// }).count();
// int verifyNotStartedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
// );
// return flag;
// }).count();
// notStartedCount = designNotStartedCount + verifyNotStartedCount;
//
// // 待确认
// int designToConfirmCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
// );
// return flag;
// }).count();
// int verifyToConfirmCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
// );
// return flag;
// }).count();
// toConfirmCount = designToConfirmCount + verifyToConfirmCount;
//
// // 接受
// int designAcceptedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
// );
// return flag;
// }).count();
// int verifyAcceptedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
// );
// return flag;
// }).count();
// acceptedCount = designAcceptedCount + verifyAcceptedCount;
//
// // 拒绝
// int designRejectedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
// );
// return flag;
// }).count();
// int verifyRejectedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// boolean flag = (
// StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
// );
// return flag;
// }).count();
// rejectedCount = designRejectedCount + verifyRejectedCount;
// }
//
// Map<String,Object> notStartedMap = new HashMap<>();
// Map<String,Object> toConfirmMap = new HashMap<>();
// Map<String,Object> acceptedMap = new HashMap<>();
// Map<String,Object> rejectedMap = new HashMap<>();
//
// notStartedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
// notStartedMap.put("taskAffirmStatusCount",notStartedCount);
//
// toConfirmMap.put("taskAffirmStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
// toConfirmMap.put("taskAffirmStatusCount",toConfirmCount);
//
// acceptedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.ACCEPTED.getValue());
// acceptedMap.put("taskAffirmStatusCount",acceptedCount);
//
// rejectedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.REJECTED.getValue());
// rejectedMap.put("taskAffirmStatusCount",rejectedCount);
//
// result.add(notStartedMap);
// result.add(toConfirmMap);
// result.add(acceptedMap);
// result.add(rejectedMap);
// return result;
// }
@Override
public List<Map<String, Object>> getDesignComplianceStatistice(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
List<Map<String,Object>> result = new ArrayList<>();
int notStartedCount = 0;
int toConfirmCount = 0;
int complianceCount = 0;
int nonComplianceCount = 0;
int taskToBeConfirmedCount = 0;//任务待确认
int resultsToBeSubmittedCount = 0;//结果待提交
int resultsToBeReviewedCount = 0;//结果待审查
int complianceCount = 0;//符合
int nonComplianceCount = 0;//不符合
int toBeTrackedCount = 0;//待追踪
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
// 未发起
notStartedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 任务待确认
taskToBeConfirmedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
// StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
);
return flag;
}).count();
// 待确认
toConfirmCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 结果待提交
resultsToBeSubmittedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
// || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
// 结果待审查
resultsToBeReviewedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
);
return flag;
}).count();
@@ -10170,69 +10364,94 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
);
return flag;
}).count();
// 不符合
nonComplianceCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|| StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
// 待追踪
toBeTrackedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
}
Map<String,Object> notStartedMap = new HashMap<>();
Map<String,Object> toConfirmMap = new HashMap<>();
Map<String,Object> acceptedMap = new HashMap<>();
Map<String,Object> rejectedMap = new HashMap<>();
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();
Map<String,Object> resultsToBeSubmittedMap = new HashMap<>();
Map<String,Object> resultsToBeReviewedMap = new HashMap<>();
Map<String,Object> complianceMap = new HashMap<>();
Map<String,Object> nonComplianceMap = new HashMap<>();
Map<String,Object> toBeTrackedMap = new HashMap<>();
notStartedMap.put("designFlowTaskStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
notStartedMap.put("designFlowTaskStatusCount",notStartedCount);
taskToBeConfirmedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("designFlowTaskStatusCount",taskToBeConfirmedCount);
toConfirmMap.put("designFlowTaskStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
toConfirmMap.put("designFlowTaskStatusCount",toConfirmCount);
resultsToBeSubmittedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
resultsToBeSubmittedMap.put("designFlowTaskStatusCount",resultsToBeSubmittedCount);
acceptedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.CONFORMITY.getValue());
acceptedMap.put("designFlowTaskStatusCount",complianceCount);
resultsToBeReviewedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
resultsToBeReviewedMap.put("designFlowTaskStatusCount",resultsToBeReviewedCount);
rejectedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.INCONFORMITY.getValue());
rejectedMap.put("designFlowTaskStatusCount",nonComplianceCount);
complianceMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.CONFORMITY.getValue());
complianceMap.put("designFlowTaskStatusCount",complianceCount);
result.add(notStartedMap);
result.add(toConfirmMap);
result.add(acceptedMap);
result.add(rejectedMap);
nonComplianceMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.INCONFORMITY.getValue());
nonComplianceMap.put("designFlowTaskStatusCount",nonComplianceCount);
toBeTrackedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.TO_TRACK.getValue());
toBeTrackedMap.put("designFlowTaskStatusCount",toBeTrackedCount);
result.add(taskToBeConfirmedMap);
result.add(resultsToBeSubmittedMap);
result.add(resultsToBeReviewedMap);
result.add(complianceMap);
result.add(nonComplianceMap);
result.add(toBeTrackedMap);
return result;
}
@Override
public List<Map<String, Object>> getVerifyComplianceStatistice(List<ProjectLawsInventoryEO> projectLawsInventoryEOList) {
List<Map<String,Object>> result = new ArrayList<>();
int notStartedCount = 0;
int toConfirmCount = 0;
int complianceCount = 0;
int nonComplianceCount = 0;
int taskToBeConfirmedCount = 0;//任务待确认
int resultsToBeSubmittedCount = 0;//结果待提交
int resultsToBeReviewedCount = 0;//结果待审查
int complianceCount = 0;//符合
int nonComplianceCount = 0;//不符合
int toBeTrackedCount = 0;//待追踪
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
// 未发起
notStartedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 任务待确认
taskToBeConfirmedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
// StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue())
);
return flag;
}).count();
// 待确认
toConfirmCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
// 结果待提交
resultsToBeSubmittedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
// || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
// 结果待审查
resultsToBeReviewedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
);
return flag;
}).count();
@@ -10244,38 +10463,53 @@ public class PlatformProjectLawsInventoryEOServiceImpl extends ServiceImpl<Platf
);
return flag;
}).count();
// 不符合
nonComplianceCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue())
|| StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
// 待追踪
toBeTrackedCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> {
boolean flag = (
StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue())
);
return flag;
}).count();
}
Map<String,Object> notStartedMap = new HashMap<>();
Map<String,Object> toConfirmMap = new HashMap<>();
Map<String,Object> acceptedMap = new HashMap<>();
Map<String,Object> rejectedMap = new HashMap<>();
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();
Map<String,Object> resultsToBeSubmittedMap = new HashMap<>();
Map<String,Object> resultsToBeReviewedMap = new HashMap<>();
Map<String,Object> complianceMap = new HashMap<>();
Map<String,Object> nonComplianceMap = new HashMap<>();
Map<String,Object> toBeTrackedMap = new HashMap<>();
notStartedMap.put("verifyFlowTaskStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
notStartedMap.put("verifyFlowTaskStatusCount",notStartedCount);
taskToBeConfirmedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("verifyFlowTaskStatusCount",taskToBeConfirmedCount);
toConfirmMap.put("verifyFlowTaskStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
toConfirmMap.put("verifyFlowTaskStatusCount",toConfirmCount);
resultsToBeSubmittedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
resultsToBeSubmittedMap.put("verifyFlowTaskStatusCount",resultsToBeSubmittedCount);
acceptedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.CONFORMITY.getValue());
acceptedMap.put("verifyFlowTaskStatusCount",complianceCount);
resultsToBeReviewedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
resultsToBeReviewedMap.put("verifyFlowTaskStatusCount",resultsToBeReviewedCount);
rejectedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.INCONFORMITY.getValue());
rejectedMap.put("verifyFlowTaskStatusCount",nonComplianceCount);
complianceMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.CONFORMITY.getValue());
complianceMap.put("verifyFlowTaskStatusCount",complianceCount);
result.add(notStartedMap);
result.add(toConfirmMap);
result.add(acceptedMap);
result.add(rejectedMap);
nonComplianceMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.INCONFORMITY.getValue());
nonComplianceMap.put("verifyFlowTaskStatusCount",nonComplianceCount);
toBeTrackedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.TO_TRACK.getValue());
toBeTrackedMap.put("verifyFlowTaskStatusCount",toBeTrackedCount);
result.add(taskToBeConfirmedMap);
result.add(resultsToBeSubmittedMap);
result.add(resultsToBeReviewedMap);
result.add(complianceMap);
result.add(nonComplianceMap);
result.add(toBeTrackedMap);
return result;
}
@@ -30,6 +30,7 @@ import com.jero.modules.platform.mapper.PlatformProjectLawsInventoryEOMapper;
import com.jero.modules.platform.mapper.PlatformProjectLibraryBaseMapper;
import com.jero.modules.platform.service.IPlatformProjectCertificationInventoryEOService;
import com.jero.modules.platform.service.IPlatformProjectLibraryBaseService;
import com.jero.modules.project.entity.LawsInventoryPlatformEO;
import com.jero.modules.project.entity.ProjectCertificationInventoryEO;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.entity.ProjectLawsInventoryLogEO;
@@ -58,13 +59,17 @@ import com.jero.modules.project.enums.TopEnum;
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
import com.jero.modules.project.mapper.ProjectTaskInventoryEOMapper;
import com.jero.modules.project.mapper.ProjectUserPermissionMapper;
import com.jero.modules.project.service.ILawsInventoryPlatformEOService;
import com.jero.modules.project.service.IProjectLibraryRoleRelEOService;
import com.jero.modules.project.service.IProjectLibraryStatisticsService;
import com.jero.modules.project.service.IProjectUserPermissionService;
import com.jero.modules.project.service.editImpl.ProjectLawsInventoryEOEditServiceImpl;
import com.jero.modules.project.service.impl.ProjectLawsInventoryEOServiceImpl;
import com.jero.modules.project.service.impl.ProjectLawsInventoryLogEOServiceImpl;
import com.jero.modules.project.service.impl.ProjectRelatedPersonnelServiceImpl;
import com.jero.modules.project.service.impl.ProjectTaskPlanningServiceImpl;
import com.jero.modules.project.vo.TimeNodeVO;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.enums.DicCodeEnum;
@@ -74,10 +79,11 @@ import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.IProjectUserBrandService;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.DictItemUtil;
import com.jero.modules.system.util.StringUtils;
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
import com.jero.modules.top.entity.TopProjectEO;
import com.jero.modules.top.service.ITopProjectEOService;
@@ -200,6 +206,14 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
private SysDictItemMapper sysDictItemMapper;
@Autowired
private IOSSFileService iOSSFileService;
@Autowired
private ILawsInventoryPlatformEOService lawsInventoryPlatformEOService;
@Autowired
private ProjectLawsInventoryEOServiceImpl projectLawsInventoryEOService;
@Autowired
private SysCategoryServiceImpl sysCategoryService;
@Autowired
private ProjectLawsInventoryEOEditServiceImpl editService;
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
private static DecimalFormat df = new DecimalFormat("#.00");
@@ -661,7 +675,7 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
personnelQueryWrapper.eq("duty_territory", lawsInventoryEO.getDutyTerritory()).eq("project_id", projectLibraryBase.getId());
List<ProjectRelatedPersonnel> personnels = projectRelatedPersonnelService.list(personnelQueryWrapper);
if (!original.getStudioEngineer().equals(projectLibraryBase.getStudioEngineer())) {
if (StringUtils.isNotBlank(original.getStudioEngineer()) && !original.getStudioEngineer().equals(projectLibraryBase.getStudioEngineer())) {
StringBuilder participator = new StringBuilder();
if (ObjectUtils.isNotEmpty(personnels)) {
if (ObjectUtils.isNotEmpty(personnels.get(0).getLawEngineer())) {
@@ -1141,7 +1155,7 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
param.put("cut",cut);
String targetMarket = getMarket(param, targetMarketList, projectLibraryBase);
//项目名称功率-生产商-目标市场
String projectName = projectLibraryBase.getPower() + "-" + projectLibraryBase.getProducer() + "-" + targetMarket;
String projectName = projectLibraryBase.getPlatformType() + "-" + projectLibraryBase.getPower() + "-" + projectLibraryBase.getProducer() + "-" + targetMarket;
projectLibraryBase.setProjectNameId(projectName);//原设计平台件项目名称去这个字段值
//平台件项目名称改为拼接的形式projectNameId不在存数据如果这个变更影响其他的地方项目名称取值可以取projectName的值
projectLibraryBase.setProjectName(projectName);
@@ -1543,7 +1557,7 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
param.put("cut",cut);
String targetMarketTemp = getMarket(param, targetMarketList, projectLibraryBase);
//项目名称功率-生产商-目标市场
String projectName = projectLibraryBase.getPower() + "-" + projectLibraryBase.getProducer() + "-" + targetMarketTemp;
String projectName = projectLibraryBase.getPlatformType() + "-" + projectLibraryBase.getPower() + "-" + projectLibraryBase.getProducer() + "-" + targetMarketTemp;
projectLibraryBase.setProjectNameId(projectName);//原设计平台件项目名称去这个字段值
//平台件项目名称改为拼接的形式projectNameId不在存数据如果这个变更影响其他的地方项目名称取值可以取projectName的值
projectLibraryBase.setProjectName(projectName);
@@ -1600,6 +1614,10 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
Map<String,Object> certificationProgressMap = new HashMap<>();
// 认证任务确认
Map<String,Object> rzTaskToConfirmMap = new HashMap<>();
//设计任务确认
Map<String,Object> designTaskToConfirmMap = new HashMap<>();
//验证任务确认
Map<String,Object> verifyTaskToConfirmMap = new HashMap<>();
//清单确认统计
/*List<Map<String,Object>> listingToConfirmMapList = this.platformProjectLawsInventoryEOMapper.getlistingToConfirmStatistics(id);
@@ -1613,17 +1631,43 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
List<String> projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
//任务确认统计
List<Map<String,Object>> taskToConfirmMapList = this.platformProjectLawsInventoryEOService.getTaskToConfirmStatistics(projectLawsInventoryEOList);
int taskAffirmStatusCount = 0;
if(CollectionUtils.isNotEmpty(taskToConfirmMapList)){
// List<Map<String,Object>> taskToConfirmMapList = this.platformProjectLawsInventoryEOService.getTaskToConfirmStatistics(projectLawsInventoryEOList);
// int taskAffirmStatusCount = 0;
// if(CollectionUtils.isNotEmpty(taskToConfirmMapList)){
// //taskAffirmStatusCount
// for (Map<String, Object> taskToConfirm : taskToConfirmMapList) {
// taskAffirmStatusCount += (int) taskToConfirm.get("taskAffirmStatusCount");
// }
// }
// taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList);
// taskToConfirmMap.put("count",taskAffirmStatusCount);
// result.put("taskToConfirmMap",taskToConfirmMap);
//设计任务确认
List<Map<String,Object>> designTaskToConfirmMapList = this.platformProjectLawsInventoryEOService.getDesignTaskToConfirmStatistics(projectLawsInventoryEOList);
int designTaskAffirmStatusCount = 0;
if(CollectionUtils.isNotEmpty(designTaskToConfirmMapList)){
//taskAffirmStatusCount
for (Map<String, Object> taskToConfirm : taskToConfirmMapList) {
taskAffirmStatusCount += (int) taskToConfirm.get("taskAffirmStatusCount");
for (Map<String, Object> taskToConfirm : designTaskToConfirmMapList) {
designTaskAffirmStatusCount += (int) taskToConfirm.get("designTaskAffirmStatusCount");
}
}
taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList);
taskToConfirmMap.put("count",taskAffirmStatusCount);
result.put("taskToConfirmMap",taskToConfirmMap);
designTaskToConfirmMap.put("designTaskToConfirmMapList",designTaskToConfirmMapList);
designTaskToConfirmMap.put("count",designTaskAffirmStatusCount);
result.put("designTaskToConfirmMap",designTaskToConfirmMap);
//验证任务确认
List<Map<String,Object>> verifyTaskToConfirmMapList = this.platformProjectLawsInventoryEOService.getVerifyTaskToConfirmStatistics(projectLawsInventoryEOList);
int verifyTaskAffirmStatusCount = 0;
if(CollectionUtils.isNotEmpty(verifyTaskToConfirmMapList)){
//taskAffirmStatusCount
for (Map<String, Object> taskToConfirm : verifyTaskToConfirmMapList) {
verifyTaskAffirmStatusCount += (int) taskToConfirm.get("verifyTaskAffirmStatusCount");
}
}
verifyTaskToConfirmMap.put("verifyTaskToConfirmMapList",verifyTaskToConfirmMapList);
verifyTaskToConfirmMap.put("count",verifyTaskAffirmStatusCount);
result.put("verifyTaskToConfirmMap",verifyTaskToConfirmMap);
//设计符合性
@@ -2470,9 +2514,9 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
+ "-" + projectVersion);
}else{
//projectLibraryBase.getYearName()为空的时候代表为平台件数据
projectLibraryBase.setProjectNameEn(projectLibraryBase.getPower()+"-"+projectLibraryBase.getProducer()+"-"+targetMarketEn);
projectLibraryBase.setProjectNameEn(projectLibraryBase.getPlatformType() + "-" + projectLibraryBase.getPower()+"-"+projectLibraryBase.getProducer()+"-"+targetMarketEn);
projectLibraryBase.setProjectNameCn(projectLibraryBase.getPower()+"-"+projectLibraryBase.getProducer()+"-"+targetMarketCn);
projectLibraryBase.setProjectNameCn(projectLibraryBase.getPlatformType() + "-" + projectLibraryBase.getPower()+"-"+projectLibraryBase.getProducer()+"-"+targetMarketCn);
}
if(StringUtils.isNotEmpty(projectLibraryBase.getStudioEngineer())){
@@ -2664,33 +2708,58 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
* @param params
*/
private void exportRegulatoryManagement(HSSFWorkbook workbook,Map<String,Object> params) {
// String cut = (String) params.get("cut");
// String sheetName = "法规符合性管理";
// String firstTitle = "法规任务确认," +
// "设计符合性确认," +
// "验证符合性确认";
// String secondTitle = "责任领域(一级)," +
// "未发起,待确认,接受,拒绝,完成度," +
// "未发起,待确认,符合,不符合,完成度," +
// "未发起,待确认,符合,不符合,完成度";
// if(StringUtils.equals(cut,CutEnum.EN.getValue())){
// sheetName = "Regulatory compliance management";
// firstTitle = "Regulatory task confirmation," +
// "Design Conformity Verification," +
// "Verification Conformity Confirmation";
// secondTitle = "Area of responsibility (level 1)," +
// "Not launched,To be confirmed,Accept,Refuse,Degree of completion," +
// "Not launched,To be confirmed,Meet,Not meet,Degree of completion," +
// "Not launched,To be confirmed,Meet,Not meet,Degree of completion";
// }
String cut = (String) params.get("cut");
String sheetName = "法规符合性管理";
String firstTitle = "法规任务确认," +
"设计符合性确认," +
"验证符合性确认";
String firstTitle = "设计任务确认," +
"验证任务确认," +
"设计符合性," +
"验证符合性";
String secondTitle = "责任领域(一级)," +
"发起,待确认,接受,拒绝,完成度," +
"发起,待确认,符合,不符合,完成度," +
"未发起,待确认,符合,不符合,完成度";
"清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度," +
"清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度," +
"任务待确认,结果待提交,结果待审查,符合,不符合,待追踪,完成度," +
"任务待确认,结果待提交,结果待审查,符合,不符合,待追踪,完成度";
if(StringUtils.equals(cut,CutEnum.EN.getValue())){
sheetName = "Regulatory compliance management";
firstTitle = "Regulatory task confirmation," +
"Design Conformity Verification," +
"Verification Conformity Confirmation";
firstTitle = "Design Task Confirmation," +
"Verification Task Confirmation," +
"Design Compliance," +
"Verify Compliance";
secondTitle = "Area of responsibility (level 1)," +
"Not launched,To be confirmed,Accept,Refuse,Degree of completion," +
"Not launched,To be confirmed,Meet,Not meet,Degree of completion," +
"Not launched,To be confirmed,Meet,Not meet,Degree of completion";
"List To Be Released,Task To Be Initiated,Task To Be Confirmed,Accepted By The Responsible Person,Rejected By The Responsible Person,Degree Of Completion," +
"List To Be Released,Task To Be Initiated,Task To Be Confirmed,Accepted By The Responsible Person,Rejected By The Responsible Person,Degree Of Completion," +
"Task To Be Confirmed,Results To Be Submitted,Results To Be Reviewed,Compliance,Non-compliance,To Be Tracked,Degree Of Completion," +
"Task To Be Confirmed,Results To Be Submitted,Results To Be Reviewed,Compliance,Non-compliance,To Be Tracked,Degree Of Completion";
}
HSSFSheet sheet = workbook.createSheet(sheetName);
//合并单元格 起始行结束行起始列结束列
CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5);
CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 6);
sheet.addMergedRegion(region1);
CellRangeAddress region2 = new CellRangeAddress(0, 0, 6, 10);
CellRangeAddress region2 = new CellRangeAddress(0, 0, 7, 12);
sheet.addMergedRegion(region2);
CellRangeAddress region3 = new CellRangeAddress(0, 0, 11, 15);
CellRangeAddress region3 = new CellRangeAddress(0, 0, 13, 19);
sheet.addMergedRegion(region3);
CellRangeAddress region4 = new CellRangeAddress(0, 0, 20, 26);
sheet.addMergedRegion(region4);
String[] firstTitleArr = firstTitle.split(",");
String[] secondTitleArr = secondTitle.split(",");
@@ -2699,16 +2768,18 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
CellStyle cellStyleTitle = workbook.createCellStyle();
cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);
for (int i = 0; i <= 15; i++){
for (int i = 0; i <= 26; i++){
sheet.setColumnWidth(i, 3500);
Cell firstRowCell = firstRow.createCell(i);
firstRowCell.setCellStyle(cellStyleTitle);
if(i == 1){
firstRowCell.setCellValue(firstTitleArr[0]);
}else if(i==6){
}else if(i==7){
firstRowCell.setCellValue(firstTitleArr[1]);
}else if(i==11){
}else if(i==13){
firstRowCell.setCellValue(firstTitleArr[2]);
}else if(i==20){
firstRowCell.setCellValue(firstTitleArr[3]);
}
Cell secondRowCell = secondRow.createCell(i);
@@ -2774,59 +2845,104 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
Row dataRow = sheet.createRow(dataIndex);
dataRow.createCell(0).setCellValue(key);
Map<String, Object> taskConfirmMap= this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritory(pliEoList, params);
Map<String,Object> taskConfirmNotStartedMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue());
double taskConfirmNotStartedAmount = (double) taskConfirmNotStartedMap.get("amount");
Map<String,Object> taskConfirmToConfirmMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
double taskConfirmToConfirmAmount = (double) taskConfirmToConfirmMap.get("amount");
Map<String,Object> taskConfirmAcceptedMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.ACCEPTED.getValue());
double taskConfirmAcceptedAmount = (double) taskConfirmAcceptedMap.get("amount");
Map<String,Object> taskConfirmRejectedMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.REJECTED.getValue());
double taskConfirmRejectedAmount = (double) taskConfirmRejectedMap.get("amount");
dataRow.createCell(1).setCellValue(taskConfirmNotStartedAmount);
dataRow.createCell(2).setCellValue(taskConfirmToConfirmAmount);
dataRow.createCell(3).setCellValue(taskConfirmAcceptedAmount);
dataRow.createCell(4).setCellValue(taskConfirmRejectedAmount);
double taskConfirmCount = taskConfirmNotStartedAmount + taskConfirmToConfirmAmount + taskConfirmAcceptedAmount + taskConfirmRejectedAmount;
double taskConfirmPercentage = (taskConfirmAcceptedAmount / taskConfirmCount) * 100;
String taskConfirmPercentageStr = (taskConfirmPercentage != 0 && (taskConfirmCount !=0 )) ? df.format(taskConfirmPercentage) : "0";
dataRow.createCell(5).setCellValue(taskConfirmPercentageStr + percentSign);
//设计任务确认
Map<String, Object> designTaskConfirmMap= this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritoryDesign(pliEoList, params);
Map<String,Object> designTaskListToBeReleasedMap = (Map<String, Object>) designTaskConfirmMap.get(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
double designTaskListToBeReleasedAmount = (double) designTaskListToBeReleasedMap.get("amount");
Map<String,Object> designTaskToBeInitiatedMap = (Map<String, Object>) designTaskConfirmMap.get(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
double designTaskToBeInitiatedAmount = (double) designTaskToBeInitiatedMap.get("amount");
Map<String,Object> designTaskToBeConfirmedMap = (Map<String, Object>) designTaskConfirmMap.get(ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
double designTaskToBeConfirmedAmount = (double) designTaskToBeConfirmedMap.get("amount");
Map<String,Object> designAcceptedMap = (Map<String, Object>) designTaskConfirmMap.get(ComplianceFlowStatusEnum.DUTY_PERSON_ACCEPTED.getValue());
double designAcceptedAmount = (double) designAcceptedMap.get("amount");
Map<String,Object> designRejectedMap = (Map<String, Object>) designTaskConfirmMap.get(ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue());
double designRejectedAmount = (double) designRejectedMap.get("amount");
dataRow.createCell(1).setCellValue(designTaskListToBeReleasedAmount);
dataRow.createCell(2).setCellValue(designTaskToBeInitiatedAmount);
dataRow.createCell(3).setCellValue(designTaskToBeConfirmedAmount);
dataRow.createCell(4).setCellValue(designAcceptedAmount);
dataRow.createCell(5).setCellValue(designRejectedAmount);
double designTaskConfirmCount = designTaskListToBeReleasedAmount + designTaskToBeInitiatedAmount + designTaskToBeConfirmedAmount + designAcceptedAmount + designRejectedAmount;
double designTaskConfirmPercentage = (designAcceptedAmount / designTaskConfirmCount) * 100;
String designTaskConfirmPercentageStr = (designTaskConfirmPercentage != 0 && (designTaskConfirmCount !=0 )) ? df.format(designTaskConfirmPercentage) : "0";
dataRow.createCell(6).setCellValue(designTaskConfirmPercentageStr + percentSign);
//验证任务确认
Map<String, Object> verifyTaskConfirmMap= this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritoryVerify(pliEoList, params);
Map<String,Object> verifyTaskListToBeReleasedMap = (Map<String, Object>) verifyTaskConfirmMap.get(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
double verifyTaskListToBeReleasedAmount = (double) verifyTaskListToBeReleasedMap.get("amount");
Map<String,Object> verifyTaskToBeInitiatedMap = (Map<String, Object>) verifyTaskConfirmMap.get(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
double verifyTaskToBeInitiatedAmount = (double) verifyTaskToBeInitiatedMap.get("amount");
Map<String,Object> verifyTaskToBeConfirmedMap = (Map<String, Object>) verifyTaskConfirmMap.get(ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
double verifyTaskToBeConfirmedAmount = (double) verifyTaskToBeConfirmedMap.get("amount");
Map<String,Object> verifyAcceptedMap = (Map<String, Object>) verifyTaskConfirmMap.get(ComplianceFlowStatusEnum.DUTY_PERSON_ACCEPTED.getValue());
double verifyAcceptedAmount = (double) verifyAcceptedMap.get("amount");
Map<String,Object> verifyRejectedMap = (Map<String, Object>) verifyTaskConfirmMap.get(ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue());
double verifyRejectedAmount = (double) verifyRejectedMap.get("amount");
dataRow.createCell(7).setCellValue(verifyTaskListToBeReleasedAmount);
dataRow.createCell(8).setCellValue(verifyTaskToBeInitiatedAmount);
dataRow.createCell(9).setCellValue(verifyTaskToBeConfirmedAmount);
dataRow.createCell(10).setCellValue(verifyAcceptedAmount);
dataRow.createCell(11).setCellValue(verifyRejectedAmount);
double verifyTaskConfirmCount = verifyTaskListToBeReleasedAmount + verifyTaskToBeInitiatedAmount + verifyTaskToBeConfirmedAmount + verifyAcceptedAmount + verifyRejectedAmount;
double verifyTaskConfirmPercentage = (verifyAcceptedAmount / verifyTaskConfirmCount) * 100;
String verifyTaskConfirmPercentageStr = (verifyTaskConfirmPercentage != 0 && (verifyTaskConfirmCount !=0 )) ? df.format(verifyTaskConfirmPercentage) : "0";
dataRow.createCell(12).setCellValue(verifyTaskConfirmPercentageStr + percentSign);
//设计符合性
Map<String, Object> designMap = this.projectLibraryStatisticsService.getDesignComplianceStatisticeGroupByTerritory(pliEoList, params);
Map<String,Object> designNotStartedMap = (Map<String, Object>) designMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue());
double designNotStartedAmount = (double) designNotStartedMap.get("amount");
Map<String,Object> designToConfirmMap = (Map<String, Object>) designMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
double designToConfirmAmount = (double) designToConfirmMap.get("amount");
Map<String,Object> designComplianceMap = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue());
double designComplianceAmount = (double) designComplianceMap.get("amount");
Map<String,Object> designNonComplianceMap = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.INCONFORMITY.getValue());
double designNonComplianceAmount = (double) designNonComplianceMap.get("amount");
dataRow.createCell(6).setCellValue(designNotStartedAmount);
dataRow.createCell(7).setCellValue(designToConfirmAmount);
dataRow.createCell(8).setCellValue(designComplianceAmount);
dataRow.createCell(9).setCellValue(designNonComplianceAmount);
double designCount = designNotStartedAmount + designToConfirmAmount + designComplianceAmount + designNonComplianceAmount;
double designPercentage = (designComplianceAmount / designCount) * 100;
String designPercentageStr = (designPercentage != 0 && (designCount !=0 )) ? df.format(designPercentage) : "0";
dataRow.createCell(10).setCellValue(designPercentageStr + percentSign);
Map<String,Object> taskToBeConfirmedMapDesign = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
double taskToBeConfirmedAmountDesign = (double) taskToBeConfirmedMapDesign.get("amount");
Map<String,Object> resultsToBeSubmittedMapDesign = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
double resultsToBeSubmittedAmountDesign = (double) resultsToBeSubmittedMapDesign.get("amount");
Map<String,Object> resultsToBeReviewedMapDesign = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
double resultsToBeReviewedAmountDesign = (double) resultsToBeReviewedMapDesign.get("amount");
Map<String,Object> complianceMapDesign = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue());
double complianceAmountDesign = (double) complianceMapDesign.get("amount");
Map<String,Object> nonComplianceMapDesign = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.INCONFORMITY.getValue());
double nonComplianceAmountDesign = (double) nonComplianceMapDesign.get("amount");
Map<String,Object> toBeTrackedMapDesign = (Map<String, Object>) designMap.get(ComplianceFlowStatusEnum.TO_TRACK.getValue());
double toBeTrackedAmountDesign = (double) toBeTrackedMapDesign.get("amount");
dataRow.createCell(13).setCellValue(taskToBeConfirmedAmountDesign);
dataRow.createCell(14).setCellValue(resultsToBeSubmittedAmountDesign);
dataRow.createCell(15).setCellValue(resultsToBeReviewedAmountDesign);
dataRow.createCell(16).setCellValue(complianceAmountDesign);
dataRow.createCell(17).setCellValue(nonComplianceAmountDesign);
dataRow.createCell(18).setCellValue(toBeTrackedAmountDesign);
double designCount = taskToBeConfirmedAmountDesign + resultsToBeSubmittedAmountDesign + resultsToBeReviewedAmountDesign + nonComplianceAmountDesign + nonComplianceAmountDesign + toBeTrackedAmountDesign;
double designPercentage = (complianceAmountDesign / designCount) * 100;
String designPercentageStr = (designPercentage != 0 && (designCount !=0 )) ? df.format(designPercentage) : "0";
dataRow.createCell(19).setCellValue(designPercentageStr + percentSign);
//验证符合性明天从此位置开始改
Map<String, Object> verifyMap = this.projectLibraryStatisticsService.getVerifyComplianceStatisticeGroupByTerritory(pliEoList, params);
Map<String,Object> verifyNotStartedMap = (Map<String, Object>) verifyMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue());
double verifyNotStartedAmount = (double) verifyNotStartedMap.get("amount");
Map<String,Object> verifyToConfirmMap = (Map<String, Object>) verifyMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
double verifyToConfirmAmount = (double) verifyToConfirmMap.get("amount");
Map<String,Object> verifyComplianceMap = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue());
double verifyComplianceAmount = (double) verifyComplianceMap.get("amount");
Map<String,Object> verifyNonComplianceMap = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.INCONFORMITY.getValue());
double verifyNonComplianceAmount = (double) verifyNonComplianceMap.get("amount");
dataRow.createCell(11).setCellValue(verifyNotStartedAmount);
dataRow.createCell(12).setCellValue(verifyToConfirmAmount);
dataRow.createCell(13).setCellValue(verifyComplianceAmount);
dataRow.createCell(14).setCellValue(verifyNonComplianceAmount);
double verifyCount = verifyNotStartedAmount + verifyToConfirmAmount + verifyComplianceAmount + verifyNonComplianceAmount;
double verifyPercentage = (verifyComplianceAmount / verifyCount) * 100;
Map<String,Object> taskToBeConfirmedMapVerify = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
double taskToBeConfirmedAmountVerify = (double) taskToBeConfirmedMapVerify.get("amount");
Map<String,Object> resultsToBeSubmittedMapVerify = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
double resultsToBeSubmittedAmountVerify = (double) resultsToBeSubmittedMapVerify.get("amount");
Map<String,Object> resultsToBeReviewedMapVerify = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
double resultsToBeReviewedAmountVerify = (double) resultsToBeReviewedMapVerify.get("amount");
Map<String,Object> complianceMapVerify = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue());
double complianceAmountVerify = (double) complianceMapVerify.get("amount");
Map<String,Object> nonComplianceMapVerify = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.INCONFORMITY.getValue());
double nonComplianceAmountVerify = (double) nonComplianceMapVerify.get("amount");
Map<String,Object> toBeTrackedMapVerify = (Map<String, Object>) verifyMap.get(ComplianceFlowStatusEnum.TO_TRACK.getValue());
double toBeTrackedAmountVerify = (double) toBeTrackedMapVerify.get("amount");
dataRow.createCell(20).setCellValue(taskToBeConfirmedAmountVerify);
dataRow.createCell(21).setCellValue(resultsToBeSubmittedAmountVerify);
dataRow.createCell(22).setCellValue(resultsToBeReviewedAmountVerify);
dataRow.createCell(23).setCellValue(complianceAmountVerify);
dataRow.createCell(24).setCellValue(nonComplianceAmountVerify);
dataRow.createCell(25).setCellValue(toBeTrackedAmountVerify);
double verifyCount = taskToBeConfirmedAmountVerify + resultsToBeSubmittedAmountVerify + resultsToBeReviewedAmountVerify
+ complianceAmountVerify + nonComplianceAmountVerify + toBeTrackedAmountVerify;
double verifyPercentage = (complianceAmountVerify / verifyCount) * 100;
String verifyPercentageStr = (verifyPercentage != 0 && (verifyCount !=0 )) ? df.format(verifyPercentage) : "0";
dataRow.createCell(15).setCellValue(verifyPercentageStr + percentSign);
dataRow.createCell(26).setCellValue(verifyPercentageStr + percentSign);
}
/**
@@ -2835,50 +2951,52 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
* @param params
*/
private void exportCertificationManagement(HSSFWorkbook workbook,Map<String,Object> params){
String cut = (String) params.get("cut");
// String cut = (String) params.get("cut");
// String sheetName = "认证活动管理";
// String firstTitle = "认证任务确认," +
// "Pre-Homo," +
// "认证进度";
// "Pre-Homo";
// String secondTitle = "责任领域(一级)," +
// "未发起,待确认,接受,拒绝,完成度," +
// "未发起,待确认,审查通过,审查退回,完成度," +
// "开始,进行中,实验通过,实验失败,部件报告未上传,部件报告已上传,部件报告已入库,完成度";
// "未发起,待提交,审查通过,审查退回,完成度";
//// "发起,待确认,审查通过,审查退回,完成度";
// if(StringUtils.equals(cut,CutEnum.EN.getValue())){
// sheetName = "Certification Activity Management";
// firstTitle = "Authentication task confirmation," +
// "Pre-Homo," +
// "Certification progress";
// "Pre-Homo";
// secondTitle = "Area of responsibility (level 1)," +
// "Not launched,To be confirmed,Accept,Refuse,Degree of completion," +
// "Not launched,To be confirmed,Review of the adoption,Review return,Degree of completion," +
// "Not started,In progress,Experiment passed,Experiment failed,Parts report not uploaded,Parts report uploaded,Parts report in stock,Degree of completion";
// "Not launched,To submit,Review of the adoption,Review return,Degree of completion";
//// "Not launched,To be confirmed,Review of the adoption,Review return,Degree of completion";
// }
String cut = (String) params.get("cut");
String sheetName = "认证活动管理";
String firstTitle = "认证任务确认," +
"Pre-Homo";
"Pre-Homo流程," +
"认证进度";
String secondTitle = "责任领域(一级)," +
"发起,待确认,接受,拒绝,完成度," +
"未发起,待提交,审查通过,审查退回,完成度";
// "发起,待确认,审查通过,审查退回,完成度";
"清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度," +
"任务待确认,结果待提交,结果待审查,审查通过,审查退回,完成度," +
"开始,进行中,实验通过,实验失败,完成度";
if(StringUtils.equals(cut,CutEnum.EN.getValue())){
sheetName = "Certification Activity Management";
firstTitle = "Authentication task confirmation," +
"Pre-Homo";
firstTitle = "Authentication Task Confirmation," +
"Pre-Homo Process," +
"Certification Progress";
secondTitle = "Area of responsibility (level 1)," +
"Not launched,To be confirmed,Accept,Refuse,Degree of completion," +
"Not launched,To submit,Review of the adoption,Review return,Degree of completion";
// "Not launched,To be confirmed,Review of the adoption,Review return,Degree of completion";
"List To Be Released,Task To Be Initiated,Task To Be Confirmed,Accepted Of Responsible Person,Refusal Of Responsible Person,Degree Of Completion," +
"Task To Be Confirmed,Results To Be Submitted,Results To Be Reviewed,Review And Pass,Review And Return,Degree Of Completion," +
"Not Started,In Progress,Experiment Passed,Experiment Failed,Degree Of Completion";
}
HSSFSheet sheet = workbook.createSheet(sheetName);
//合并单元格 起始行结束行起始列结束列
CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5);
CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 6);
sheet.addMergedRegion(region1);
CellRangeAddress region2 = new CellRangeAddress(0, 0, 6, 10);
CellRangeAddress region2 = new CellRangeAddress(0, 0, 7, 12);
sheet.addMergedRegion(region2);
CellRangeAddress region3 = new CellRangeAddress(0, 0, 13, 17);
// CellRangeAddress region3 = new CellRangeAddress(0, 0, 11, 18);
// sheet.addMergedRegion(region3);
sheet.addMergedRegion(region3);
// CellRangeAddress region4 = new CellRangeAddress(0, 0, 19, 23);
// sheet.addMergedRegion(region4);
@@ -2889,15 +3007,15 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
CellStyle cellStyleTitle = workbook.createCellStyle();
cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);
for (int i = 0; i <= 10; i++){
for (int i = 0; i <= 17; i++){
sheet.setColumnWidth(i, 3500);
Cell firstRowCell = firstRow.createCell(i);
firstRowCell.setCellStyle(cellStyleTitle);
if(i == 1){
firstRowCell.setCellValue(firstTitleArr[0]);
}else if(i==6){
}else if(i==7){
firstRowCell.setCellValue(firstTitleArr[1]);
}else if(i==11){
}else if(i==13){
firstRowCell.setCellValue(firstTitleArr[2]);
}
// else if(i==19){
@@ -2971,40 +3089,49 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
dataRow.createCell(0).setCellValue(key);
Map<String, Object> taskConfirmMap = this.projectLibraryStatisticsService.getRZTaskToConfirmStatisticsGroupByTerritory(pciEoList, params);
Map<String,Object> taskConfirmNotStartedMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue());
double taskConfirmNotStartedAmount = (double) taskConfirmNotStartedMap.get("amount");
Map<String,Object> taskConfirmToConfirmMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
double taskConfirmToConfirmAmount = (double) taskConfirmToConfirmMap.get("amount");
Map<String,Object> taskConfirmAcceptedMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.ACCEPTED.getValue());
double taskConfirmAcceptedAmount = (double) taskConfirmAcceptedMap.get("amount");
Map<String,Object> taskConfirmRejectedMap = (Map<String, Object>) taskConfirmMap.get(TaskAffirmStatusEnum.REJECTED.getValue());
double taskConfirmRejectedAmount = (double) taskConfirmRejectedMap.get("amount");
dataRow.createCell(1).setCellValue(taskConfirmNotStartedAmount);
dataRow.createCell(2).setCellValue(taskConfirmToConfirmAmount);
dataRow.createCell(3).setCellValue(taskConfirmAcceptedAmount);
dataRow.createCell(4).setCellValue(taskConfirmRejectedAmount);
double taskConfirmCount = taskConfirmNotStartedAmount + taskConfirmToConfirmAmount + taskConfirmAcceptedAmount + taskConfirmRejectedAmount;
double taskConfirmPercentage = (taskConfirmAcceptedAmount / taskConfirmCount) * 100;
Map<String,Object> taskListToBeReleasedMap = (Map<String, Object>) taskConfirmMap.get(CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
double taskListToBeReleasedAmount = (double) taskListToBeReleasedMap.get("amount");
Map<String,Object> taskToBeInitiatedMap = (Map<String, Object>) taskConfirmMap.get(CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
double taskToBeInitiatedAmount = (double) taskToBeInitiatedMap.get("amount");
Map<String,Object> taskToBeConfirmedMap = (Map<String, Object>) taskConfirmMap.get(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
double taskToBeConfirmedAmount = (double) taskToBeConfirmedMap.get("amount");
Map<String,Object> taskAcceptedMap = (Map<String, Object>) taskConfirmMap.get(CertificationInventoryFlowStatusEnum.ACCEPTED_OF_RESPONSIBLE_PERSON.getValue());
double taskAcceptedAmount = (double) taskAcceptedMap.get("amount");
Map<String,Object> taskRejectedMap = (Map<String, Object>) taskConfirmMap.get(CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue());
double taskRejectedAmount = (double) taskRejectedMap.get("amount");
dataRow.createCell(1).setCellValue(taskListToBeReleasedAmount);
dataRow.createCell(2).setCellValue(taskToBeInitiatedAmount);
dataRow.createCell(3).setCellValue(taskToBeConfirmedAmount);
dataRow.createCell(4).setCellValue(taskAcceptedAmount);
dataRow.createCell(5).setCellValue(taskRejectedAmount);
double taskConfirmCount = taskListToBeReleasedAmount + taskToBeInitiatedAmount + taskToBeConfirmedAmount +taskAcceptedAmount+ taskRejectedAmount;
double taskConfirmPercentage = (taskAcceptedAmount / taskConfirmCount) * 100;
String taskConfirmPercentageStr = (taskConfirmPercentage != 0 && (taskConfirmCount !=0 )) ? df.format(taskConfirmPercentage) : "0";
dataRow.createCell(5).setCellValue(taskConfirmPercentageStr + percentSign);
dataRow.createCell(6).setCellValue(taskConfirmPercentageStr + percentSign);
Map<String, Object> prehomoMap = this.projectLibraryStatisticsService.getPrehomoStatisticeGroupByTerritory(pciEoList, params);
Map<String, Object> prehomoNotStartedMap = (Map<String, Object>) prehomoMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue());
double prehomoNotStartedAmount = (double) prehomoNotStartedMap.get("amount");
Map<String, Object> prehomoToConfirmMap = (Map<String, Object>) prehomoMap.get(TodoCenterStatusEnum.TO_SUBMIT.getValue());
double prehomoToConfirmAmount = (double) prehomoToConfirmMap.get("amount");
Map<String, Object> prehomoAcceptedMap = (Map<String, Object>) prehomoMap.get(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
double prehomoAcceptedAmount = (double) prehomoAcceptedMap.get("amount");
Map<String, Object> prehomoRejectedMap = (Map<String, Object>) prehomoMap.get(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
double prehomoRejectedAmount = (double) prehomoRejectedMap.get("amount");
dataRow.createCell(6).setCellValue(prehomoNotStartedAmount);
dataRow.createCell(7).setCellValue(prehomoToConfirmAmount);
dataRow.createCell(8).setCellValue(prehomoAcceptedAmount);
dataRow.createCell(9).setCellValue(prehomoRejectedAmount);
double prehomoCount = prehomoNotStartedAmount + prehomoToConfirmAmount + prehomoAcceptedAmount + prehomoRejectedAmount;
double prehomoPercentage = (prehomoAcceptedAmount / prehomoCount) * 100;
Map<String, Object> prehomoTaskToBeConfirmedMap = (Map<String, Object>) prehomoMap.get(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
double prehomoTaskToBeConfirmedAmount = (double) prehomoTaskToBeConfirmedMap.get("amount");
Map<String, Object> prehomoResultsToBeSubmittedMap = (Map<String, Object>) prehomoMap.get(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
double prehomoResultsToBeSubmittedAmount = (double) prehomoResultsToBeSubmittedMap.get("amount");
Map<String, Object> prehomoResultsToBeReviewedMap = (Map<String, Object>) prehomoMap.get(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
double prehomoResultsToBeReviewedAmount = (double) prehomoResultsToBeReviewedMap.get("amount");
Map<String, Object> prehomoReviewAndPassMap = (Map<String, Object>) prehomoMap.get(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
double prehomoReviewAndPassAmount = (double) prehomoReviewAndPassMap.get("amount");
Map<String, Object> prehomoReviewAndReturnMap = (Map<String, Object>) prehomoMap.get(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
double prehomoReviewAndReturnAmount = (double) prehomoReviewAndReturnMap.get("amount");
dataRow.createCell(7).setCellValue(prehomoTaskToBeConfirmedAmount);
dataRow.createCell(8).setCellValue(prehomoResultsToBeSubmittedAmount);
dataRow.createCell(9).setCellValue(prehomoResultsToBeReviewedAmount);
dataRow.createCell(10).setCellValue(prehomoReviewAndPassAmount);
dataRow.createCell(11).setCellValue(prehomoReviewAndReturnAmount);
double prehomoCount = prehomoTaskToBeConfirmedAmount + prehomoResultsToBeSubmittedAmount + prehomoResultsToBeReviewedAmount
+ prehomoReviewAndPassAmount + prehomoReviewAndReturnAmount;
double prehomoPercentage = (prehomoReviewAndPassAmount / prehomoCount) * 100;
String prehomoPercentageStr = (prehomoPercentage != 0 && (prehomoCount !=0 )) ? df.format(prehomoPercentage) : "0";
dataRow.createCell(10).setCellValue(prehomoPercentageStr + percentSign);
dataRow.createCell(12).setCellValue(prehomoPercentageStr + percentSign);
Map<String, Object> certificationProgressMap = this.projectLibraryStatisticsService.getPartCertificationProgressStatisticsGroupByTerritory(pciEoList, params);
Map<String, Object> certificationProgressNotStartMap = (Map<String, Object>)certificationProgressMap.get(CertificationProgressEnum.NOT_START.getValue());
@@ -3015,26 +3142,15 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
double certificationProgressTestPassedAmount = (double) certificationProgressTestPassedMap.get("amount");
Map<String, Object> certificationProgressTestFailedMap = (Map<String, Object>)certificationProgressMap.get(CertificationProgressEnum.TEST_FAILED.getValue());
double certificationProgressTestFailedAmount = (double) certificationProgressTestFailedMap.get("amount");
Map<String, Object> certificationProgressNotSubmitMap = (Map<String, Object>)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue());
double certificationProgressNotSubmitAmount = (double) certificationProgressNotSubmitMap.get("amount");
Map<String, Object> certificationProgressSubmitMap = (Map<String, Object>)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue());
double certificationProgressSubmitAmount = (double) certificationProgressSubmitMap.get("amount");
Map<String, Object> certificationProgressStoredMap = (Map<String, Object>)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue());
double certificationProgressStoredAmount = (double) certificationProgressStoredMap.get("amount");
// dataRow.createCell(11).setCellValue(certificationProgressNotStartAmount);
// dataRow.createCell(12).setCellValue(certificationProgressInProgressAmount);
// dataRow.createCell(13).setCellValue(certificationProgressTestPassedAmount);
// dataRow.createCell(14).setCellValue(certificationProgressTestFailedAmount);
// dataRow.createCell(15).setCellValue(certificationProgressNotSubmitAmount);
// dataRow.createCell(16).setCellValue(certificationProgressSubmitAmount);
// dataRow.createCell(17).setCellValue(certificationProgressStoredAmount);
dataRow.createCell(13).setCellValue(certificationProgressNotStartAmount);
dataRow.createCell(14).setCellValue(certificationProgressInProgressAmount);
dataRow.createCell(15).setCellValue(certificationProgressTestPassedAmount);
dataRow.createCell(16).setCellValue(certificationProgressTestFailedAmount);
double certificationProgressCount = certificationProgressNotStartAmount + certificationProgressInProgressAmount
+ certificationProgressTestPassedAmount + certificationProgressTestFailedAmount
+ certificationProgressNotSubmitAmount + certificationProgressSubmitAmount
+ certificationProgressStoredAmount;
+ certificationProgressTestPassedAmount + certificationProgressTestFailedAmount;
double certificationProgressPercentage = (certificationProgressTestPassedAmount / certificationProgressCount) * 100;
String certificationProgressPercentageStr = (certificationProgressPercentage != 0 && (certificationProgressCount !=0 )) ? df.format(certificationProgressPercentage) : "0";
// dataRow.createCell(18).setCellValue(certificationProgressPercentageStr + percentSign);
dataRow.createCell(17).setCellValue(certificationProgressPercentageStr + percentSign);
}
/**
@@ -3551,6 +3667,106 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
}
return res;
}
/**
* 平台被哪些法规引用
*
* @return
*/
@Override
public List<ProjectLawsInventoryEO> queryQuoteList(String platformLawsInventoryId,String cut) {
if(StringUtils.isBlank(platformLawsInventoryId)){
return new ArrayList<>();
}
LambdaQueryWrapper<LawsInventoryPlatformEO> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsInventoryPlatformEO::getPlatformLawsInventoryId,platformLawsInventoryId);
List<LawsInventoryPlatformEO> inventoryPlatformEOList = lawsInventoryPlatformEOService.list(wrapper);
List<ProjectLawsInventoryEO> lawsInventoryEOList = new ArrayList<>();
if(ObjectUtils.isNotEmpty(inventoryPlatformEOList)){
//树形结构数据字典(技术领域)
List<SysCategory> categoryList = sysCategoryService.list();
List<String> lawsInventoryIdIdList = inventoryPlatformEOList.stream().map(LawsInventoryPlatformEO::getLawsInventoryId).distinct().collect(Collectors.toList());
LambdaQueryWrapper<ProjectLawsInventoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ProjectLawsInventoryEO::getId,lawsInventoryIdIdList);
queryWrapper.orderByDesc(ProjectLawsInventoryEO::getProjectLibraryId);
lawsInventoryEOList = projectLawsInventoryEOService.list(queryWrapper);
List<String> projectLibraryIdList = lawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
List<ProjectLibraryBase> projectLibraryBaseList = platformProjectLibraryBaseMapper.getListByIds(projectLibraryIdList);
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
//目标市场
String targetMarket = DictItemUtil.getDictItemText(cut,projectLibraryBase.getTargetMarket(),targetMarketList);
projectLibraryBase.setTargetMarketName(targetMarket);
String projectName = projectLibraryBase.getProjectName()+"-"
+projectLibraryBase.getYearName()+"-"
+targetMarket+"-"
+projectLibraryBase.getProjectVersion();
projectLibraryBase.setProjectName(projectName);
}
List<String> collect1 = lawsInventoryEOList.stream().filter(e-> org.apache.commons.lang3.StringUtils.isNotBlank(e.getDesignDeliverableTemplate())).map(ProjectLawsInventoryEO::getDesignDeliverableTemplate).distinct().collect(Collectors.toList());
List<String> collect2 = lawsInventoryEOList.stream().filter(e-> org.apache.commons.lang3.StringUtils.isNotBlank(e.getVerifyDeliverableTemplate())).map(ProjectLawsInventoryEO::getVerifyDeliverableTemplate).distinct().collect(Collectors.toList());
List<String> fileIdList = new ArrayList<>();
if(!collect1.isEmpty()){
fileIdList.addAll(collect1);
}
if(!collect2.isEmpty()){
fileIdList.addAll(collect2);
}
//文件
List<OSSFile> fileInfos = new ArrayList<>();
if (fileIdList.size() != 0) {
fileInfos = iOSSFileService.getFileInfos(org.apache.commons.lang3.StringUtils.join(fileIdList, ","));
}
for (ProjectLawsInventoryEO projectLawsInventoryEO : lawsInventoryEOList) {
//项目名称
List<ProjectLibraryBase> collect = projectLibraryBaseList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getProjectLibraryId())).collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
projectLawsInventoryEO.setProjectName(collect.get(0).getProjectName());
}
//设计
String designDeliverableType = projectLawsInventoryEO.getDesignDeliverableType();//交付物类型
String designDeliverableTemplate = projectLawsInventoryEO.getDesignDeliverableTemplate();//交付物模板
//验证
String verifyDeliverableType = projectLawsInventoryEO.getVerifyDeliverableType();//交付物类型
String verifyDeliverableTemplate = projectLawsInventoryEO.getVerifyDeliverableTemplate();//交付物模板
//设计交付物类型
if (org.apache.commons.lang3.StringUtils.isNotBlank(designDeliverableType)) {
List<String> designDeliverableTypeList = Arrays.asList(designDeliverableType.split(","));
String name = projectLawsInventoryEOService.getTreeName(cut, categoryList, designDeliverableTypeList);
projectLawsInventoryEO.setDesignDeliverableTypeName(name);
}
//验证交付物类型
if (org.apache.commons.lang3.StringUtils.isNotBlank(verifyDeliverableType)) {
List<String> verifyDeliverableTypeList = Arrays.asList(verifyDeliverableType.split(","));
String name = projectLawsInventoryEOService.getTreeName(cut, categoryList, verifyDeliverableTypeList);
projectLawsInventoryEO.setVerifyDeliverableTypeName(name);
}
//交付物类型模板
if (fileInfos.size() != 0) {
if (org.apache.commons.lang3.StringUtils.isNotBlank(designDeliverableTemplate)) {
String fileName = this.editService.getFileName(null, fileInfos, designDeliverableTemplate);
if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) {
projectLawsInventoryEO.setDesignDeliverableTemplateName(fileName);
}
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(verifyDeliverableTemplate)) {
String fileName = this.editService.getFileName(null, fileInfos, verifyDeliverableTemplate);
if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) {
projectLawsInventoryEO.setVerifyDeliverableTemplateName(fileName);
}
}
}
}
}
return lawsInventoryEOList;
}
}
@@ -354,4 +354,10 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
public Result<?> overallReplacementUser(@RequestBody JSONObject json){
return this.projectLibraryBaseService.overallReplacementUser(json);
}
@AutoLog(value = "查询数字平台或车型平台")
@ApiOperation(value="查询数字平台或车型平台", notes="查询数字平台或车型平台")
@GetMapping(value = "/getPlatform")
public List<String> getPlatform(String platform){
return projectLibraryBaseService.getPlatform(platform);
}
}
@@ -61,7 +61,9 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
(String) map.get("engineeringInterfacePerson"),
(String) map.get("engineerLawSet"),
(String) map.get("engineerAttSet"),
(String) map.get("firstLevelDutyTerritory"));
(String) map.get("firstLevelDutyTerritory"),
(String) map.get("orderBy"),
(String) map.get("orderByField"));
return Result.OK((String)map.get("cut"),pageList);
}
/**
@@ -99,6 +99,13 @@ public class ProblemManagementEO implements Serializable {
@ApiModelProperty(value = "问题状态")
private java.lang.String problemState;
/**问题优先级*/
@Excel(name = "*问题优先级", width = 15,dicCode ="wen4_ti2_you1_xian1_ji2")
@ApiModelProperty(value = "问题优先级")
private java.lang.String problemPriority;
@TableField(exist = false)
private String problemPriority_dictText;
/**描述和分析*/
@Excel(name = "描述和分析", width = 15)
@ApiModelProperty(value = "描述和分析")
@@ -168,4 +175,9 @@ public class ProblemManagementEO implements Serializable {
@ApiModelProperty(value = "旧数据->old,新数据->new")
private String flag;
@ApiModelProperty(value = "相关项目类型")
private String projectType;
}
@@ -266,6 +266,9 @@ public class ProjectLibraryBase implements Comparable<ProjectLibraryBase> {
@TableField(exist = false)
private List<String> urlList;
@ApiModelProperty(value = "平台件类型")
private String platformType;
@Override
public int compareTo(ProjectLibraryBase o) {
@@ -43,6 +43,8 @@ public class ProjectRelatedPersonnel implements Serializable {
@Excel(name = "责任领域,Responsible Field", width = 15,orderNum = "1",dicCode = "duty_territory")
@Dict(dicCode = "duty_territory")
private java.lang.String dutyTerritory;
@TableField(exist = false)
private java.lang.String dutyTerritoryName;
/**法规工程师*/
private java.lang.String lawEngineer;
@@ -29,6 +29,7 @@ public enum CertificationInventoryFlowStatusEnum {
CERTIFICATION_RETURNED("认证退回","Certification returned","Certification returned"),
TASK_TO_BE_CONFIRMED("任务待确认","Task to be confirmed","Task to be confirmed"),
REFUSAL_OF_RESPONSIBLE_PERSON("责任人拒绝","Refusal of responsible person","Refusal of responsible person"),
ACCEPTED_OF_RESPONSIBLE_PERSON("责任人接受","Accepted of responsible person","Accepted of responsible person"),
RESULTS_TO_BE_SUBMITTED("结果待提交","Results to be submitted","Results to be submitted"),
//ENGINEER_RETURN("工程师退回","Engineer return","Engineer return"),
RESULTS_TO_BE_REVIEWED("结果待审查","Results to be reviewed","Results to be reviewed"),
@@ -9,8 +9,9 @@ import org.apache.commons.lang.StringUtils;
public enum ComplianceFlowStatusEnum {
LIST_TO_BE_RELEASED("清单待发布","List to be released","List to be released"),
LIST_TO_BE_CHECKED("任务待发起","Task to be initiated","List to be checked"),
REGULATORY_ENGINEER_RETURNS("法规工程师退回","Regulatory engineer returns","Regulatory engineer returns"),
REGULATORY_ENGINEER_RETURNS("法规退回","Regulatory engineer returns","Regulatory engineer returns"),
DUTY_PERSON_REJECTED("责任人拒绝","Rejected by the responsible person","Duty Person Rejected"),
DUTY_PERSON_ACCEPTED("责任人接受","Accepted by the responsible person","Duty Person Accepted"),
TASK_TO_BE_CONFIRMED("任务待确认","Task to be confirmed","Task to be confirmed"),
RESULTS_TO_BE_SUBMITTED("结果待提交","Results to be submitted","Results to be submitted"),
RESULTS_TO_BE_REVIEWED("结果待审查","Results to be reviewed","Results to be reviewed"),
@@ -13,7 +13,7 @@ public enum FlowStateEnum {
UNINVOLVED("不涉及","NA","NA"),
LIST_TO_BE_RELEASED("清单待发布","List to be released","List to be released"),
LIST_TO_BE_CHECKED("任务待发起","Task to be initiated","List to be checked"),
REGULATORY_ENGINEER_RETURNS("法规工程师退回","Regulatory engineer returns","Regulatory engineer returns"),
REGULATORY_ENGINEER_RETURNS("法规退回","Regulatory engineer returns","Regulatory engineer returns"),
REFUSAL_OF_RESPONSIBLE_PERSON("责任人拒绝","Refusal of responsible person","Duty Person Rejected"),
TASK_TO_BE_CONFIRMED("任务待确认","Task to be confirmed","Task to be confirmed"),
RESULTS_TO_BE_SUBMITTED("结果待提交","Results to be submitted","Results to be submitted"),
@@ -43,6 +43,8 @@ public enum OperatorTypeEnum {
QUERY_CERTIFICATION_PROGRESS_STATISTICS_ALL("查询认证进度统计-全部","queryCertificationProgressStatisticsAll"),
QUERY_CERTIFICATION_PROGRESS_STATISTICS_CAR("查询认证进度统计-整车","queryCertificationProgressStatisticsCar"),
QUERY_CERTIFICATION_PROGRESS_STATISTICS_PART("查询认证进度统计-零部件","queryCertificationProgressStatisticsPart"),
QUERY_DESIGN_TASK_CONFIRMATION("查询设计任务确认统计","queryDesignTaskConfirmation"),
QUERY_VERIFICATION_TASK_CONFIRMATION("查询验证任务确认统计","queryVerificationTaskConfirmation"),
ADD_LAWS_OPINION_GATHER("添加法规意见收集数据","addLawsOpinionGather"),
UPDATE_LAWS_OPINION_GATHER_GATHER_RESULT("更新法规意见收集数据收集结果","updateLawsOpinionGatherGatherResult"),
@@ -0,0 +1,45 @@
package com.jero.modules.project.enums;
/**
* 任务状态枚举类
*/
public enum PlatformEnum {
NUMBER_PLATFORM("数字平台","numberPlatform"),
CAR_PLATFORM("车型平台","carPlatform"),
;
String name;
String value;
private PlatformEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static String getTextByValue(String value) {
PlatformEnum[] values = values();
for (PlatformEnum taskStatusEnum : values) {
if (taskStatusEnum.value.equals(value)) {
return taskStatusEnum.name;
}
}
return null;
}
}
@@ -76,7 +76,7 @@
</if>
AND sd.dict_code = #{dictCode}
</where>
ORDER BY sdi.item_text ASC
ORDER BY sdi.sort_order ASC
</select>
<select id="queryById" resultType="com.jero.modules.project.entity.ProjectRelatedPersonnel">
@@ -264,7 +264,21 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
* @param projectLawsInventoryEOList
* @return
*/
List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
// List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
/**
* 设计任务确认
* @param projectLawsInventoryEOList
* @return
*/
List<Map<String, Object>> getDesignTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
/**
* 验证任务确认
* @param projectLawsInventoryEOList
* @return
*/
List<Map<String, Object>> getVerifyTaskToConfirmStatistics(List<ProjectLawsInventoryEO> projectLawsInventoryEOList);
/**
* 获取设计符合性统计信息
@@ -291,6 +305,20 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
*/
Map<String, Object> groupByFGRwqrStatus(List<ProjectLawsInventoryEO> pliEos);
/**
* 设计认为确认
* @param pliEos
* @return
*/
Map<String, Object> groupByFGRwqrStatusDesign(List<ProjectLawsInventoryEO> pliEos);
/**
* 验证认为确认
* @param pliEos
* @return
*/
Map<String, Object> groupByFGRwqrStatusVerify(List<ProjectLawsInventoryEO> pliEos);
/**
* 按照设计符合性状态分组
* @param pliEos
@@ -204,4 +204,6 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
List<ProjectLibraryBase> queryList(List<String> projectIdList);
List<ProjectLibraryBase> getListByIds(List<String> projectIdList);
List<String> getPlatform(String platform);
}
@@ -19,6 +19,38 @@ public interface IProjectLibraryStatisticsService {
*/
Map<String, Object> getFGTaskToConfirmStatisticsGroupByTerritory(List<ProjectLawsInventoryEO> datas, Map<String, Object> params);
/**
* 获取法规清单-法规符合性管理-设计任务确认-根据责任领域分组
* @param datas
* @param params
* @return
*/
Map<String, Object> getDesignToConfirmStatisticsGroupByTerritory(List<ProjectLawsInventoryEO> datas, Map<String, Object> params);
/**
*获取法规清单-法规符合性管理-验证任务确认-根据责任领域分组
* @param datas
* @param params
* @return
*/
Map<String, Object> getVerifyToConfirmStatisticsGroupByTerritory(List<ProjectLawsInventoryEO> datas, Map<String, Object> params);
/**
* 法规符合性管理--设计
* @param datas
* @param params
* @return
*/
Map<String, Object> getFGTaskToConfirmStatisticsGroupByTerritoryDesign(List<ProjectLawsInventoryEO> datas, Map<String, Object> params);
/**
* 法规符合性管理--验证
* @param datas
* @param params
* @return
*/
Map<String, Object> getFGTaskToConfirmStatisticsGroupByTerritoryVerify(List<ProjectLawsInventoryEO> datas, Map<String, Object> params);
/**
* 获取设计符合性确认流程统计信息-根据责任领域分组
* @param datas
@@ -73,9 +105,9 @@ public interface IProjectLibraryStatisticsService {
* @param params
* @return
*/
Map<String, Object> getPartCertificationProgressStatisticsGroupByTerritory(List<ProjectCertificationInventoryEO> datas, Map<String, Object> params);
// Map<String, Object> getPartCertificationProgressStatisticsGroupByTerritory(List<ProjectCertificationInventoryEO> datas, Map<String, Object> params);
Map<String, Object> getPartCertificationProgressStatisticsGroupByTerritoryTemp(List<ProjectCertificationInventoryEO> datas, Map<String, Object> params);
Map<String, Object> getPartCertificationProgressStatisticsGroupByTerritory(List<ProjectCertificationInventoryEO> datas, Map<String, Object> params);
/**
* 获取认证参数收集-统计信息
@@ -3,7 +3,6 @@ package com.jero.modules.project.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.system.entity.SysDictItem;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
@@ -71,7 +70,15 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
List<ProjectRelatedPersonnel> queryList();
// List<ProjectRelatedPersonnel> queryPageList(String projectId,String dutyTerritory,String lawEngineer,String engineeringInterfacePerson,String certificationEngineer);
List<ProjectRelatedPersonnel> queryPageList(String projectId,String dutyTerritory,String lawEngineer,String engineeringInterfacePerson,String engineerLawSet,String engineerAttSet,String firstLevelDutyTerritory);
List<ProjectRelatedPersonnel> queryPageList(String projectId,
String dutyTerritory,
String lawEngineer,
String engineeringInterfacePerson,
String engineerLawSet,
String engineerAttSet,
String firstLevelDutyTerritory,
String orderBy,
String orderByField);
Map<String,Object> queryPersonByProjectId(String projectId, String dutyTerritory);
@@ -552,6 +552,7 @@ public class ProjectLawsInventoryEOEditServiceImpl {
String projectLibraryId = null;
if (CollectionUtils.isNotEmpty(infoEOList)) {
projectLibraryId = infoEOList.get(0).getProjectLibraryId();
projectLawsInventoryEO.setProjectLibraryId(projectLibraryId);
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(projectLawsInventoryEO.getIds())) {
@@ -116,20 +116,6 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
public List<NcrTrackVO> getPageInfo(NcrTrackVO ncrTrackVO) {
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ncrTrackVO.setUserId(loginUser.getId());
// if(StringUtils.isNotBlank(ncrTrackVO.getSerialNumber())){
// if(ncrTrackVO.getSerialNumber().contains("%")){
// ncrTrackVO.setSerialNumber(ncrTrackVO.getSerialNumber().replaceAll("%", "/%"));
// }
// ncrTrackVO.setSerialNumber(ncrTrackVO.getSerialNumber().replace("*",""));
// }
// if(StringUtils.isNotBlank(ncrTrackVO.getTitle())){
// if(ncrTrackVO.getTitle().contains("%")){
// ncrTrackVO.setTitle(ncrTrackVO.getTitle().replace("%","/%"));
// }
// ncrTrackVO.setTitle(ncrTrackVO.getTitle().replace("*",""));
// }
// List<SysUser> sysUserList = sysUserService.list();
ncrTrackVO.setInconformity(ReviewResultEnum.INCONFORMITY.getValue());
ncrTrackVO.setTrack(ReviewResultEnum.TO_TRACK.getValue());
@@ -201,7 +187,6 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
trackVO.setProjectName(projectName+"-"+yearName+"-"+market);
}
}
//责任领域中英文切换
if(StringUtils.isNotBlank(trackVO.getDutyTerritory())){
String dutyTerritory = pull(dictItemList, trackVO.getDutyTerritory(), "duty_territory", ncrTrackVO.getCut());
@@ -683,10 +668,12 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
}
//wen4_ti2_lei4_xing2 问题类型
List<DictModel> problemTypeList = sysDictService.queryDictItemsByCode(DicCodeEnum.PROBLEM_TYPE.getCode());
List<DictModel> problemPriorityList = sysDictService.queryDictItemsByCode(DicCodeEnum.PROBLEM_PRIORITY.getCode());
List<NcrTrackVO> ncrTrackVOList = new ArrayList<>();
for (ProblemManagementEO problemManagementEO : managementEOList) {
//问题类型
List<DictModel> dictModelList = problemTypeList.stream().filter(e -> e.getValue().equals(problemManagementEO.getProblemType())).collect(Collectors.toList());
List<DictModel> dictModelListPp = problemPriorityList.stream().filter(e -> e.getValue().equals(problemManagementEO.getProblemPriority())).collect(Collectors.toList());
if(!dictModelList.isEmpty()){
if(CutEnum.CN.getValue().equals(cut)){
@@ -695,6 +682,13 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
problemManagementEO.setProblemType_dictText(dictModelList.get(0).getTextEn());
}
}
if(!dictModelListPp.isEmpty()){
if(CutEnum.CN.getValue().equals(cut)){
problemManagementEO.setProblemPriority_dictText(dictModelListPp.get(0).getText());
}else{
problemManagementEO.setProblemPriority_dictText(dictModelListPp.get(0).getTextEn());
}
}
//相关法规
if(StringUtils.isNotBlank(problemManagementEO.getLawsId())){
@@ -16,6 +16,7 @@ import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.common.util.oss.CosBootUtil;
@@ -53,7 +54,6 @@ import com.jero.modules.project.enums.ProjectMessageEnum;
import com.jero.modules.project.enums.ProjectUserLocationEnum;
import com.jero.modules.project.enums.ReviewResultEnum;
import com.jero.modules.project.enums.RoleRelModelTypeEnum;
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
import com.jero.modules.project.enums.TaskStatusEnum;
import com.jero.modules.project.mapper.ProjectCertificationInventoryEOMapper;
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
@@ -70,6 +70,7 @@ import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysRole;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.enums.DicCodeEnum;
import com.jero.modules.system.enums.ProjectRoleEnum;
import com.jero.modules.system.enums.SysCategoryValueTypeEnum;
import com.jero.modules.system.mapper.SysCategoryMapper;
@@ -79,11 +80,12 @@ import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.IProjectUserDutyTerritoryService;
import com.jero.modules.system.service.ISysCategoryService;
import com.jero.modules.system.service.ISysDictItemService;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.DictItemUtil;
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
@@ -205,6 +207,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
@Autowired
private ProjectLibraryBaseMapper projectLibraryBaseMapper;
@Autowired
private ISysDictService sysDictService;
@Value(value = "${jero.backUrl}")
@@ -1722,7 +1726,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.STUDIO_ENGINEER.getName());
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.STUDIO_ENGINEER.getCode());
sysRole.setRoleName(ProjectRoleEnum.STUDIO_ENGINEER.getEnName());
}
sysRoles.add(sysRole);
@@ -1735,14 +1739,14 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getName());
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getCode());
sysRole.setRoleName(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getEnName());
}
sysRoles.add(sysRole);
}
// 法规
//相关人员名单中取法规工程师
List<ProjectRelatedPersonnel> projectRelatedPersonnels = this.projectRelatedPersonnelService.queryPageList(projectLibraryId,null,null,null,null,null,null);
List<ProjectRelatedPersonnel> projectRelatedPersonnels = this.projectRelatedPersonnelService.queryPageList(projectLibraryId,null,null,null,null,null,null,null,null);
List<String> lawEngineerNameList = new ArrayList<>();
if(projectRelatedPersonnels.size() != 0){
for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnels) {
@@ -1759,7 +1763,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.REGULATI_ENGINEER.getName());
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.REGULATI_ENGINEER.getCode());
sysRole.setRoleName(ProjectRoleEnum.REGULATI_ENGINEER.getEnName());
}
sysRoles.add(sysRole);
}
@@ -1776,7 +1780,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.INTERFACE_PERSON.getName());
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.INTERFACE_PERSON.getCode());
sysRole.setRoleName(ProjectRoleEnum.INTERFACE_PERSON.getEnName());
}
sysRoles.add(sysRole);
}
@@ -1792,7 +1796,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.PERSON_LIABLE.getName());
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
sysRole.setRoleName(ProjectRoleEnum.PERSON_LIABLE.getCode());
sysRole.setRoleName(ProjectRoleEnum.PERSON_LIABLE.getEnName());
}
sysRoles.add(sysRole);
}
@@ -1825,22 +1829,22 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
if (manager.size() != 0) {
manager.get(0).setRoleCode(ProjectRoleEnum.MANAGER.getValue());
manager.get(0).setRoleName(ProjectRoleEnum.MANAGER.getCode());
manager.get(0).setRoleName(ProjectRoleEnum.MANAGER.getEnName());
sysRoles.addAll(manager);
}
if (admin.size() != 0) {
admin.get(0).setRoleCode(ProjectRoleEnum.ADMIN.getValue());
admin.get(0).setRoleName(ProjectRoleEnum.ADMIN.getCode());
admin.get(0).setRoleName(ProjectRoleEnum.ADMIN.getEnName());
sysRoles.addAll(admin);
}
if (Viewer.size() != 0) {
Viewer.get(0).setRoleCode(ProjectRoleEnum.VIEWER.getValue());
Viewer.get(0).setRoleName(ProjectRoleEnum.VIEWER.getCode());
Viewer.get(0).setRoleName(ProjectRoleEnum.VIEWER.getEnName());
sysRoles.addAll(Viewer);
}
if (brandAdministrator.size() != 0) {
brandAdministrator.get(0).setRoleCode(ProjectRoleEnum.BRAND_ADMINISTRATOR.getValue());
brandAdministrator.get(0).setRoleName(ProjectRoleEnum.BRAND_ADMINISTRATOR.getCode());
brandAdministrator.get(0).setRoleName(ProjectRoleEnum.BRAND_ADMINISTRATOR.getEnName());
sysRoles.addAll(brandAdministrator);
}
@@ -1930,7 +1934,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
IPage<ProjectCertificationInventoryEO> pageList = this.page(page, queryWrapper);
//平台件数据处理
platformDispose(projectCertificationInventoryEO, pageList.getRecords());
platformDispose(cut,projectCertificationInventoryEO, pageList.getRecords());
@@ -1939,9 +1943,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
pageList.setRecords(records);
return pageList;
}
private void platformDispose(ProjectCertificationInventoryEO projectCertificationInventoryEO, List<ProjectCertificationInventoryEO> result) {
private void platformDispose(String cut,ProjectCertificationInventoryEO projectCertificationInventoryEO, List<ProjectCertificationInventoryEO> result) {
List<LawsInventoryPlatformEO> lawsInventoryPlatformEOList = new ArrayList<>();
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOS = new ArrayList<>();
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
if(!result.isEmpty()){
//认证清单ID
@@ -1991,7 +1996,11 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream()
.filter(e -> certificationInventoryEOS.get(0).getProjectLibraryId().equals(e.getId())).collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(libraryBaseList)){
certificationInventoryEO.setConfigItem(libraryBaseList.get(0).getProjectNameId());
String dictItemText = DictItemUtil.getDictItemText(cut, libraryBaseList.get(0).getTargetMarket(), targetMarketList);
String configItem = libraryBaseList.get(0).getPlatformType() + "-" + libraryBaseList.get(0).getPower()+"-"+libraryBaseList.get(0).getProducer()+"-"+dictItemText;
certificationInventoryEO.setConfigItem(configItem);
// certificationInventoryEO.setConfigItem(libraryBaseList.get(0).getProjectNameId());
}
if(!certificationInventoryEOS.isEmpty()){
@@ -3276,28 +3285,36 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
public List<Map<String, Object>> getTaskToConfirmStatistics(List<ProjectCertificationInventoryEO> pciEoList) {
List<Map<String,Object>> result = new ArrayList<>();
int notStartedCount = 0;
int toConfirmCount = 0;
int acceptedCount = 0;
int rejectedCount = 0;
int listToBeReleasedCount = 0;//清单待发布
int taskToBeInitiatedCount = 0;//任务待发起
int taskToBeConfirmedCount = 0;//任务待确认
int acceptedCount = 0;//责任人接受
int rejectedCount = 0;//责任人拒绝
if(CollectionUtils.isNotEmpty(pciEoList)){
// 未发起
notStartedCount = (int) pciEoList.stream().filter(pciEo -> {
// 清单待发布
listToBeReleasedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
);
return flag;
}).count();
// 待确认
toConfirmCount = (int) pciEoList.stream().filter(pciEo -> {
// 任务待发起
taskToBeInitiatedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
);
return flag;
}).count();
// 任务待确认
taskToBeConfirmedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
);
return flag;
}).count();
// 接受
// 责任人接受
acceptedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
@@ -3307,7 +3324,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
);
return flag;
}).count();
// 拒绝
// 责任人拒绝
rejectedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())
@@ -3315,25 +3332,31 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).count();
}
Map<String,Object> notStartedMap = new HashMap<>();
Map<String,Object> toConfirmMap = new HashMap<>();
Map<String,Object> listToBeReleasedMap = new HashMap<>();
Map<String,Object> taskToBeInitiatedMap = new HashMap<>();
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();
Map<String,Object> acceptedMap = new HashMap<>();
Map<String,Object> rejectedMap = new HashMap<>();
notStartedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
notStartedMap.put("taskAffirmStatusCount",notStartedCount);
listToBeReleasedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
listToBeReleasedMap.put("taskAffirmStatusCount",listToBeReleasedCount);
toConfirmMap.put("taskAffirmStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
toConfirmMap.put("taskAffirmStatusCount",toConfirmCount);
taskToBeInitiatedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
taskToBeInitiatedMap.put("taskAffirmStatusCount",taskToBeInitiatedCount);
acceptedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.ACCEPTED.getValue());
taskToBeConfirmedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("taskAffirmStatusCount",taskToBeConfirmedCount);
acceptedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.ACCEPTED_OF_RESPONSIBLE_PERSON.getValue());
acceptedMap.put("taskAffirmStatusCount",acceptedCount);
rejectedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.REJECTED.getValue());
rejectedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue());
rejectedMap.put("taskAffirmStatusCount",rejectedCount);
result.add(notStartedMap);
result.add(toConfirmMap);
result.add(listToBeReleasedMap);
result.add(taskToBeInitiatedMap);
result.add(taskToBeConfirmedMap);
result.add(acceptedMap);
result.add(rejectedMap);
return result;
@@ -3343,13 +3366,15 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
public List<Map<String, Object>> getPrehomoStatistice(List<ProjectCertificationInventoryEO> pciEoList) {
List<Map<String,Object>> result = new ArrayList<>();
int notStartedCount = 0;
int toConfirmCount = 0;
int acceptedCount = 0;
int rejectedCount = 0;
int taskToBeConfirmedCount = 0;//任务待确认
int resultsToBeSubmittedCount = 0;//结果待提交
int resultsToBeReviewedCount = 0;//结果待审查
int reviewAndPassCount = 0;//审查通过
int reviewAndReturnCount = 0;//审查退回
if(CollectionUtils.isNotEmpty(pciEoList)){
// 未发起
notStartedCount = (int) pciEoList.stream().filter(pciEo -> {
// 任务待确认
taskToBeConfirmedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
@@ -3359,51 +3384,61 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
);
return flag;
}).count();
// 待确认
toConfirmCount = (int) pciEoList.stream().filter(pciEo -> {
// 结果待提交
resultsToBeSubmittedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
);
return flag;
}).count();
// 结果待审查
resultsToBeReviewedCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
);
return flag;
}).count();
// 审查通过
acceptedCount = (int) pciEoList.stream().filter(pciEo -> {
reviewAndPassCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue())
);
return flag;
}).count();
// 审查退回
rejectedCount = (int) pciEoList.stream().filter(pciEo -> {
reviewAndReturnCount = (int) pciEoList.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue())
);
return flag;
}).count();
}
Map<String,Object> notStartedMap = new HashMap<>();
Map<String,Object> toConfirmMap = new HashMap<>();
Map<String,Object> acceptedMap = new HashMap<>();
Map<String,Object> rejectedMap = new HashMap<>();
Map<String,Object> taskToBeConfirmedMap = new HashMap<>();
Map<String,Object> resultsToBeSubmittedMap = new HashMap<>();
Map<String,Object> resultsToBeReviewedMap = new HashMap<>();
Map<String,Object> reviewAndPassMap = new HashMap<>();
Map<String,Object> reviewAndReturnMap = new HashMap<>();
notStartedMap.put("taskAffirmStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue());
notStartedMap.put("taskAffirmStatusCount",notStartedCount);
taskToBeConfirmedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue());
taskToBeConfirmedMap.put("taskAffirmStatusCount",taskToBeConfirmedCount);
toConfirmMap.put("taskAffirmStatus", TodoCenterStatusEnum.TO_SUBMIT.getValue());
// toConfirmMap.put("taskAffirmStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
toConfirmMap.put("taskAffirmStatusCount",toConfirmCount);
resultsToBeSubmittedMap.put("taskAffirmStatus", CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue());
resultsToBeSubmittedMap.put("taskAffirmStatusCount",resultsToBeSubmittedCount);
acceptedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
acceptedMap.put("taskAffirmStatusCount",acceptedCount);
resultsToBeReviewedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue());
resultsToBeReviewedMap.put("taskAffirmStatusCount",resultsToBeReviewedCount);
rejectedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
rejectedMap.put("taskAffirmStatusCount",rejectedCount);
reviewAndPassMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue());
reviewAndPassMap.put("taskAffirmStatusCount",reviewAndPassCount);
result.add(notStartedMap);
result.add(toConfirmMap);
result.add(acceptedMap);
result.add(rejectedMap);
reviewAndReturnMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue());
reviewAndReturnMap.put("taskAffirmStatusCount",reviewAndReturnCount);
result.add(taskToBeConfirmedMap);
result.add(resultsToBeSubmittedMap);
result.add(resultsToBeReviewedMap);
result.add(reviewAndPassMap);
result.add(reviewAndReturnMap);
return result;
}
@@ -3630,6 +3665,11 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
throw new JeroBootException("无法获取项目库信息,项目库id为:" + projectLibraryId + " 请联系管理员!");
}
String currRole = json.getString("currRole");
if(StringUtils.isNotBlank(currRole) && com.jero.modules.system.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue().equals(currRole)){
return resetFlowHomo(json);
}
List<SysUser> certificationEngineerList = new ArrayList<>();
List<String> certificationEngineerIdList = new ArrayList<>();
if(StringUtils.isNotBlank(projectLibraryBase.getCertificationEngineer())){
@@ -3676,7 +3716,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
updateWrap.set(ProjectCertificationInventoryEO::getDeliveryResult,null);
// 流程重置清空截止日期 撤回不清空 对应禅道问题67048
if(StringUtils.equals(operatorType,OperatorTypeEnum.CERTIFICATION_INVENTORY_STUDIO_RESET.getValue())){
updateWrap.set(ProjectCertificationInventoryEO::getEndTime,null);
updateWrap.set(ProjectCertificationInventoryEO::getInventoryVerifyEndTime,null);
updateWrap.set(ProjectCertificationInventoryEO::getTaskConfirmEndTime,null);
}
updateWrap.set(ProjectCertificationInventoryEO::getFlowStatus,CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
@@ -3765,6 +3806,106 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
lawsInventoryPlatformEOService.remove(wrapper);
return Result.OK("流程重置成功!");
}
public Result<?> resetFlowHomo(JSONObject json) {
String ids = json.getString("ids");
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String operatorType = json.getString("operatorType");
String projectLibraryId = json.getString("projectLibraryId");
ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLibraryId);
List<SysUser> certificationEngineerList = new ArrayList<>();
List<String> certificationEngineerIdList = new ArrayList<>();
if(StringUtils.isNotBlank(projectLibraryBase.getCertificationEngineer())){
certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(","));
certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList);
}
List<String> idList = Arrays.asList(ids.split(","));
QueryWrapper<ProjectCertificationInventoryEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList);
queryWrapper.lambda().ne(ProjectCertificationInventoryEO::getFlowStatus,CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue());
List<ProjectCertificationInventoryEO> projectCertificationInventoryEOList = this.list(queryWrapper);
// 根据结束时间进行排序获取最近的时间发消息时使用
Collections.sort(projectCertificationInventoryEOList, new Comparator<ProjectCertificationInventoryEO>() {
@Override
public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) {
if(p1.getEndTime() != null && p2.getEndTime() != null){
return p1.getEndTime().compareTo(p2.getEndTime());
}
return 1;
}
});
try {
for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) {
// 把交付结果截止日期清空流程状态 设置为 清单待发布
LambdaUpdateWrapper<ProjectCertificationInventoryEO> updateWrap = new LambdaUpdateWrapper<>();
updateWrap.set(ProjectCertificationInventoryEO::getDeliveryResult,null);
// 流程重置清空截止日期 撤回不清空 对应禅道问题67048
if(StringUtils.equals(operatorType,OperatorTypeEnum.CERTIFICATION_INVENTORY_STUDIO_RESET.getValue())){
updateWrap.set(ProjectCertificationInventoryEO::getInventoryVerifyEndTime,null);
updateWrap.set(ProjectCertificationInventoryEO::getTaskConfirmEndTime,null);
}
updateWrap.set(ProjectCertificationInventoryEO::getFlowStatus,CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue());
updateWrap.eq(ProjectCertificationInventoryEO::getId,projectCertificationInventoryEO.getId());
this.update(updateWrap);
}
processHistoryEOService.deleteByPId(ids);
this.saveProjectCertificationInventoryLog(projectCertificationInventoryEOList,operatorType);
// 删除其它用户的待办任务
QueryWrapper<ProcessInfoDetailEO> detailRemoveWrap = new QueryWrapper<>();
detailRemoveWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryBase.getId());
detailRemoveWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue());
detailRemoveWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId,idList);
this.processInfoDetailEOService.remove(detailRemoveWrap);
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
// 获取项目信息获取认证工程师给认证工程师分配待办任务
if(ObjectUtils.isNotEmpty(projectLibraryBase)) {
// 给认证工程师分配任务
for (String userId : certificationEngineerIdList) {
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
processInfoDetailEO.setUserId(userId);
processInfoDetailEO.setTaskDefinitionKey(CertificationFlowNodeEnum.RZGCSJSRW.getKey());
processInfoDetailEO.setCreateTime(new Date());
processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue());
processInfoDetailEO.setProcessInfoId(projectLibraryId);
processInfoDetailEO.setActiProcInstId(projectLibraryId);
processInfoDetailEO.setFlowType(FlowTypeEnum.CERTIFICATION_LC.getValue());
// processInfoDetailEO.setEndTime(inventoryVerifyEndTime);
processInfoDetailEOList.add(processInfoDetailEO);
}
ProcessInfoEO processInfoEO = new ProcessInfoEO();
this.addProcessInfoEO(processInfoEO, projectLibraryId);
// 删除该项目数据的待办任务key为 认证工程师接受任务的数据
QueryWrapper<ProcessInfoDetailEO> deleteDetailWrap = new QueryWrapper<>();
deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId, processInfoEO.getId());
deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey, CertificationFlowNodeEnum.RZGCSJSRW.getKey());
deleteDetailWrap.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.CERTIFICATION_LC.getValue());
this.processInfoDetailEOService.remove(deleteDetailWrap);
this.processInfoDetailEOService.saveBatch(processInfoDetailEOList);
}
}catch (Exception ex){
ex.printStackTrace();
log.error("studio-流程重置失败:" + ex.getMessage());
throw new JeroBootException("流程重置失败!");
}
//流程重置后将平台件关联信息删除
LambdaQueryWrapper<LawsInventoryPlatformEO> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsInventoryPlatformEO::getLawsInventoryId,Arrays.asList(ids.split(",")));
lawsInventoryPlatformEOService.remove(wrapper);
return Result.OK("流程重置成功!");
}
@Override
public Result<?> transferTask(JSONObject json) {
@@ -6398,16 +6539,17 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Map<String, Object> result = new HashMap<>();
Map<String,Object> projectScheduleExportMap = new HashMap<>();
double toBeReleasedCount = 0;
double toBeVerifiedCount = 0;
double toBeConfirmedCount = 0;
double acceptCount = 0;
double refuseCount = 0;
double toBeReleasedCount = 0; //清单待发布
double toBeVerifiedCount = 0; //任务待发起
double toBeConfirmedCount = 0; //任务待确认
double acceptCount = 0; //责任人接受
double refuseCount = 0; //责任人拒绝
double count = 0;
// 计算百分比
double percentage = 0;
String percentageStr = "0";
if(CollectionUtils.isNotEmpty(pciEos)){
//清单待发布
List<ProjectCertificationInventoryEO> toBeReleased = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
@@ -6416,6 +6558,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
//任务待发起
List<ProjectCertificationInventoryEO> toBeVerified = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue())
@@ -6423,6 +6566,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
//任务待确认
List<ProjectCertificationInventoryEO> toBeConfirmed = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())
@@ -6430,6 +6574,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
//责任人接受
List<ProjectCertificationInventoryEO> accept = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
@@ -6440,6 +6585,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
//责任人拒绝
List<ProjectCertificationInventoryEO> refuse = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())
@@ -6478,9 +6624,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
Map<String, Object> result = new HashMap<>();
Map<String,Object> projectScheduleExportMap = new HashMap<>();
double notStartCount = 0; // 未发起
double toBeSubmittedCount = 0; // 待提交
double toBeReviewedCount = 0; // 待审查
double notStartCount = 0; // 任务待确认
double toBeSubmittedCount = 0; // 结果待提交
double toBeReviewedCount = 0; // 结果待审查
double acceptCount = 0; // 审查通过
double refuseCount = 0; // 审查退回
double taskTerminationCount = 0; // 任务终止
@@ -6490,6 +6636,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
String percentageStr = "0";
if(CollectionUtils.isNotEmpty(pciEos)){
List<ProjectCertificationInventoryEO> notStart = pciEos.stream().filter(pciEo -> {
// 任务待确认
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue())
|| StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue())
@@ -6500,6 +6647,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
// 结果待提交
List<ProjectCertificationInventoryEO> toBeSubmitted = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())
@@ -6507,6 +6655,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
// 结果待审查
List<ProjectCertificationInventoryEO> toBeReviewed = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())
@@ -6514,6 +6663,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
// 审查通过
List<ProjectCertificationInventoryEO> accept = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue())
@@ -6521,6 +6671,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
return flag;
}).collect(Collectors.toList());
// 审查退回
List<ProjectCertificationInventoryEO> refuse = pciEos.stream().filter(pciEo -> {
boolean flag = (
StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue())
@@ -6941,14 +7092,20 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
public int checkUserRole(String projectLibraryId, String currentUserId) {
int result = -1;
try {
QueryWrapper<ProjectLibraryBase> projectLibraryBaseQueryWrapper = new QueryWrapper<>();
projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getId, projectLibraryId);
projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getStudioEngineer, currentUserId);
Integer projectLibrayBaseCount = projectLibraryBaseMapper.selectCount(projectLibraryBaseQueryWrapper);
if (projectLibrayBaseCount > 0) {
result = Integer.parseInt(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue());
if(result == -1){
result = Integer.parseInt(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
ProjectLibraryBase projectLibrayBase = projectLibraryBaseMapper.selectById(projectLibraryId);
if (ObjectUtils.isNotEmpty(projectLibrayBase)) {
if(projectLibrayBase.getStudioEngineer().equals(currentUserId)){
result = Integer.parseInt(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue());
}else {
if(StringUtils.isNotBlank(projectLibrayBase.getCertificationEngineer())){
String[] ceList = projectLibrayBase.getCertificationEngineer().split(",");
for (String ceStr : ceList) {
if(ceStr.equals(currentUserId)){
result = Integer.parseInt(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
break;
}
}
}
}
}
} catch (Exception ex) {
@@ -7122,6 +7279,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
String cut = (String) params.get("cut");//
String ids = (String) params.get("ids");//认证清单id
String projectLibraryIds = (String) params.get("projectLibraryIds");//平台件项目id
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
//认证清单数据
LambdaQueryWrapper<ProjectCertificationInventoryEO> wrapper = new LambdaQueryWrapper<>();
@@ -7170,7 +7328,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
String configItemTemp = "";
if(!libraryBaseList.isEmpty()){
//配置项
configItemTemp = libraryBaseList.get(0).getProjectNameId();
String dictItemText = DictItemUtil.getDictItemText(cut,libraryBaseList.get(0).getTargetMarket(),targetMarketList);
configItemTemp = libraryBaseList.get(0).getPlatformType() + "-" + libraryBaseList.get(0).getPower() + "-" + libraryBaseList.get(0).getProducer() + "-" + dictItemText;
// configItemTemp = libraryBaseList.get(0).getProjectNameId();
}
//类别
String categoryTemp = certificationInventoryEO.getCategory();
@@ -10,15 +10,23 @@ import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.DictModel;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.RedisUtil;
import com.jero.common.util.TokenUtils;
import com.jero.modules.dummy.enums.OrderEnum;
import com.jero.modules.dummy.service.impl.DummyInventoryInfoEOServiceImpl;
import com.jero.modules.enums.DictCodeEnum;
import com.jero.modules.ocr.entity.User;
import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.*;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
import com.jero.modules.project.entity.ProjectUserPermission;
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
import com.jero.modules.project.enums.PermissionDescriptionEnum;
import com.jero.modules.project.enums.ProjectInventoryFieldEnum;
import com.jero.modules.project.enums.ProjectRoleEnum;
import com.jero.modules.project.enums.ProjectUserLocationEnum;
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
import com.jero.modules.project.mapper.ProjectTaskInventoryEOMapper;
@@ -33,7 +41,7 @@ import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysDictItemService;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import com.jero.modules.system.util.DictItemUtil;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
@@ -43,7 +51,14 @@ import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -57,7 +72,18 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeSet;
import java.util.stream.Collectors;
/**
@@ -295,7 +321,9 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
String lawEngineer,
String engineeringInterfacePerson,
String engineerLawSet,String engineerAttSet,
String firstLevelDutyTerritory) {
String firstLevelDutyTerritory,
String orderBy,
String orderByField) {
//查询数据
List<ProjectRelatedPersonnel> result = projectRelatedPersonnelMapper.queryPageList(projectId,
DictCodeEnum.DUTY_TERRITORY.getValue(),
@@ -337,9 +365,130 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
}
disposeData(result,firstLevelDutyTerritory);
//表头排序
if(StringUtils.isNotBlank(orderByField)) {
hearSort(orderBy, orderByField, result);
}
return result;
}
private void hearSort(String orderBy, String orderByField, List<ProjectRelatedPersonnel> result) {
Collator comparator = Collator.getInstance(Locale.CHINESE);
// 责任部门 dutyTerritory
if("dutyTerritory".equals(orderByField)){
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){
Collections.sort(result,(e1, e2)->{
String e1DutyTerritoryName = StringUtils.isNotBlank(e1.getDutyTerritoryName()) ? e1.getDutyTerritoryName() : "";
String e2DutyTerritoryName = StringUtils.isNotBlank(e2.getDutyTerritoryName()) ? e2.getDutyTerritoryName() : "";
return comparator.compare(e1DutyTerritoryName,e2DutyTerritoryName);
});
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
Collections.sort(result,(e1,e2)->{
String e1DutyTerritoryName = StringUtils.isNotBlank(e1.getDutyTerritoryName()) ? e1.getDutyTerritoryName() : "";
String e2DutyTerritoryName = StringUtils.isNotBlank(e2.getDutyTerritoryName()) ? e2.getDutyTerritoryName() : "";
return comparator.compare(e2DutyTerritoryName,e1DutyTerritoryName);
});
}
}
//责任领域 firstLevelDutyTerritory
if("firstLevelDutyTerritory".equals(orderByField)){
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){
Collections.sort(result,(e1, e2)->{
String e1FirstLevelDutyTerritory = StringUtils.isNotBlank(e1.getFirstLevelDutyTerritory()) ? e1.getFirstLevelDutyTerritory() : "";
String e2FirstLevelDutyTerritory = StringUtils.isNotBlank(e2.getFirstLevelDutyTerritory()) ? e2.getFirstLevelDutyTerritory() : "";
return comparator.compare(e1FirstLevelDutyTerritory,e2FirstLevelDutyTerritory);
});
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
Collections.sort(result,(e1,e2)->{
String e1FirstLevelDutyTerritory = StringUtils.isNotBlank(e1.getFirstLevelDutyTerritory()) ? e1.getFirstLevelDutyTerritory() : "";
String e2FirstLevelDutyTerritory = StringUtils.isNotBlank(e2.getFirstLevelDutyTerritory()) ? e2.getFirstLevelDutyTerritory() : "";
return comparator.compare(e2FirstLevelDutyTerritory,e1FirstLevelDutyTerritory);
});
}
}
//法规工程师 lawEngineer
if("lawEngineer".equals(orderByField)){
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){
Collections.sort(result,(e1, e2)->{
String e1LawEngineerName = StringUtils.isNotBlank(e1.getLawEngineerName()) ? e1.getLawEngineerName() : "";
String e2LawEngineerName = StringUtils.isNotBlank(e2.getLawEngineerName()) ? e2.getLawEngineerName() : "";
return comparator.compare(e1LawEngineerName,e2LawEngineerName);
});
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
Collections.sort(result,(e1,e2)->{
String e1LawEngineerName = StringUtils.isNotBlank(e1.getLawEngineerName()) ? e1.getLawEngineerName() : "";
String e2LawEngineerName = StringUtils.isNotBlank(e2.getLawEngineerName()) ? e2.getLawEngineerName() : "";
return comparator.compare(e2LawEngineerName,e1LawEngineerName);
});
}
}
//工程接口人 engineeringInterfacePerson
if("engineeringInterfacePerson".equals(orderByField)){
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){
Collections.sort(result,(e1, e2)->{
String e1EngineeringInterfacePersonName = StringUtils.isNotBlank(e1.getEngineeringInterfacePersonName()) ? e1.getEngineeringInterfacePersonName() : "";
String e2EngineeringInterfacePersonName = StringUtils.isNotBlank(e2.getEngineeringInterfacePersonName()) ? e2.getEngineeringInterfacePersonName() : "";
return comparator.compare(e1EngineeringInterfacePersonName,e2EngineeringInterfacePersonName);
});
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
Collections.sort(result,(e1,e2)->{
String e1EngineeringInterfacePersonName = StringUtils.isNotBlank(e1.getEngineeringInterfacePersonName()) ? e1.getEngineeringInterfacePersonName() : "";
String e2EngineeringInterfacePersonName = StringUtils.isNotBlank(e2.getEngineeringInterfacePersonName()) ? e2.getEngineeringInterfacePersonName() : "";
return comparator.compare(e2EngineeringInterfacePersonName,e1EngineeringInterfacePersonName);
});
}
}
//工程接口人-法规工程师设置 engineerLawSet
if("engineerLawSet".equals(orderByField)){
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){
Collections.sort(result,(e1, e2)->{
String e1EngineerLawSetName = StringUtils.isNotBlank(e1.getEngineerLawSetName()) ? e1.getEngineerLawSetName() : "";
String e2EngineerLawSetName = StringUtils.isNotBlank(e2.getEngineerLawSetName()) ? e2.getEngineerLawSetName() : "";
return comparator.compare(e1EngineerLawSetName,e2EngineerLawSetName);
});
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
Collections.sort(result,(e1,e2)->{
String e1EngineerLawSetName = StringUtils.isNotBlank(e1.getEngineerLawSetName()) ? e1.getEngineerLawSetName() : "";
String e2EngineerLawSetName = StringUtils.isNotBlank(e2.getEngineerLawSetName()) ? e2.getEngineerLawSetName() : "";
return comparator.compare(e2EngineerLawSetName,e1EngineerLawSetName);
});
}
}
//工程接口人-认证工程师设置 engineerAttSet
if("engineerAttSet".equals(orderByField)){
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){
Collections.sort(result,(e1, e2)->{
String e1EngineerAttSetName = StringUtils.isNotBlank(e1.getEngineerAttSetName()) ? e1.getEngineerAttSetName() : "";
String e2EngineerAttSetName = StringUtils.isNotBlank(e2.getEngineerAttSetName()) ? e2.getEngineerAttSetName() : "";
return comparator.compare(e1EngineerAttSetName,e2EngineerAttSetName);
});
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
Collections.sort(result,(e1,e2)->{
String e1EngineerAttSetName = StringUtils.isNotBlank(e1.getEngineerAttSetName()) ? e1.getEngineerAttSetName() : "";
String e2EngineerAttSetName = StringUtils.isNotBlank(e2.getEngineerAttSetName()) ? e2.getEngineerAttSetName() : "";
return comparator.compare(e2EngineerAttSetName,e1EngineerAttSetName);
});
}
}
//备注 remark
if("remark".equals(orderByField)){
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){
Collections.sort(result,(e1, e2)->{
String e1Remark = StringUtils.isNotBlank(e1.getRemark()) ? e1.getRemark() : "";
String e2Remark = StringUtils.isNotBlank(e2.getRemark()) ? e2.getRemark() : "";
return comparator.compare(e1Remark,e2Remark);
});
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
Collections.sort(result,(e1,e2)->{
String e1Remark = StringUtils.isNotBlank(e1.getRemark()) ? e1.getRemark() : "";
String e2Remark = StringUtils.isNotBlank(e2.getRemark()) ? e2.getRemark() : "";
return comparator.compare(e2Remark,e1Remark);
});
}
}
}
public void disposeData(List<ProjectRelatedPersonnel> records, String firstLevelDutyTerritory) {
List<SysDictItem> sysDictItems = this.sysDictItemService.selectItemsAll();
@@ -363,6 +512,20 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
}
}
//责任部门
if(StringUtils.isNotBlank(dutyTerritory)){
StringBuilder sb = new StringBuilder();
for (String s : dutyTerritory.split(",")) {
List<SysDictItem> collect = sysDictItems.stream().filter(e -> s.equals(e.getItemValue())).collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
sb.append(collect.get(0).getItemText()+",");
}
}
if(StringUtils.isNotBlank(sb)){
String substring = sb.substring(0, sb.length() - 1);
projectRelatedPersonnel.setDutyTerritoryName(substring);
}
}
//法规工程师
List<SysUser> lawEngineerUsers = new ArrayList<>();
if (StringUtils.isNotEmpty(projectRelatedPersonnel.getLawEngineer())){
@@ -731,7 +894,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
records = queryById(id);
}
}else{
records=queryPageList(projectId,null,null,null,null,null,null);
records=queryPageList(projectId,null,null,null,null,null,null,null,null);
}
//id无值,传全部
disposeDutyTerritory(records,cut);
@@ -837,73 +837,83 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
@NotNull
private HSSFSheet createCorssProjectProgressSheet(HSSFWorkbook workbook, ProjectLibraryBase projectLibraryBase) {
String cut = projectLibraryBase.getCut();
String sheetName = "项目进度";
// String cut = projectLibraryBase.getCut();
// String sheetName = "项目进度";
// String firstTitle = "项目," +
// "法规任务确认," +
// "设计符合性确认," +
// "验证符合性确认," +
// "设计符合性," +
// "验证符合性," +
// "认证任务确认," +
// "Pre-Homo确认," +
// "Pre-Homo流程," +
// "认证进度," +
// "参数收集";
// String secondTitle = "待发布,待校核,待确认,接受,拒绝,完成度,责任确认日期," +
// "未发起,待提交,待审查,符合,不符合,待追踪,不涉及,任务终止,完成度,设计核查日期," +
// "未发起,待提交,待审查,符合,不符合,待追踪,不涉及,任务终止,完成度,验证核查日期," +
// "待发布,待校核,待确认,接受,拒绝,完成度,责任确认日期," +
// "未发起,待提交,待审查,审查通过,审查退回,完成度,认证开始日期," +
// "待开始,进行中,实验通过,实验失败,部件报告未提交,部件报告已提交,部件报告已入库,完成度,认证提交时间," +
// "开始,收集中,已提交,已同步至上报库,完成度,认证提交时间";
// "参数收集进度";
// String secondTitle = "清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度,责任确认日期," +
// "任务待确认,结果待提交,结果待审查,符合,不符合,待追踪,完成度,设计核查日期," +//去掉不涉及任务终止
// "任务待确认,结果待提交,结果待审查,符合,不符合,待追踪,完成度,验证核查日期," +//删掉2个
// "清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度,责任确认日期," +
// "任务待确认,结果待提交,结果待审查,审查通过,审查退回,完成度,认证开始日期," +
// "待开始,进行中,实验通过,实验失败,完成度,认证提交时间," +//删掉3个
// "发起,收集中,已提交,已同步至上报库,完成度,认证提交时间";
//
// if(com.jero.modules.system.util.StringUtils.equals(cut,CutEnum.EN.getValue())){
// sheetName = "Project Progress";
// firstTitle = "Project," +
// "Confirmation of regulatory tasks," +
// "Design compliance," +
// "Verification compliance," +
// "Certification task confirmation," +
// "Pre Homo process," +
// "Certification progress," +
// "Parameter collection progress";
// secondTitle = "List to be released,Task to be initiated,Task to be confirmed,Assignee accept,Assignee refuse,Completion degree,Responsibility confirmation date," +
// "Task to be confirmed,Results to be submitted,Results to be reviewed,Compliance,Non-compliance,To be tracked,Completion degree,Design verification date," +
// "Task to be confirmed,Results to be submitted,Results to be reviewed,Compliance,Non-compliance,To be tracked,Completion degree,Verification verification date," +
// "List to be released,Task to be initiated,Task to be confirmed,Assignee accept,Assignee refuse,Completion degree,Responsibility confirmation date," +
// "Task to be confirmed,Results to be submitted,Results to be reviewed,Review passed,Review return,Completion degree,Certification start date," +
// "To begin,In progress,Experiment passed,Experimental failure,Completion degree,Certification submission time," +
// "Not initiated,Collecting,Submitted,Synchronized to the upper report library,Completion degree,Certification submission time";
// }
String cut = projectLibraryBase.getCut();
String sheetName = "项目进度";
String firstTitle = "项目," +
"法规任务确认," +
"设计任务确认," +
"验证任务确认," +
"设计符合性," +
"验证符合性," +
"认证任务确认," +
"Pre-Homo流程," +
"认证进度," +
"参数收集进度";
String secondTitle = "清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度,责任确认日期," +
String secondTitle =
"清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度,责任确认日期," +
"清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度,责任确认日期," +
"任务待确认,结果待提交,结果待审查,符合,不符合,待追踪,完成度,设计核查日期," +//去掉不涉及任务终止
"任务待确认,结果待提交,结果待审查,符合,不符合,待追踪,完成度,验证核查日期," +//删掉2个
"清单待发布,任务待发起,任务待确认,责任人接受,责任人拒绝,完成度,责任确认日期," +
"任务待确认,结果待提交,结果待审查,审查通过,审查退回,完成度,认证开始日期," +
"开始,进行中,实验通过,实验失败,完成度,认证提交时间," +//删掉3个
"开始,进行中,实验通过,实验失败,完成度,认证提交时间," +//删掉3个
"未发起,收集中,已提交,已同步至上报库,完成度,认证提交时间";
if(com.jero.modules.system.util.StringUtils.equals(cut,CutEnum.EN.getValue())){
sheetName = "Project Progress";
firstTitle = "Project," +
"Confirmation of regulatory tasks," +
"Design Task Confirmation," +
"Verification Task Confirmation," +
"Design compliance," +
"Verification compliance," +
"Certification task confirmation," +
"Pre Homo process," +
"Certification progress," +
"Parameter collection progress";
secondTitle = "List to be released,Task to be initiated,Task to be confirmed,Assignee accept,Assignee refuse,Completion degree,Responsibility confirmation date," +
secondTitle =
"List to be released,Task to be initiated,Task to be confirmed,Assignee accept,Assignee refuse,Completion degree,Responsibility confirmation date," +
"List to be released,Task to be initiated,Task to be confirmed,Assignee accept,Assignee refuse,Completion degree,Responsibility confirmation date," +
"Task to be confirmed,Results to be submitted,Results to be reviewed,Compliance,Non-compliance,To be tracked,Completion degree,Design verification date," +
"Task to be confirmed,Results to be submitted,Results to be reviewed,Compliance,Non-compliance,To be tracked,Completion degree,Verification verification date," +
"List to be released,Task to be initiated,Task to be confirmed,Assignee accept,Assignee refuse,Completion degree,Responsibility confirmation date," +
"Task to be confirmed,Results to be submitted,Results to be reviewed,Review passed,Review return,Completion degree,Certification start date," +
"To begin,In progress,Experiment passed,Experimental failure,Completion degree,Certification submission time," +
"Not initiated,Collecting,Submitted,Synchronized to the upper report library,Completion degree,Certification submission time";
// firstTitle = "Project," +
// "Confirmation of regulatory tasks," +
// "Confirmation of design compliance," +
// "Verification of compliance confirmation," +
// "Certification task confirmation," +
// "Pre Homo confirmation," +
// "Certification progress," +
// "Parameter collection";
// secondTitle = "To be released,To be verified,To be confirmed,Accept,Refuse,Completion degree,Responsibility confirmation date," +
// "Not initiated,To be submitted,Pending review,Conform to,Non Conformance,To be tracked,Not involved,Task Termination,Completion degree,Design verification date," +
// "Not initiated,To be submitted,Pending review,Conform to,Non Conformance,To be tracked,Not involved,Task Termination,Completion degree,Verification verification date," +
// "To be released,To be verified,To be confirmed,Accept,Refuse,Completion degree,Responsibility confirmation date," +
// "Not initiated,To be submitted,Pending review,Review passed,Review return,Completion degree,Certification start date," +
// "To begin,In progress,Experiment passed,Experimental failure,Component report not submitted,Component report submitted,Component report has been stored,Completion degree,Certification submission time," +
// "Not started,Collecting,Submitted,Synchronized to the upper report library,Completion degree,Certification submission time";
}
HSSFSheet sheet = workbook.createSheet(sheetName);
@@ -911,18 +921,20 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
sheet.addMergedRegion(region1);
CellRangeAddress region6 = new CellRangeAddress(0, 0, 1, 7);
sheet.addMergedRegion(region6);
CellRangeAddress region7 = new CellRangeAddress(0, 0, 8, 15);
CellRangeAddress region7 = new CellRangeAddress(0, 0, 8, 14);
sheet.addMergedRegion(region7);
CellRangeAddress region8 = new CellRangeAddress(0, 0, 16, 23);
CellRangeAddress region8 = new CellRangeAddress(0, 0, 15, 22);
sheet.addMergedRegion(region8);
CellRangeAddress region9 = new CellRangeAddress(0, 0, 24, 30);
CellRangeAddress region9 = new CellRangeAddress(0, 0, 23, 30);
sheet.addMergedRegion(region9);
CellRangeAddress region10 = new CellRangeAddress(0, 0, 31, 37);
sheet.addMergedRegion(region10);
CellRangeAddress region11 = new CellRangeAddress(0, 0, 38, 43);
CellRangeAddress region11 = new CellRangeAddress(0, 0, 38, 44);
sheet.addMergedRegion(region11);
CellRangeAddress region12 = new CellRangeAddress(0, 0, 44, 49);
CellRangeAddress region12 = new CellRangeAddress(0, 0, 45, 50);
sheet.addMergedRegion(region12);
CellRangeAddress region13 = new CellRangeAddress(0, 0, 51, 56);
sheet.addMergedRegion(region13);
String[] firstTitleArr = firstTitle.split(",");
String[] secondTitleArr = secondTitle.split(",");
@@ -932,7 +944,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
CellStyle cellStyleTitle = workbook.createCellStyle();
cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
for (int i = 0; i <= 49; i++){
for (int i = 0; i <= 56; i++){
sheet.setColumnWidth(i, 4000);
Cell firstRowCell = firstRow.createCell(i);
firstRowCell.setCellStyle(cellStyleTitle);
@@ -942,16 +954,18 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
firstRowCell.setCellValue(firstTitleArr[1]);
}else if(i == 8){
firstRowCell.setCellValue(firstTitleArr[2]);
}else if(i == 16){
}else if(i == 15){
firstRowCell.setCellValue(firstTitleArr[3]);
}else if(i == 24){
}else if(i == 23){
firstRowCell.setCellValue(firstTitleArr[4]);
}else if(i == 31){
firstRowCell.setCellValue(firstTitleArr[5]);
}else if(i == 38){
firstRowCell.setCellValue(firstTitleArr[6]);
}else if(i == 44){
}else if(i == 45){
firstRowCell.setCellValue(firstTitleArr[7]);
}else if(i == 51){
firstRowCell.setCellValue(firstTitleArr[8]);
}
if(i >= 1){
Cell secondRowCell = secondRow.createCell(i);
@@ -1016,28 +1030,52 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
certificationSubmissionStr = DateUtils.formatDate(certificationSubmission);
}
}
//设计任务确认
List<ProjectLawsInventoryEO> pliEos = pliEoList.stream().filter(pliEo -> StringUtils.equals(pliEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
Map<String,Object> fgRwqrMap = this.projectLawsInventoryEOService.groupByFGRwqrStatus(pliEos);
Map<String,Object> fgRwqrProjectScheduleExportMap = (Map<String, Object>) fgRwqrMap.get("projectScheduleExportMap");
double fgrqqrToBeReleased = (double) fgRwqrProjectScheduleExportMap.get("toBeReleased");
double fgrqqrToBeVerified = (double) fgRwqrProjectScheduleExportMap.get("toBeVerified");
double fgrqqrToBeConfirmed = (double) fgRwqrProjectScheduleExportMap.get("toBeConfirmed");
double fgrqqrAccept = (double) fgRwqrProjectScheduleExportMap.get("accept");
double fgrqqrRefuse = (double) fgRwqrProjectScheduleExportMap.get("refuse");
String fgrqqrPercentage = (String) fgRwqrProjectScheduleExportMap.get("percentage");
dataRow.createCell(1).setCellValue(fgrqqrToBeReleased);
dataRow.createCell(2).setCellValue(fgrqqrToBeVerified);
dataRow.createCell(3).setCellValue(fgrqqrToBeConfirmed);
dataRow.createCell(4).setCellValue(fgrqqrAccept);
dataRow.createCell(5).setCellValue(fgrqqrRefuse);
Map<String,Object> fgRwqrMapDesign = this.projectLawsInventoryEOService.groupByFGRwqrStatusDesign(pliEos);
Map<String,Object> fgRwqrProjectScheduleExportMapDesign = (Map<String, Object>) fgRwqrMapDesign.get("projectScheduleExportMap");
double fgrqqrToBeReleasedDesign = (double) fgRwqrProjectScheduleExportMapDesign.get("toBeReleased");
double fgrqqrToBeVerifiedDesign = (double) fgRwqrProjectScheduleExportMapDesign.get("toBeVerified");
double fgrqqrToBeConfirmedDesign = (double) fgRwqrProjectScheduleExportMapDesign.get("toBeConfirmed");
double fgrqqrAcceptDesign = (double) fgRwqrProjectScheduleExportMapDesign.get("accept");
double fgrqqrRefuseDesign = (double) fgRwqrProjectScheduleExportMapDesign.get("refuse");
String fgrqqrPercentageDesign = (String) fgRwqrProjectScheduleExportMapDesign.get("percentage");
dataRow.createCell(1).setCellValue(fgrqqrToBeReleasedDesign);
dataRow.createCell(2).setCellValue(fgrqqrToBeVerifiedDesign);
dataRow.createCell(3).setCellValue(fgrqqrToBeConfirmedDesign);
dataRow.createCell(4).setCellValue(fgrqqrAcceptDesign);
dataRow.createCell(5).setCellValue(fgrqqrRefuseDesign);
Cell cell = dataRow.createCell(6);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(fgrqqrPercentage.replace("%",""))/100);
cell.setCellValue(Double.valueOf(fgrqqrPercentageDesign.replace("%",""))/100);
dataRow.createCell(7).setCellValue(legalTaskConfirmationStr);
//验证任务确认
Map<String,Object> fgRwqrMapVerify = this.projectLawsInventoryEOService.groupByFGRwqrStatusVerify(pliEos);
Map<String,Object> fgRwqrProjectScheduleExportMapVerify = (Map<String, Object>) fgRwqrMapVerify.get("projectScheduleExportMap");
double fgrqqrToBeReleasedVerify = (double) fgRwqrProjectScheduleExportMapVerify.get("toBeReleased");
double fgrqqrToBeVerifiedVerify = (double) fgRwqrProjectScheduleExportMapVerify.get("toBeVerified");
double fgrqqrToBeConfirmedVerify = (double) fgRwqrProjectScheduleExportMapVerify.get("toBeConfirmed");
double fgrqqrAcceptVerify = (double) fgRwqrProjectScheduleExportMapVerify.get("accept");
double fgrqqrRefuseVerify = (double) fgRwqrProjectScheduleExportMapVerify.get("refuse");
String fgrqqrPercentageVerify = (String) fgRwqrProjectScheduleExportMapVerify.get("percentage");
dataRow.createCell(8).setCellValue(fgrqqrToBeReleasedVerify);
dataRow.createCell(9).setCellValue(fgrqqrToBeVerifiedVerify);
dataRow.createCell(10).setCellValue(fgrqqrToBeConfirmedVerify);
dataRow.createCell(11).setCellValue(fgrqqrAcceptVerify);
dataRow.createCell(12).setCellValue(fgrqqrRefuseVerify);
cell = dataRow.createCell(13);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(fgrqqrPercentageVerify.replace("%",""))/100);
dataRow.createCell(14).setCellValue(legalTaskConfirmationStr);
//设计符合性
Map<String,Object> designMap = this.projectLawsInventoryEOService.groupByDesignStatus(pliEos);
Map<String,Object> designMapProjectScheduleExportMap = (Map<String, Object>) designMap.get("projectScheduleExportMap");
double designNotStart = (double) designMapProjectScheduleExportMap.get("notStart");
@@ -1046,24 +1084,20 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
double designCompliance = (double) designMapProjectScheduleExportMap.get("compliance");
double designNonCompliance = (double) designMapProjectScheduleExportMap.get("nonCompliance");
double designToBeTracked = (double) designMapProjectScheduleExportMap.get("toBeTracked");
// double designNotInvolved = (double) designMapProjectScheduleExportMap.get("notInvolved");
// double designTaskTermination = (double) designMapProjectScheduleExportMap.get("taskTermination");
// double designCount = (double) designMapProjectScheduleExportMap.get("count");
String designPercentage = (String) designMapProjectScheduleExportMap.get("percentage");
dataRow.createCell(8).setCellValue(designNotStart);
dataRow.createCell(9).setCellValue(designToBeSubmitted);
dataRow.createCell(10).setCellValue(designToBeReviewed);
dataRow.createCell(11).setCellValue(designCompliance);
dataRow.createCell(12).setCellValue(designNonCompliance);
dataRow.createCell(13).setCellValue(designToBeTracked);
// dataRow.createCell(14).setCellValue(designNotInvolved);
// dataRow.createCell(15).setCellValue(designTaskTermination);
cell = dataRow.createCell(14);
dataRow.createCell(15).setCellValue(designNotStart);
dataRow.createCell(16).setCellValue(designToBeSubmitted);
dataRow.createCell(17).setCellValue(designToBeReviewed);
dataRow.createCell(18).setCellValue(designCompliance);
dataRow.createCell(19).setCellValue(designNonCompliance);
dataRow.createCell(20).setCellValue(designToBeTracked);
cell = dataRow.createCell(21);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(designPercentage.replace("%",""))/100);
dataRow.createCell(15).setCellValue(designDeadlineStr);
dataRow.createCell(22).setCellValue(designDeadlineStr);
//验证符合性
Map<String,Object> verifyMap = this.projectLawsInventoryEOService.groupByVerifyStatus(pliEos);
Map<String,Object> verifyMapProjectScheduleExportMap = (Map<String, Object>) verifyMap.get("projectScheduleExportMap");
double verifyNotStart = (double) verifyMapProjectScheduleExportMap.get("notStart");
@@ -1076,20 +1110,21 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
// double verifyTaskTermination = (double) verifyMapProjectScheduleExportMap.get("taskTermination");
// double verifyCount = (double) verifyMapProjectScheduleExportMap.get("count");
String verifyPercentage = (String) verifyMapProjectScheduleExportMap.get("percentage");
dataRow.createCell(16).setCellValue(verifyNotStart);
dataRow.createCell(17).setCellValue(verifyToBeSubmitted);
dataRow.createCell(18).setCellValue(verifyToBeReviewed);
dataRow.createCell(19).setCellValue(verifyCompliance);
dataRow.createCell(20).setCellValue(verifyNonCompliance);
dataRow.createCell(21).setCellValue(verifyToBeTracked);
dataRow.createCell(23).setCellValue(verifyNotStart);
dataRow.createCell(24).setCellValue(verifyToBeSubmitted);
dataRow.createCell(25).setCellValue(verifyToBeReviewed);
dataRow.createCell(26).setCellValue(verifyCompliance);
dataRow.createCell(27).setCellValue(verifyNonCompliance);
dataRow.createCell(28).setCellValue(verifyToBeTracked);
// dataRow.createCell(24).setCellValue(verifyNotInvolved);
// dataRow.createCell(25).setCellValue(verifyTaskTermination);
cell = dataRow.createCell(22);
cell = dataRow.createCell(29);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(verifyPercentage.replace("%",""))/100);
dataRow.createCell(23).setCellValue(verifyDeadlineStr);
dataRow.createCell(30).setCellValue(verifyDeadlineStr);
//认证任务确认
List<ProjectCertificationInventoryEO> pciEos = pciEoList.stream().filter(pciEo -> StringUtils.equals(pciEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
Map<String,Object> rzRwqrMap = this.projectCertificationInventoryEOService.groupByFGRwqrStatus(pciEos);
Map<String,Object> rzRwqrProjectScheduleExportMap = (Map<String, Object>) rzRwqrMap.get("projectScheduleExportMap");
@@ -1099,17 +1134,18 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
double rzRqqrAccept = (double) rzRwqrProjectScheduleExportMap.get("accept");
double rzRqqrRefuse = (double) rzRwqrProjectScheduleExportMap.get("refuse");
String rzRqqrPercentage = (String) rzRwqrProjectScheduleExportMap.get("percentage");
dataRow.createCell(24).setCellValue(rzRqqrToBeReleased);
dataRow.createCell(25).setCellValue(rzRqqrToBeVerified);
dataRow.createCell(26).setCellValue(rzRqqrToBeConfirmed);
dataRow.createCell(27).setCellValue(rzRqqrAccept);
dataRow.createCell(28).setCellValue(rzRqqrRefuse);
cell = dataRow.createCell(29);
dataRow.createCell(31).setCellValue(rzRqqrToBeReleased);
dataRow.createCell(32).setCellValue(rzRqqrToBeVerified);
dataRow.createCell(33).setCellValue(rzRqqrToBeConfirmed);
dataRow.createCell(34).setCellValue(rzRqqrAccept);
dataRow.createCell(35).setCellValue(rzRqqrRefuse);
cell = dataRow.createCell(36);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(rzRqqrPercentage.replace("%",""))/100);
dataRow.createCell(30).setCellValue(legalTaskConfirmationStr);
dataRow.createCell(37).setCellValue(legalTaskConfirmationStr);
//Pre-Homo流程
Map<String,Object> preHomoMap = this.projectCertificationInventoryEOService.groupByPreHomoStatus(pciEos);
Map<String,Object> preHomoProjectScheduleExportMap = (Map<String, Object>) preHomoMap.get("projectScheduleExportMap");
double preHomoNotStartCount = (double) preHomoProjectScheduleExportMap.get("notStartCount");
@@ -1118,17 +1154,18 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
double preHomoAccept = (double) preHomoProjectScheduleExportMap.get("accept");
double preHomoRefuse = (double) preHomoProjectScheduleExportMap.get("refuse");
String preHomoPercentage = (String) preHomoProjectScheduleExportMap.get("percentage");
dataRow.createCell(31).setCellValue(preHomoNotStartCount);
dataRow.createCell(32).setCellValue(preHomoToBeSubmittedCount);
dataRow.createCell(33).setCellValue(preHomoToBeReviewedCount);
dataRow.createCell(34).setCellValue(preHomoAccept);
dataRow.createCell(35).setCellValue(preHomoRefuse);
cell = dataRow.createCell(36);
dataRow.createCell(38).setCellValue(preHomoNotStartCount);
dataRow.createCell(39).setCellValue(preHomoToBeSubmittedCount);
dataRow.createCell(40).setCellValue(preHomoToBeReviewedCount);
dataRow.createCell(41).setCellValue(preHomoAccept);
dataRow.createCell(42).setCellValue(preHomoRefuse);
cell = dataRow.createCell(43);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(preHomoPercentage.replace("%",""))/100);
dataRow.createCell(37).setCellValue(attestationStartTimeStr);
dataRow.createCell(44).setCellValue(attestationStartTimeStr);
//认证进度
Map<String,Object> certificationProgressMap = this.projectCertificationInventoryEOService.groupByCertificationProgress(pciEos);
Map<String,Object> certificationProgressMapProjectScheduleExportMap = (Map<String, Object>) certificationProgressMap.get("projectScheduleExportMap");
double certificationProgressNotStartCount = (double) certificationProgressMapProjectScheduleExportMap.get("notStartCount");
@@ -1140,18 +1177,18 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
// double certificationProgressStoredCount = (double) certificationProgressMapProjectScheduleExportMap.get("storedCount");
// String certificationProgressCount = (String) certificationProgressMapProjectScheduleExportMap.get("count");
String certificationProgressPercentage = (String) certificationProgressMapProjectScheduleExportMap.get("percentage");
dataRow.createCell(38).setCellValue(certificationProgressNotStartCount);
dataRow.createCell(39).setCellValue(certificationProgressInProgressCount);
dataRow.createCell(40).setCellValue(certificationProgressTestPassedCount);
dataRow.createCell(41).setCellValue(certificationProgressTestFailedCount);
dataRow.createCell(45).setCellValue(certificationProgressNotStartCount);
dataRow.createCell(46).setCellValue(certificationProgressInProgressCount);
dataRow.createCell(47).setCellValue(certificationProgressTestPassedCount);
dataRow.createCell(48).setCellValue(certificationProgressTestFailedCount);
// dataRow.createCell(46).setCellValue(certificationProgressNotSubmitCount);
// dataRow.createCell(47).setCellValue(certificationProgressReportSubmitCount);
// dataRow.createCell(48).setCellValue(certificationProgressStoredCount);
cell = dataRow.createCell(42);
cell = dataRow.createCell(49);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(certificationProgressPercentage.replace("%",""))/100);
dataRow.createCell(43).setCellValue(certificationSubmissionStr);
dataRow.createCell(50).setCellValue(certificationSubmissionStr);
List<ParamsManifestEO> pmEos = pmEoList.stream().filter(pmEo -> {
@@ -1181,6 +1218,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
return flag;
}).collect(Collectors.toList());
//参数收集进度
Map<String, Object> parameterCollectingMap = this.projectLibraryStatisticsService.getParameterCollectingStatisticsGroupByTerritory(pcmEos,null);
Map<String, Object> notStartMap = (Map<String, Object>) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.NOT_START.getValue());
notStartAmount = (double) notStartMap.get("amount");
@@ -1196,15 +1234,15 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
double parameterCollectingPercentage = (completionCount / parameterCollectingCount) * 100;
parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (completionCount !=0 )) ? df.format(parameterCollectingPercentage) : "0";
}
dataRow.createCell(44).setCellValue(notStartAmount);
dataRow.createCell(45).setCellValue(collectingAmount);
dataRow.createCell(46).setCellValue(submitAmount);
dataRow.createCell(47).setCellValue(syncReporAmount);
cell = dataRow.createCell(48);
dataRow.createCell(51).setCellValue(notStartAmount);
dataRow.createCell(52).setCellValue(collectingAmount);
dataRow.createCell(53).setCellValue(submitAmount);
dataRow.createCell(54).setCellValue(syncReporAmount);
cell = dataRow.createCell(55);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(parameterCollectingPercentageStr)/100);
dataRow.createCell(49).setCellValue(certificationSubmissionStr);
dataRow.createCell(56).setCellValue(certificationSubmissionStr);
dataIndex ++;
log.info("11111处理"+ dataIndex +"个项目消耗时间:" + (System.currentTimeMillis() - startTime));
@@ -92,6 +92,13 @@ public class NcrTrackVO implements Serializable {
@Excel(name = "问题状态", width = 20)
private java.lang.String problemState;
/**问题优先级*/
@Excel(name = "*问题优先级", width = 15,dicCode ="wen4_ti2_you1_xian1_ji2")
@ApiModelProperty(value = "问题优先级")
private java.lang.String problemPriority;
private java.lang.String problemPriority_dictText;
/**描述和分析*/
@ApiModelProperty(value = "描述和分析")
@Excel(name = "描述和分析", width = 20)
@@ -251,6 +258,9 @@ public class NcrTrackVO implements Serializable {
private String platform;
//相关项目类型
private String projectType;
@@ -216,5 +216,6 @@ public class LawsMonthlyReportWriteEO implements Serializable {
private String sourceCn;//来源中文
private String sourceEn;//来源英文
private String time;//日期
private String saveState;//保存状态
}
@@ -0,0 +1,40 @@
package com.jero.modules.report.enums;
/**
* @description
* @date 2022/1/21 15:22
* @auth zhn
*/
public enum SaveStateEnum {
SAVE("保存","0"),
SUBMIT("提交","1")
;
String name;
String value;
private SaveStateEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -24,6 +24,7 @@ import com.jero.modules.report.entity.NewOpinionTemplateEO;
import com.jero.modules.report.entity.NewStandardTemplateEO;
import com.jero.modules.report.enums.ContentTemplateEnum;
import com.jero.modules.report.enums.ExportStateEnum;
import com.jero.modules.report.enums.SaveStateEnum;
import com.jero.modules.report.mapper.LawsMonthlyReportWriteEOMapper;
import com.jero.modules.report.service.ILawsMonthlyReportTitleTemplateEOService;
import com.jero.modules.report.service.ILawsMonthlyReportWriteEOService;
@@ -32,7 +33,6 @@ import com.jero.modules.report.service.INewStandardTemplateEOService;
import com.jero.modules.report.util.WordUtil;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.enums.ProjectRoleEnum;
import com.jero.modules.system.service.impl.SysBaseApiImpl;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
@@ -105,6 +105,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
*/
@Override
public void add(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
// lawsMonthlyReportWriteEO.setSaveState("0");
// lawsMonthlyReportWriteEO.setMemoriesChapterOne("2");
Date now = new Date();
lawsMonthlyReportWriteEO.setCreateTime(now);
@@ -138,6 +139,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
*/
@Override
public void editById(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
// lawsMonthlyReportWriteEO.setSaveState("1");
Date now = new Date();
lawsMonthlyReportWriteEO.setUpdateTime(now);
saveOrUpdate(lawsMonthlyReportWriteEO);
@@ -304,6 +306,17 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
// queryWrapper.in("create_by",currentUser.getUsername());
// }
//-------------------------------------------------------------------------------------
//草稿只能自己查看已提交的所有人都可以查看
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
queryWrapper.lambda().and(q->{
q.eq(LawsMonthlyReportWriteEO::getSaveState, SaveStateEnum.SUBMIT.getValue());
q.or().isNull(LawsMonthlyReportWriteEO::getSaveState);
q.or(wrapper->{
wrapper.eq(LawsMonthlyReportWriteEO::getCreateBy,currentUser.getUsername());
wrapper.eq(LawsMonthlyReportWriteEO::getSaveState,SaveStateEnum.SAVE.getValue());
});
});
//所有的月报
@@ -483,6 +496,17 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
// wrapper.in(LawsMonthlyReportWriteEO::getCreateBy,currentUser.getUsername());
// }
//----------------------------------------------------------------------------------------
//草稿只能自己查看已提交的所有人都可以查看
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
wrapper.and(q->{
q.eq(LawsMonthlyReportWriteEO::getSaveState, SaveStateEnum.SUBMIT.getValue());
q.or().isNull(LawsMonthlyReportWriteEO::getSaveState);
q.or(queryWrapper->{
queryWrapper.eq(LawsMonthlyReportWriteEO::getCreateBy,currentUser.getUsername());
queryWrapper.eq(LawsMonthlyReportWriteEO::getSaveState,SaveStateEnum.SAVE.getValue());
});
});
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = this.list(wrapper);
if(lawsMonthlyReportWriteEOS.size() == 0){
@@ -44,4 +44,7 @@ public class ParamsManifestTodoCenterEO {
private Date createTime;
private String state;
private String projectId;
//用于区分跳转所带的状态
private String flag;
}
@@ -0,0 +1,24 @@
package com.jero.modules.todoCenter.enums;
/**
* 待办中心状态枚举类
*/
public enum FlagEnum {
ZERO("0"),
ONE("1"),
;
String value;
private FlagEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -10,14 +10,21 @@ import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.ManifestStateEnum;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.service.impl.ProjectLibraryBaseServiceImpl;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.todoCenter.entity.ParamsManifestTodoCenterEO;
import com.jero.modules.todoCenter.enums.FlagEnum;
import com.jero.modules.todoCenter.service.IParamsManifestTodoCenterService;
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@@ -34,6 +41,10 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
@Autowired
private ParamsManifestEOMapper paramsManifestEOMapper;
@Autowired
private ProjectLibraryBaseServiceImpl projectLibraryBaseService;
@Autowired
private ISysUserService sysUserService;
@Override
public IPage queryPage(ParamsManifestTodoCenterEOPage pageVO) {
@@ -48,6 +59,14 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
pageVO.setUserName(loginUser.getUsername());
List<ParamsManifestTodoCenterEO> paramsManifestEOListAll = paramsManifestEOMapper.listForTodoCenter(pageVO);
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
if(ObjectUtil.isNotEmpty(paramsManifestEOListAll)){
List<String> projectIdList = paramsManifestEOListAll.stream().map(ParamsManifestTodoCenterEO::getProjectId).distinct().collect(Collectors.toList());
if(ObjectUtil.isNotEmpty(projectIdList)){
projectLibraryBaseList = projectLibraryBaseService.queryList(projectIdList);
}
}
// 查询清单的所有参数项
List<String> manifestIdList = paramsManifestEOListAll.stream().map(ParamsManifestTodoCenterEO::getId).collect(Collectors.toList());
if (CollectionUtil.isEmpty(manifestIdList)) {
@@ -60,6 +79,15 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
List<String> manifestIdListHomo = paramsManifestEOMapper.listInfoHomo(loginUser.getId(), ManifestStateEnum.COLLECTING.getValue());// 获取当前登录人 拥有认证工程师角色的清单
for(ParamsManifestTodoCenterEO paramsManifestEO : paramsManifestEOListAll) {
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseList.stream().filter(e -> e.getId().equals(paramsManifestEO.getProjectId())).collect(Collectors.toList());
List<String> userNameList = new ArrayList<>();
if(ObjectUtil.isNotEmpty(libraryBaseList)){
String certificationEngineer = libraryBaseList.get(0).getCertificationEngineer();
if(StringUtils.isNotBlank(certificationEngineer)){
List<SysUser> sysUserList = sysUserService.querySysUserListByIdList(Arrays.asList(certificationEngineer.split(",")));
userNameList = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList());
}
}
// 查询清单的所有参数项
List<ParamsCollectManifestEO> pcmList = pcmListAll.stream().filter(e->paramsManifestEO.getId().equals(e.getParamsManifestId())).collect(Collectors.toList());
int count1 = (int) pcmList.stream().filter(e-> CollectManifestStateEnum.SUBMIT.getValue().equals(e.getState())
@@ -67,34 +95,40 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
if (count1 == pcmList.size()) {
continue;
}
int count = 0;
if(CollectionUtil.isNotEmpty(manifestIdListHomo) && manifestIdListHomo.contains(paramsManifestEO.getId())) { // 认证工程师 可以看到三种数量
// 统计待发起数量 包括状态待发起收集,变更,工程接口人退回
count = (int) pcmList.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
if (count > 0) {
paramsManifestEO.setWaitCollectNum(count);
if(ObjectUtil.isNotEmpty(userNameList)){
// 统计待发起数量 包括状态待发起收集,变更,工程接口人退回
List<String> finalUserNameList = userNameList;
count = (int) pcmList.stream().filter(e -> finalUserNameList.contains(loginUser.getUsername()) && CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
if (count > 0) {
paramsManifestEO.setWaitCollectNum(count);
}
}
// 统计待分配数量 包括状态待工程接口人处理,填写人退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
count = (int) pcmList.stream().filter(e->loginUser.getUsername().equals(e.getSdt())
&& (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))).count();
if (count > 0) {
paramsManifestEO.setWaitSdtNum(count);
}
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
count = (int) pcmList.stream().filter(e-> loginUser.getUsername().equals(e.getDre())
&&(CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
if (count > 0) {
paramsManifestEO.setWaitFillNum(count);
}
paramsManifestEO.setFlag(FlagEnum.ZERO.getValue());
} else { // 工程接口只能看到工程接口人是自己的填写人只能看到填写人是自己 的数量
// 统计待分配数量 包括状态待工程接口人处理,填写人退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
count = (int) pcmList.stream().filter(e->loginUser.getUsername().equals(e.getSdt())
&& (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))
&& loginUser.getUsername().equals(e.getSdt())).count();
if (count > 0) {
@@ -102,12 +136,14 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC
}
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
count = (int) pcmList.stream().filter(e->loginUser.getUsername().equals(e.getDre())
&& (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))
&& (loginUser.getUsername().equals(e.getDre()) || loginUser.getUsername().equals(e.getSdt()))).count();
if (count > 0) {
paramsManifestEO.setWaitFillNum(count);
}
paramsManifestEO.setFlag(FlagEnum.ONE.getValue());
}
File diff suppressed because it is too large Load Diff
+15 -3
View File
@@ -775,6 +775,7 @@ module.exports = {
// 参数收集
MaintainConfigureInfo: '维护配置信息',
ParameteItemCollectionList: '参数项收集清单',
ParameteItemReportList:'参数上报库清单',
ParameterViewPage: '参数项查看页',
Areyousureparameteritems: '确认提交所选参数项嘛?',
Theselectedconfiguration: '参数清单中参数项均为待发起收集或变更时才能添加配置',
@@ -1811,6 +1812,7 @@ module.exports = {
expeditionProcess: '催办流程',
thereAreCurrentlyNoRegulationsToHandle: '当前没有可处理的法规',
certificationSubmission: '认证提交',
certificationSubmissionEndTime:'认证提交截止时间',
upgradecompletion: '升级完成情况',
implementedupgrade: '实施的升级是否和备案一致',
numberofvehicles: '完成升级的车辆数',
@@ -1894,7 +1896,7 @@ module.exports = {
lidar:'激光雷达',
history:'历史',
deliveryDate:'交付日期',
regulatoryEngineerReturns:'法规工程师退回',
regulatoryEngineerReturns:'法规退回',
designProcessStatus:'设计流程状态',
verifyProcessStatus:'验证流程状态',
design:'设计',
@@ -3778,6 +3780,7 @@ module.exports = {
andPendingSubmissionReviewReturned: '并且流程状态为结果待提交审查退回',
deliverablesFor: '的交付结果',
dutyPersonRejected: '责任人拒绝',
acceptanceTheResponsiblePerson:'责任人接受',
theCurrentlySelectedDataContainsReviewed: '当前选择的数据中包含审查通过的数据确认退回吗',
reviewTheReasonForReturn: '审查退回原因',
reasonForTaskRejection: '任务拒绝原因',
@@ -3800,7 +3803,7 @@ module.exports = {
lidar:'激光雷达',
history:'历史',
deliveryDate:'交付日期',
regulatoryEngineerReturns:'法规工程师退回',
regulatoryEngineerReturns:'法规退回',
designProcessStatus:'设计流程状态',
verifyProcessStatus:'验证流程状态',
design:'设计',
@@ -3946,7 +3949,7 @@ module.exports = {
Processdetails:'流程详情',
matchempty:'匹配项为空',
platformitemhasbeenassociated:'已关联平台件项目',
power:'功率',
power:'特征参数',
producer:'生产商',
Nameplatelabel:'铭牌标签',
Batteryfilingrecord:'电池备案记录',
@@ -3975,4 +3978,13 @@ module.exports = {
Filingcompletiontime:'备案完成时间',
Platformdevelopmentvalvepoint:'平台件开发阀点',
Compliancemanagementvalvepoint:'合规管理阀点',
designTaskValidation:'设计任务确认',
verificationTaskValidation:'验证任务确认',
platformType:'平台件类型',
extensionItems:'扩展任务数量',
problemPriority:'问题优先级',
high:'高',
centre:'中',
low:'低',
interfacePerson:'接口人',
}
@@ -14,11 +14,29 @@
<a-form-model-item ref='region' :label="$t('NareaOfResponsibility')" prop='dutyTerritory'>
<j-dict-select-tag class="box-input" v-model="form.dutyTerritory"
@input="handleInput('dutyTerritory')"
@changeQuery="handleChange"
:placeholder="$t('PleaseSelect')+$t('NareaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item :label="$t('interfacePerson')" prop='sdt'>
<a-select
class="box-input"
v-model="form.sdt"
:placeholder="$t('PleaseSelect')+$t('interfacePerson')">
<a-select-option
v-for="(item,index) in sdtList"
:key="item.id"
:value="item.id">
<span class="itemOption" :title="item.userName">
{{ item.userName}}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
<div class="imports-footer">
@@ -30,10 +48,10 @@
</div>
</div>
</a-spin>
<!-- <div class='drawer-bootom-button'>-->
<!-- <a-button style='margin-right: 8px' @click='handleCancel'>{{ $t('cancel') }}</a-button>-->
<!-- <a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>-->
<!-- </div>-->
<!-- <div class='drawer-bootom-button'>-->
<!-- <a-button style='margin-right: 8px' @click='handleCancel'>{{ $t('cancel') }}</a-button>-->
<!-- <a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>-->
<!-- </div>-->
<!-- 错误数据提示-->
<a-modal
:title="$t('operationFailed')"
@@ -49,9 +67,9 @@
<div style='font-size: 18px;margin-bottom: 20px;display: flex;justify-content: center'
class="box-title-text-index" v-for='(item,key) in NotSelectedRowKeysValue'>
<span v-html='item'></span>
<!-- <div>{{$t('NiOnumberis')}}{{ item.nioNumber }},{{$t('Statusis')}}-->
<!-- <span style='color: red'>{{ item.state }}</span>,{{$t('NoOperationPermissionForthisbutton')}}-->
<!-- </div>-->
<!-- <div>{{$t('NiOnumberis')}}{{ item.nioNumber }},{{$t('Statusis')}}-->
<!-- <span style='color: red'>{{ item.state }}</span>,{{$t('NoOperationPermissionForthisbutton')}}-->
<!-- </div>-->
</div>
</a-col>
</a-row>
@@ -66,235 +84,260 @@
</template>
<script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import moment from 'moment'
import eventBUs from '../../common/event'
export default {
name: 'diolagArea',
components: {},
data() {
return {
token:Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
loading: false,
editId: '',
visibleoperationFailed:false,
newVisible: false,
textLoading:false,
NotSelectedRowKeysValue:[],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import moment from 'moment'
import eventBUs from '../../common/event'
export default {
name: 'diolagArea',
components: {},
data() {
return {
token: Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
sdtList: [],
loading: false,
editId: '',
visibleoperationFailed: false,
newVisible: false,
textLoading: false,
NotSelectedRowKeysValue: [],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
rules: {
dutyTerritory: [
{ required: true, message: this.$t('PleaseSelect') + this.$t('NareaOfResponsibility'), trigger: 'change' }
]
},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
pageNo: 1,
pageSize: 10,
pickerDate: '',
bodystyle: {}
}
},
props: {
selectedRowKeysArray: {
type: String,
default: '',
require: true
}
},
mounted() {
this.bodystyle = {
height: '480px',
overflow: 'hidden',
overflowY: 'scroll'
}
},
methods: {
handleInput(value) {
this.$nextTick(() => {
this.form = { ...this.form }
this.$refs.ruleForm.validateField([value])
})
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
rules: {
dutyTerritory:[
{ required: true, message: this.$t('PleaseSelect')+this.$t('NareaOfResponsibility'), trigger: 'change' }
]
},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
pageNo: 1,
pageSize: 10,
pickerDate: '',
bodystyle:{}
}
},
props: {
selectedRowKeysArray: {
type: String,
default: '',
require: true
}
},
mounted() {
this.bodystyle = {
height: '480px',
overflow: 'hidden',
overflowY: 'scroll',
}
},
methods: {
handleInput(value) {
this.$nextTick(() => {
handleChange(value) {
this.form.sdt = undefined
this.form = { ...this.form }
this.$refs.ruleForm.validateField([value])
})
},
handleCancel() {
this.$emit('AdjustareasofresponAll', false)
},
//保存
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if(valid){
let long = localStorage.getItem('language')
let cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
// let _array = []
// this.selectedRowKeysValue.forEach((item, index) => {
// _array.push(item.id)
// })
let _this = this
let param = {
paramsManifestId: this.$route.query.id,
projectId: this.$route.query.projectId,
ids: this.selectedRowKeysArray,
cut: this.cut,
dutyTerritory: this.form.dutyTerritory
}
this.textLoading = true
postAction('/params/collectManifest/updateBatchDutyTerritory', param).then((res) => {
if (res.success) {
if(res.result.length == 0){
this.visibleoperationFailed = false
this.textLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.$emit('AdjustareasofresponAll', false)
this.$emit('GetgetTableList')
}else{
this.NotSelectedRowKeysValue = res.result
this.visibleoperationFailed = true
this.textLoading = false
}
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
this.getSdtList(this.form.dutyTerritory)
},
getSdtList(value) {
let query = {
dutyTerritory: value,
projectId: this.$route.query.projectId,
projectVersion: this.$route.query.projectVersion
}
})
},
// 错误数据的弹框
cancleoperationFailed() {
this.visibleoperationFailed = false
this.$emit('AdjustareasofresponAll', false)
this.$emit('GetgetTableList')
},
getAction('/params/collectManifest/getSdtList', query).then((res) => {
if (res.success) {
this.sdtList = res.result || []
} else {
this.sdtList = []
}
})
},
handleCancel() {
this.$emit('AdjustareasofresponAll', false)
},
//保存
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let long = localStorage.getItem('language')
let cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
// let _array = []
// this.selectedRowKeysValue.forEach((item, index) => {
// _array.push(item.id)
// })
let _this = this
let param = {
paramsManifestId: this.$route.query.id,
projectId: this.$route.query.projectId,
ids: this.selectedRowKeysArray,
cut: this.cut,
dutyTerritory: this.form.dutyTerritory,
sdt: this.form.sdt
}
this.textLoading = true
postAction('/params/collectManifest/updateBatchDutyTerritory', param).then((res) => {
if (res.success) {
if (res.result.length == 0) {
this.visibleoperationFailed = false
this.textLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.$emit('AdjustareasofresponAll', false)
this.$emit('GetgetTableList')
} else {
this.NotSelectedRowKeysValue = res.result
this.visibleoperationFailed = true
this.textLoading = false
}
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
},
// 错误数据的弹框
cancleoperationFailed() {
this.visibleoperationFailed = false
this.$emit('AdjustareasofresponAll', false)
this.$emit('GetgetTableList')
}
}
}
}
</script>
<style lang='less' scoped>
@import '~@assets/less/common.less';
.box-title-text-index {
line-height: 1.4;
display: flex;
}
.diolag-area {
.table-area {
margin: 20px 0;
@import '~@assets/less/common.less';
.action-edit {
margin-right: 10px;
.box-title-text-index {
line-height: 1.4;
display: flex;
}
.diolag-area {
.table-area {
margin: 20px 0;
.action-edit {
margin-right: 10px;
}
}
.table-del {
color: red;
}
}
.table-del {
color: red;
.drawer-bootom-button {
display: flex;
justify-content: center;
}
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
</style>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.formAdd {
margin-bottom: 40px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index:100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
/deep/.add-input{
min-height: 135px!important;
}
::v-deep .page{
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
/deep/ .add-input {
min-height: 135px !important;
}
::v-deep .page {
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
</style>
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
}
</style>
@@ -215,6 +215,9 @@
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<Standardselection :query="item"
:disabled="disabled"
:standard="formInline"
:standardId="formInline[item.db_field_name+'_id']"
@change="StandardselectionChange"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
@@ -283,6 +286,10 @@
this.getForm()
},
methods: {
StandardselectionChange(value, id) {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
sumber() {
// console.log('vilidate',this.formInline)
this.$refs.ruleForm1.validate(valid => {
@@ -207,6 +207,9 @@
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<Standardselection :query="item"
:disabled="disabled"
:standard="formInline"
:standardId="formInline[item.db_field_name+'_id']"
@change="StandardselectionChange"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
@@ -305,6 +308,10 @@
// console.log('idssss111',this.ids)
},
methods: {
StandardselectionChange(value, id) {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
sumber() {
// console.log('vilidate',this.formInline)
this.$refs.ruleForm1.validate(valid => {
@@ -1,13 +1,27 @@
<template>
<div>
<div class="box-title-text">
<a-input class="box-input" :value="value" :title="value" @input="indexclick($event)"
:disabled="isDisabled"
:placeholder="!isDisabled?$t('PleaseEnterOrSelect')+query.db_field_txt:query.db_field_txt"/>
<a-button v-if="!isDisabled" type="primary" class="button-box" @click="standardClick">
{{this.$t('standardSelection')}}
</a-button>
</div>
<div class="box-stand-select">
<a-select
class="box-input-select"
v-model="arrayValue"
@change="selectOnChange"
:placeholder="!isDisabled?$t('PleaseSelect')+query.db_field_txt:query.db_field_txt"
mode="multiple"
:getPopupContainer="triggerNode=> triggerNode.parentNode">
<a-select-option
v-for="(item,index) in dictOptions"
:key="index"
:value="item.id">
<span class="itemOption" :title="item.standNumber">
{{ item.standNumber }}
</span>
</a-select-option>
</a-select>
<!-- <a-input class="box-input" :value="value" :title="value" @input="indexclick($event)"-->
<!-- :disabled="true"-->
<!-- :placeholder="!isDisabled?$t('PleaseSelect')+query.db_field_txt:query.db_field_txt"/>-->
<a-button v-if="!isDisabled" type="primary" :title="$t('standardSelection')" class="button-box" @click="standardClick">
{{this.$t('standardSelection')}}
</a-button>
<a-drawer
:title="$t('standardSelection')"
:maskClosable="false"
@@ -28,7 +42,7 @@
<a-table
:components="drag(columns,'cloumns')"
:columns="columns"
rowKey="serial_number"
:rowKey="(record)=>record.id+'-'+record.serial_number"
:scroll="{x: 1500}"
:data-source="dataList"
:pagination="false"
@@ -68,7 +82,7 @@
components: {
currencySearch
},
props: ['query', 'value', 'standard'],
props: ['query', 'value', 'standard', 'standardId'],
computed: {
isDisabled() {
if (this.query.db_field_name === 'replaced_standard') {
@@ -77,13 +91,14 @@
return false
}
},
mixins: [ResizeColumnProvide,ResizeHeader],
mixins: [ResizeColumnProvide, ResizeHeader],
data() {
return {
visible: false,
dictOptions: [],
arrayValue: !this.value ? [] : this.value.split(','),
confirmLoading: false,
selectedRowKeys: [],
selectedRowList: [],
content: [],
loading: false,
queryParam: {},
@@ -125,22 +140,44 @@
standardClick() {
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.content = []
this.pageNo = 1
if (this.standardId) {
this.getQueryListByIds(this.standardId)
}
this.replacePage()
},
getQueryListByIds(ids) {
getAction('/document/bussDocumentLibraryEO/queryListByIds', { ids: ids }).then((res) => {
if (res.success) {
if (res.result && res.result.length > 0) {
let content = []
res.result.forEach(val => {
this.content.push(val)
this.dictOptions.push({
id: val.id,
standNumber: val.serial_number
})
content.push(val.id + '-' + val.serial_number)
})
this.selectedRowKeys = content
}
}
})
},
replacePage() {
let query = {
...this.queryParam,
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.selectedRowKeys = []
this.loading = true
postAction('document/bussDocumentLibraryEO/replacePageInfo', query).then((res) => {
this.loading = false
if (res.success) {
this.dataList = res.result.records
this.total = res.result.total
this.selectedRowKeys = this.standard[this.query.db_field_name] ? this.standard[this.query.db_field_name].split(',') : []
} else {
this.dataList = []
}
@@ -150,18 +187,21 @@
this.visible = false
},
handleSubmit() {
let serial_number = []
let replace_standard_id = []
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
// let content = JSON.parse(JSON.stringify(this.selectedRowList))
this.selectedRowList.forEach(res => {
serial_number.push(res.serial_number)
replace_standard_id.push(res.id)
let number = []
let id = []
this.arrayValue = []
this.content.forEach(res => {
id.push(res.id)
number.push(res.serial_number)
this.dictOptions.push({
id: res.id,
standNumber: res.serial_number
})
this.arrayValue.push(res.id)
})
this.$emit('input', serial_number.join(','))
console.log(replace_standard_id)
this.$emit('change', this.query.db_field_name, replace_standard_id.join(','))
// this.$emit('changecontent', this.content)
this.$emit('input', number.join(','))
this.$emit('change', this.query.db_field_name, id.join(','))
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
@@ -170,19 +210,19 @@
indexclick(event) {
this.$emit('input', event.target.value)
},
onSelectChange(value,row) {
console.log(value)
console.log(row)
onSelectChange(value, row) {
this.selectedRowKeys = value
this.selectedRowList = row
// this.content = []
// value.forEach(val => {
// this.dataList.forEach((res) => {
// if (res.id === val) {
// this.content.push(res)
// }
// })
// })
this.content = []
this.selectedRowKeys.forEach(res => {
let index = res.indexOf('-')
let index1 = res.length
let id = res.slice(0, index)
let standNumber = res.slice(index + 1, index1)
this.content.push({
id: id,
serial_number: standNumber
})
})
},
searchQuery(queryParam) {
let queryParamQuery = JSON.parse(JSON.stringify(queryParam))
@@ -206,6 +246,38 @@
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
selectOnChange(value) {
let content = []
let standNumber = []
this.content = []
let newArr = []
let dictOptions = JSON.parse(JSON.stringify(this.dictOptions))
if (value.length == 0) {
this.dictOptions = []
} else {
for (let i = 0; i < value.length; i++) {
for (let j = 0; j < dictOptions.length; j++) {
if (dictOptions[j].id === value[i]) {
newArr.push(dictOptions[j])
}
}
}
}
this.dictOptions = newArr
if (this.dictOptions && this.dictOptions.length > 0) {
this.dictOptions.forEach(val => {
content.push(val.id)
standNumber.push(val.standNumber)
this.content.push({
id: val.id,
serial_number: val.standNumber
})
})
}
this.$emit('input', standNumber.join(','))
this.$emit('change', this.query.db_field_name, content.join(','))
this.arrayValue = content
}
}
}
@@ -227,7 +299,10 @@
margin-left: 10px;
height: 38px;
line-height: 38px;
display: inline-block;
width: 80px;
overflow: hidden;
padding: 0;
}
.drawer-bootom-button {
@@ -257,11 +332,11 @@
margin-right: 16px;
}
.box-input-index {
.box-input-select {
display: inline-block;
width: 80%;
width: calc(100% - 90px);
height: 38px;
margin-top: 2px;
float: left;
}
.box-button {
@@ -274,15 +349,33 @@
margin-top: 20px;
}
/deep/.ant-table-thead > tr > th {
/deep/ .ant-table-thead > tr > th {
font-weight: bolder;
}
/*/deep/.ant-table-tbody > tr > td {*/
/* color: #040B29 ;*/
/*}*/
::v-deep .box-input-select .ant-select-selection--multiple::-webkit-scrollbar {
/*height: 52px!important;*/
display: block;
}
.itemOption {
display: inline-block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
</style>
<style>
.box-stand-select .ant-select-dropdown--multiple {
display: none !important;
}
/*.ant-input-disabled{*/
/* background-color: #f5f5f5!important;*/
/*}*/
-504
View File
@@ -1,504 +0,0 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" v-if="isFormInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<div v-for="(item,index) in dataList" :key="index">
<a-col :span="12" v-if="item.field_show_type === '1' || item.field_show_type === '11'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline[item.db_field_name]"
:placeholder="$t('PleaseEnter')+item.db_field_txt"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === '2'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-input-number class="box-input"
:placeholder="$t('PleaseEnter')+item.db_field_txt"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :min="1" :max="99999999"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === '3'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-dict-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === '4'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel-multi" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
:type="'select'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === '5'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
@change="dateChange(item)"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
v-model="formInline[item.db_field_name]"
:disabled="disabled"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === '6'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-range-picker class="box-input" v-model="formInline[item.db_field_name]"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
:disabled="disabled"
@change="onChange(item.db_field_name)"></a-range-picker>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === '7'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload(item.db_field_name)">
{{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === '8'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-textarea
:placeholder="$t('PleaseEnter')+item.db_field_txt"
:disabled="disabled"
v-model="formInline[item.db_field_name]" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === '9'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<PersonnelSelection :query="item"
:disabled="disabled"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.field_show_type === '10'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<StandardSelection :query="item"
:disabled="disabled"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'RADIO'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-dict-select-tag v-model="formInline[item.db_field_name]"
:disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('selectStatus')"
:type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === '0'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-tree-select
tree-node-filter-prop="title"
v-model="formInline[item.db_field_name]"
:maxTagCount="1"
style="width: 100%"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
:tree-data="item.tree"
tree-checkable
:placeholder="$t('PleaseSelect')+item.db_field_txt"
/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.field_show_type === 'CHECKBOX'">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="item.field_must_input == 0">*</span>
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div>
<a-form-model-item class="itemModel-multi" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'checkbox'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
</a-col>
</div>
</a-row>
<uploadFile ref="uploadFile" :disabled="disabled" @uploadSuccess="uploadSuccess"></uploadFile>
</a-form-model>
</a-spin>
</template>
<script>
import uploadFile from '@/components/uploadFile/file'
import StandardSelection from '@/components/Standardselection/index'
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction } from '@/api/manage'
import eventBUs from '../../common/event'
import moment from 'moment'
export default {
name: 'index',
components: {
uploadFile,
StandardSelection,
PersonnelSelection
},
props: {
url: {
type: Object,
default: {}
},
flag: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
formInline: {},
isFormInline: false,
rules: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 17 }
},
dataList: [],
ruleList: [],
validatorRules: {},
confirmLoading: false,
uploadName: ''
}
},
mounted() {
this.getForm()
},
methods: {
sumber() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
if (this.formInline.id) {
url = this.url.updateInfo
} else {
url = this.url.addInfo
}
postAction(url, this.formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
this.$emit('addFormClick')
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
} else {
return false
}
})
},
clickButtonToUpload(current) {
this.$refs.uploadFile.visible = true
this.uploadName = current
},
/** 上传文件的回调 */
uploadSuccess(data) {
let attIdList = []
data.map(item => {
attIdList.push(item.id || data.name)
})
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
IntegrateData() {
this.isFormInline = false
let rules = {}
this.ruleList.forEach((res, index) => {
const rule = []
if (res.field_must_input == 0) {
if (res.field_show_type === '1') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '4' || res.field_show_type === '6' ||
res.field_show_type === '5' || res.field_show_type === '7'
) {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change'
})
} else if (res.field_show_type === '2') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.field_show_type === '3') {
rule.push({
required: true,
message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'change'
})
}
}
if (res.field_show_type === '1' || res.field_show_type === '2' ||
res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10'
|| res.field_show_type === '11'){
rule.push({
max: res.db_length,
message: res.db_field_txt+'不能超出'+res.db_length+'个字符',
trigger: 'blur'
})
}
if (rule.length > 0) {
rules[res.db_field_name] = rule
}
})
this.$set(this, 'rules', rules)
this.isFormInline = true
this.confirmLoading = false
},
getForm() {
this.confirmLoading = true
let params = {
flag: this.flag
}
getAction(this.url.getAddForm, params).then((res) => {
if (res.success) {
this.dataList = res.result
this.ruleList = res.result
this.IntegrateData()
}
})
},
dateChange(item) {
this.formInline[item.db_field_name] = moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD')
},
onChange(item) {
let dateOne = moment(this.formInline[item][0]).format('YYYY-MM-DD')
let dateTwo = moment(this.formInline[item][1]).format('YYYY-MM-DD')
this.formInline[item] = [dateOne, dateTwo]
},
edit(item) {
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
if (res.success) {
this.formInline = res.result[0]
}
})
},
add() {
this.formInline = {}
}
}
}
</script>
<style>
.formAdd .ant-form-item-label {
width: 130px;
}
.formAdd .ant-form-item-control-wrapper {
display: inline-block;
width: 100%;
}
.itemModel .ant-form-item-control-wrapper {
width: 100%;
}
.box-input .ant-select-selection--single {
height: 38px;
}
.box-input .ant-select-selection--multiple {
height: 38px;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
margin-top: 6px;
}
.box-input .ant-calendar-picker {
line-height: 38px;
height: 38px;
}
.box-input .ant-calendar-picker-input {
height: 38px;
}
.box-input .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}
</style>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
}
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 42px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.button-text {
height: 38px;
width: calc(100% - 120px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
</style>
@@ -169,6 +169,7 @@
<Standardselection :query="item"
:disabled="disabled"
:standard="formInline"
:standardId="formInline[item.db_field_name+'_id']"
@change="StandardselectionChange"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
@@ -834,7 +835,6 @@
this.getForm()
},
StandardselectionChange(value, id) {
console.log(id)
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
@@ -1,22 +1,22 @@
<template>
<a-table
:components="drag(columnshistory,'columnshistory')"
class="table"
:columns="columnshistory"
:pagination="false"
:scroll="{x: '100%',y: 400}"
:data-source="dataSourcehistory"
:loading="loading"
:components="drag(columnshistory,'columnshistory')"
class="table"
:columns="columnshistory"
:pagination="false"
:scroll="{x: '100%',y: 400}"
:data-source="dataSourcehistory"
:loading="loading"
>
<span slot="content" slot-scope="text,record">
<a-tooltip placement="topLeft">
<a-tooltip overlayClassName="columnshistory" placement="topLeft">
<template slot="title">
<span v-html="text"></span>
</template>
<span v-html="text"></span>
</a-tooltip>
</span>
<span slot="detailText" slot-scope="text,record">
<span slot="detailText" slot-scope="text,record">
<span class="text" :title="text">
{{text && text.length > 10?text.slice(0,9)+'...':text}}
</span>
@@ -26,14 +26,20 @@
<script>
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'historyTable.vue',
props:['columnshistory','dataSourcehistory'],
mixins:[ResizeHeader, ResizeColumnProvide],
}
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'historyTable.vue',
props: ['columnshistory', 'dataSourcehistory'],
mixins: [ResizeHeader, ResizeColumnProvide]
}
</script>
<style scoped>
</style>
<style>
.columnshistory .ant-tooltip-inner {
color: #333!important;
}
</style>
@@ -554,7 +554,22 @@
callback && callback(formInline)
}
})
}
},
save(callback){
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
if (!formInline.state || formInline.state == '' || formInline.state == 'null') {
formInline.state = ''
}
if (!formInline.useMethod || formInline.useMethod == '' || formInline.useMethod == 'null') {
formInline.useMethod = ''
}
callback && callback(formInline)
},
}
}
</script>
@@ -98,6 +98,7 @@
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: 8px" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button style="margin-right: 8px" @click="handleSave">{{$t('preservation')}}</a-button>
<a-button @click="handleSubmit" v-if="!disabled" type="primary" :loading="confirmLoading">{{$t('submit')}}
</a-button>
</div>
@@ -266,6 +267,51 @@
this.formInline.memoriesChapter = value
this.formInline = { ...this.formInline }
},
handleSave(){
let text = ''
if (this.$refs.defaultTemplateRef) {
text = 'defaultTemplateRef'
} else if (this.$refs.solicitOpinionsRef) {
text = 'solicitOpinionsRef'
} else if (this.$refs.releaseStandardRef) {
text = 'releaseStandardRef'
} else if (this.$refs.industryTemplateRef) {
text = 'industryTemplateRef'
}
this.$refs[text].save((val) => {
this.confirmLoading = true
let url = ''
if (this.formInline.id) {
url = this.url.edit
} else {
url = this.url.add
}
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
let query = Object.assign(val, {
month: formInline.month,
memoriesChapter: formInline.memoriesChapter,
contentTemplate: formInline.contentTemplate,
memoriesChapterOne:formInline.memoriesChapterOne,
saveState:0,
})
postAction(url, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('fillAddForm')
} else {
this.confirmLoading = false
this.$message.warning(this.$t('operationFailed'))
}
})
})
},
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
@@ -297,7 +343,8 @@
month: formInline.month,
memoriesChapter: formInline.memoriesChapter,
contentTemplate: formInline.contentTemplate,
memoriesChapterOne:formInline.memoriesChapterOne
memoriesChapterOne:formInline.memoriesChapterOne,
saveState:1,
})
postAction(url, query).then((res) => {
if (res.success) {
@@ -296,7 +296,16 @@
callback && callback(formInline)
}
})
}
},
save(callback){
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
callback && callback(formInline)
},
}
}
</script>
@@ -173,7 +173,14 @@
callback && callback(query)
}
})
}
},
save(callback){
let query = {
id: this.formInline.id,
newStandardTemplateEOList: this.formInline.dataList
}
callback && callback(query)
},
}
}
</script>
@@ -152,7 +152,14 @@
callback && callback(query)
}
})
}
},
save(callback){
let query = {
id: this.formInline.id,
newOpinionTemplateEOList: this.formInline.dataList
}
callback && callback(query)
},
}
}
</script>
-88
View File
@@ -1,88 +0,0 @@
<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<search :flag="'1'" :url="url" :searchList="searchList"/>
</div>
<div class="table-operator">
<a-button @click="handleCompare()" type="primary" icon="plus">{{$t('DataComparison')}}</a-button>
</div>
<div>
<tableData
:flag="'1'"
:OperationList="OperationList"
@editTable="editTable"
@deleteTable="deleteTable"
:url="url"
/>
</div>
<addForm ref="addFormClick"/>
</a-card>
</template>
<script>
import search from '@/components/search/index'
import tableData from '@/components/tableDate/index'
import { JeroListMixin } from '@/mixins/JeroListMixin'
import addForm from './modules/addForm'
export default {
name: 'index',
// mixins: [JeroListMixin],
components: {
search,
addForm,
tableData
},
data() {
return {
searchList: [
{ name: '名称', placeholder: '请输入姓名', attrModel: 'name', enName: 'title' },
{ name: '标题', placeholder: '请输入标题', attrModel: 'title', enName: 'title' }
],
OperationList: [
{
text: '编辑',
ClickEvent: 'editTable'
},
{
text: '删除',
ClickEvent: 'deleteTable'
},
{
text: '收藏',
ClickEvent: 'Collection'
},
{
text: '订阅',
ClickEvent: 'subscribe'
}
],
selectedRowKeys: [],
loading: false,
url:{
tableHeader:'document/bussDocumentLibraryEO/getHeader',
seachList:'document/bussDocumentLibraryEO/queryCondition',
tableList:'/document/bussDocumentLibraryEO/queryPageInfo',
}
}
},
methods: {
onSelectChange() {
},
handleCompare() {
this.$refs.addFormClick.add()
},
editTable(item) {
console.log(item)
},
deleteTable(){
console.log(3)
},
}
}
</script>
<style scoped>
</style>
@@ -1,74 +0,0 @@
<template>
<a-drawer
:title="title"
:maskClosable="true"
:width="drawerWidth"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<addFormData
ref="addFormDataRef"
isDisplayType
v-if="visible"
:url="url"
/>
<div class="drawer-bootom-button">
<a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"
:cancelText="$t('cancel')">
<a-button style="margin-right: 8px">{{$t('cancel')}}</a-button>
</a-popconfirm>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import addFormData from '@/components/addForm/index'
export default {
name: 'addForm',
components: {
addFormData
},
data() {
return {
title: '添加',
drawerWidth: 1000,
visible: false,
confirmLoading: false,
url: {}
}
},
methods: {
handleCancel() {
this.visible = false
},
add() {
this.visible = true
},
edit() {
this.visible = true
},
handleSubmit() {
this.$refs.addFormDataRef.sumber()
}
}
}
</script>
<style scoped>
.drawer-bootom-button {
position: absolute;
bottom: 0;
z-index:100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
@@ -173,6 +173,8 @@
<Standardselection :query="item"
:disabled="disabled"
:standard="formInline"
:standardId="formInline[item.db_field_name+'_id']"
@change="StandardselectionChange"
v-model="formInline[item.db_field_name]"/>
</a-form-model-item>
</div>
@@ -626,6 +628,10 @@
this.loadFormInfo()
},
methods:{
StandardselectionChange(value, id) {
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
loadData(){
this.loading=true
getAction(`split/sarFileSplitItemsVal/getItemsValList`,{itemId:this.itemId}).then(res=>{
@@ -692,10 +698,11 @@
this.deleteIds.push(item.id)
}
for(let i=index;i<this.contentList.length-1;i++){
this.contentList[index]=this.contentList[index+1]
}
this.contentList.pop()
// for(let i=index;i<this.contentList.length-1;i++){
// this.contentList[index]=this.contentList[index+1]
// }
this.contentList.splice(index,1)
// this.contentList.pop()
// console.log('this.content',this.contentList)
},
//保存
@@ -674,7 +674,7 @@
this.conList = res.result.records
if (this.conList && this.conList.length > 0) {
this.conList.forEach(val => {
val.content = val.content.replace(/<img .*?>/g, '')
val.content = val.content ? val.content.replace(/<img .*?>/g, '') : ''
})
}
this.total = res.result.total
@@ -202,7 +202,7 @@
this.conList = res.result.records
if (this.conList && this.conList.length > 0) {
this.conList.forEach(val => {
val.content = val.content.replace(/<img .*?>/g, '')
val.content = val.content ? val.content.replace(/<img .*?>/g, '') :''
})
}
this.total = res.result.total
@@ -254,8 +254,8 @@
this.conList = res.result.records
if (this.conList && this.conList.length > 0) {
this.conList.forEach(val => {
val.content = val.content.replace(/<img .*?>/g, '')
val.content = val.content.replace(/<\/?p[^>]*>/gi, '')
val.content = val.content ? val.content.replace(/<img .*?>/g, '') : ''
val.content = val.content ? val.content.replace(/<\/?p[^>]*>/gi, '') : ''
})
}
this.total = res.result.total
@@ -211,7 +211,7 @@ export default {
this.getList()
},
getText(str) {
let words = str.replace(/<[^<>]+>/g, '').replace(/&nbsp;/gi, '') //这里是去除标签
let words = str ? str.replace(/<[^<>]+>/g, '').replace(/&nbsp;/gi, '') : ''//这里是去除标签
//.replace(/\s/g, '') //这里是去除空格
return words
},
@@ -234,8 +234,8 @@ export default {
this.conList = res.result.records
if (this.conList && this.conList.length > 0) {
this.conList.forEach(val => {
val.content = val.content.replace(/<img .*?>/g, '')
val.content = val.content.replace(/<\/?p[^>]*>/gi, '')
val.content = val.content ? val.content.replace(/<img .*?>/g, '') :''
val.content = val.content ? val.content.replace(/<\/?p[^>]*>/gi, '') : ''
})
}
this.total = res.result.total
@@ -102,7 +102,6 @@
</div>
<a-form-model-item class="itemModel">
<j-dict-select-tag class="box-input" v-model="formInline.state"
:disabled="true"
@input="handleInput('state')"
:placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'"
@@ -123,6 +122,8 @@
:standard="formInline"
v-if="!disabled"
:disabled="disabled"
:standardId="formInline.correspondingStandardId"
@change="StandardselectionChange"
v-model="formInline.correspondingStandard"/>
<a-input class="box-input"
v-else
@@ -763,6 +764,10 @@
this.getFirstLevelDutyTerritory()
},
methods: {
StandardselectionChange(value, id) {
this.formInline.correspondingStandardId = id
this.formInline = { ...this.formInline }
},
DutyDepartChange(event) {
this.formInline.dutyTerritory = []
this.formInline = { ...this.formInline }

Some files were not shown because too many files have changed in this diff Show More