diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index b851236bb..0218449f1 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -622,3 +622,25 @@ INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `descrip -- 市场认证清单 增加字段 2023-04-17 未同步生产环境 ALTER TABLE `auth_dummy_inventory_info` ADD COLUMN `attestation_type` varchar(2000) NULL COMMENT '认证类型' AFTER `deliverable_template`; + +-- 市场法规清单 增加字段 2023-04-24 未同步生产环境 +ALTER TABLE `dummy_inventory_base` + ADD COLUMN `version_num` varchar(2000) NULL COMMENT '版本号' AFTER `dummy_inventory_info_id`, + ADD COLUMN `upgrade_explanation` varchar(2000) NULL COMMENT '升版说明' AFTER `version_num`; + +-- 市场认证清单 增加字段 2023-04-24 未同步生产环境 +ALTER TABLE `auth_dummy_inventory_base` + ADD COLUMN `version_num` varchar(2000) NULL COMMENT '版本号' AFTER `state`, + ADD COLUMN `upgrade_explanation` varchar(2000) NULL COMMENT '升版说明' AFTER `version_num`; + +-- 法规/认证任务计划 增加字段 2023-05-05 未同步生产环境 +ALTER TABLE `project_task_planning` + ADD COLUMN `zero` datetime(0) NULL COMMENT '概念验证阶段' AFTER `sys_org_code`, + ADD COLUMN `one` datetime(0) NULL COMMENT '初样阶段' AFTER `zero`, + ADD COLUMN `two` datetime(0) NULL COMMENT '工艺方案阶段' AFTER `one`, + ADD COLUMN `three` datetime(0) NULL COMMENT '零件试制阶段' AFTER `two`, + ADD COLUMN `four` datetime(0) NULL COMMENT '整车装配工艺方案阶段' AFTER `three`, + ADD COLUMN `five` datetime(0) NULL COMMENT '预生产阶段' AFTER `four`, + ADD COLUMN `six` datetime(0) NULL COMMENT '试产阶段' AFTER `five`, + ADD COLUMN `seven` datetime(0) NULL COMMENT '小批量生产阶段' AFTER `six`, + ADD COLUMN `eight` datetime(0) NULL COMMENT '大规模生产阶段' AFTER `seven`; \ No newline at end of file diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysDictItem.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysDictItem.java index 5dad3661e..b7043d695 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysDictItem.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysDictItem.java @@ -112,6 +112,13 @@ public class SysDictItem implements Serializable { @ApiModelProperty(value = "字典英文名称") private String enName; + /** + * 统计节点(主要为责任领域) + */ + @Excel(name = "统计节点", width = 15) + @ApiModelProperty(value = "统计节点") + private String statNode; + @TableField(exist = false) private String cut; } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java index 30e9d7eed..4487a3877 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java @@ -4,6 +4,7 @@ import com.jero.modules.system.entity.SysDictItem; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; +import java.util.Map; /** *

@@ -46,4 +47,12 @@ public interface ISysDictItemService extends IService { * @return */ String disposeShowDictItemText(List sysDictItems,String fieldTexts,String cut,String dicCode); + + /** + * 根据字典code获取一级数据字典 + * @param dictCode + * @param sysDictItems + * @return + */ + Map> getFirstLevelSysDictItemByDictCode(String dictCode,List sysDictItems); } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java index dc1122fe6..f0a7f27b6 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.constant.CommonConstant; import com.jero.common.constant.enums.CutEnum; +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; @@ -13,7 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -231,4 +234,27 @@ public class SysDictItemServiceImpl extends ServiceImpl> getFirstLevelSysDictItemByDictCode(String dictCode,List sysDictItems) { + List sysDictItemByDictCode = sysDictItems.stream().filter(sysDict -> { + boolean flag = false; + if (StringUtils.equals(sysDict.getDictCode(), dictCode)) { + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + Map> 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)); + } + return result; + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/entity/AuthDummyInventoryBaseEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/entity/AuthDummyInventoryBaseEO.java index 0b36891f8..564f3c378 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/entity/AuthDummyInventoryBaseEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/entity/AuthDummyInventoryBaseEO.java @@ -84,4 +84,16 @@ public class AuthDummyInventoryBaseEO implements Serializable { /**订阅标识*/ @TableField(exist = false) private String readFlag; + + /**版本号*/ + @ApiModelProperty(value = "版本号") + private String versionNum; + + /**升版说明*/ + @ApiModelProperty(value = "升版说明") + private String upgradeExplanation; + + // 是否升级 1是2否 + @TableField(exist = false) + private String upgradeOrNot; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java index 593bd08c9..dd55752ed 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java @@ -11,17 +11,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.constant.enums.YesOrNoEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.vo.LoginUser; -import com.jero.modules.authDummy.entity.AuthDummyContentChangeEO; -import com.jero.modules.authDummy.entity.AuthDummyInventoryBaseEO; -import com.jero.modules.authDummy.entity.AuthDummyInventoryInfoEO; -import com.jero.modules.authDummy.entity.AuthDummyReadEO; +import com.jero.modules.authDummy.entity.*; import com.jero.modules.authDummy.mapper.AuthDummyInventoryBaseEOMapper; -import com.jero.modules.authDummy.service.IAuthDummyContentChangeEOService; -import com.jero.modules.authDummy.service.IAuthDummyInventoryBaseEOService; -import com.jero.modules.authDummy.service.IAuthDummyInventoryInfoEOService; -import com.jero.modules.authDummy.service.IAuthDummyReadEOService; +import com.jero.modules.authDummy.service.*; import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl; import com.jero.modules.dummy.entity.DummyContentChangeEO; import com.jero.modules.dummy.entity.DummyInventoryBaseEO; @@ -29,8 +24,12 @@ import com.jero.modules.dummy.entity.DummyInventoryInfoEO; import com.jero.modules.dummy.entity.DummyReadEO; import com.jero.modules.dummy.enums.InventoryStateEnum; import com.jero.modules.dummy.enums.ReadFlagEnum; +import com.jero.modules.feishu.enums.TemplateInfoEnum2; import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.feishu.vo.FeishuMsgVo; +import com.jero.modules.log.entity.MarketListVersionUpdateLogEO; +import com.jero.modules.log.enums.ListTypeEnum; +import com.jero.modules.log.service.IMarketListVersionUpdateLogEOService; import com.jero.modules.system.entity.SysAnnouncement; import com.jero.modules.system.service.ISysAnnouncementService; import com.jero.modules.system.service.ISysUserService; @@ -43,10 +42,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Date; +import java.util.*; import java.util.stream.Collectors; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -94,6 +90,11 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl ids) { removeByIds(ids); + + // 市场认证清单明细数据 + QueryWrapper adiRemoveWrap = new QueryWrapper<>(); + adiRemoveWrap.lambda().in(AuthDummyInventoryInfoEO::getAuthDummyInventoryBaseId,ids); + this.iAuthDummyInventoryInfoEOService.remove(adiRemoveWrap); + + // 内容变更表数据 + QueryWrapper adccConnectIdRemoveWrap = new QueryWrapper<>(); + adccConnectIdRemoveWrap.lambda().in(AuthDummyContentChangeEO::getConnectId,ids); + this.iAuthDummyContentChangeEOService.remove(adccConnectIdRemoveWrap); + QueryWrapper adccPidRemoveWrap = new QueryWrapper<>(); + adccPidRemoveWrap.lambda().in(AuthDummyContentChangeEO::getParentId,ids); + this.iAuthDummyContentChangeEOService.remove(adccPidRemoveWrap); + + // 更新log数据 + QueryWrapper adlRemoveWrap = new QueryWrapper<>(); + adlRemoveWrap.lambda().in(AuthDummyLog::getAuthDummyInventoryBaseId,ids); + this.authDummyLogService.remove(adlRemoveWrap); + + // 订阅数据 + QueryWrapper adrRemoveWrap = new QueryWrapper<>(); + adrRemoveWrap.lambda().in(AuthDummyReadEO::getAuthDummyInventoryBaseId,ids); + this.authDummyReadEOService.remove(adrRemoveWrap); + + // 市场清单版本历史数据 + QueryWrapper mlvLogRemoveWrap = new QueryWrapper<>(); + mlvLogRemoveWrap.lambda().eq(MarketListVersionUpdateLogEO::getListType,ListTypeEnum.MARKET_CERTIFICATION_LIST.getValue()); + mlvLogRemoveWrap.lambda().in(MarketListVersionUpdateLogEO::getListId,ids); + this.marketListVersionUpdateLogEOService.remove(mlvLogRemoveWrap); } /** @@ -258,10 +288,24 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl wrapper =new LambdaQueryWrapper<>(); wrapper.in(AuthDummyContentChangeEO::getConnectId,authDummyInventoryBaseEO.getId()); @@ -395,8 +439,9 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl userNameList = authDummyReadEOService.queryReadUserInfo(authDummyInventoryBaseEO.getId()); List thirdIdList = new ArrayList<>(); + List userIdList = new ArrayList<>(); if(userNameList.size() != 0){ - List userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList()); + userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList()); thirdIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getThirdId()).collect(Collectors.toList()); if(userIdList.size() != 0){ //封装消息的实体类 @@ -418,15 +463,41 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl params = new HashMap<>(); + params.put("contentInfoFeiCn",contentInfoFeiCn + "\n" + contentCn); + params.put("contentInfoFeiEn",contentLogFeishuTemp + "\n" + contentEn); + params.put("userIdList",userIdList); + params.put("back_url",href); + params.put("titleCn", TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameCn()); + params.put("titleEn",TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameEn()); + iFeishuService.sendMessageSubscriptionNotification(TemplateInfoEnum2.SUBSCRIPTION_INFORM.getValue(),params); + } catch (Exception e) { e.printStackTrace(); } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java index 3d3f6db04..64eb78905 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java @@ -35,4 +35,6 @@ public interface ParamsCollectManifestEOMapper extends BaseMapper queryByProjectId(@Param("projectId") String projectId); + + List getList(@Param("params") Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml index a64c16f48..2d9e849f9 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml @@ -139,5 +139,8 @@ + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java index a7d0a23e0..5c11b45c7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java @@ -200,4 +200,6 @@ public interface IParamsCollectManifestEOService extends IService batchEditDeadline(ParamsCollectManifestVO paramsCollectManifestVO); + + List getList(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 273743f88..c33192062 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -7256,4 +7256,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl getList(Map params) { + List result = this.baseMapper.getList(params); + return result; + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index 180b20758..a01f25fa6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -4303,7 +4303,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl logEOQueryWrapper = new QueryWrapper<>(); logEOQueryWrapper.in("dummy_inventory_base_id",ids); dummyLogEOService.remove(logEOQueryWrapper); + + // 订阅数据 + QueryWrapper drRemoveWrap = new QueryWrapper<>(); + drRemoveWrap.lambda().in(DummyReadEO::getDummyInventoryBaseId,ids); + this.dummyReadEOService.remove(drRemoveWrap); + + // 市场清单版本历史数据 + QueryWrapper mlvLogRemoveWrap = new QueryWrapper<>(); + mlvLogRemoveWrap.lambda().eq(MarketListVersionUpdateLogEO::getListType,ListTypeEnum.MARKET_REGULATION_LIST.getValue()); + mlvLogRemoveWrap.lambda().in(MarketListVersionUpdateLogEO::getListId,ids); + this.marketListVersionUpdateLogEOService.remove(mlvLogRemoveWrap); } /** @@ -346,6 +363,20 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl发布 2-->撤回 //撤回需要发消息 - if(InventoryStateEnum.ISSUE.getValue().equals(dummyInventoryBaseEO.getState())){ + if(InventoryStateEnum.ISSUE.getValue().equals(dummyInventoryBaseEO.getState()) && StringUtils.equals(dummyInventoryBaseEO.getUpgradeOrNot(),YesOrNoEnum.YES.getValue())){ //先判断第一次发布的时候是否保存过数据 LambdaQueryWrapper wrapper =new LambdaQueryWrapper<>(); wrapper.in(DummyContentChangeEO::getConnectId,dummyInventoryBaseEO.getId()); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/controller/MarketListVersionUpdateLogEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/controller/MarketListVersionUpdateLogEOController.java new file mode 100644 index 000000000..5b309a684 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/controller/MarketListVersionUpdateLogEOController.java @@ -0,0 +1,170 @@ +package com.jero.modules.log.controller; + +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.jero.common.api.vo.Result; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.log.entity.MarketListVersionUpdateLogEO; +import com.jero.modules.log.service.IMarketListVersionUpdateLogEOService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import com.jero.common.system.base.controller.JeroController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.jero.common.aspect.annotation.AutoLog; + + + /** + * @Description: 市场清单版本更新log表 + * @Author: jero-boot + * @Date: 2023-04-24 + * @Version: V1.0 + */ +@Api(tags="市场清单版本更新log表") +@RestController +@RequestMapping("/log/marketListVersionUpdateLogEO") +@Slf4j +public class MarketListVersionUpdateLogEOController extends JeroController { + @Autowired + private IMarketListVersionUpdateLogEOService marketListVersionUpdateLogEOService; + + /** + * 分页列表查询 + * + * @param marketListVersionUpdateLogEO + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "市场清单版本更新log表-分页列表查询") + @ApiOperation(value="市场清单版本更新log表-分页列表查询", notes="市场清单版本更新log表-分页列表查询") + @GetMapping(value = "/page") + public Result queryPageList(MarketListVersionUpdateLogEO marketListVersionUpdateLogEO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(marketListVersionUpdateLogEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = marketListVersionUpdateLogEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "市场清单版本更新log表-列表查询") + @ApiOperation(value="市场清单版本更新log表-列表查询", notes="市场清单版本更新log表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List list = marketListVersionUpdateLogEOService.queryList(); + return Result.OK(list); + } + + /** + * 添加 + * + * @param marketListVersionUpdateLogEO + * @return + */ + @AutoLog(value = "市场清单版本更新log表-添加") + @ApiOperation(value="市场清单版本更新log表-添加", notes="市场清单版本更新log表-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody MarketListVersionUpdateLogEO marketListVersionUpdateLogEO) { + marketListVersionUpdateLogEOService.add(marketListVersionUpdateLogEO); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param marketListVersionUpdateLogEO + * @return + */ + @AutoLog(value = "市场清单版本更新log表-编辑") + @ApiOperation(value="市场清单版本更新log表-编辑", notes="市场清单版本更新log表-编辑") + @PutMapping(value = "/edit") + public Result edit(@Validated @RequestBody MarketListVersionUpdateLogEO marketListVersionUpdateLogEO) { + marketListVersionUpdateLogEOService.editById(marketListVersionUpdateLogEO); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "市场清单版本更新log表-通过id删除") + @ApiOperation(value="市场清单版本更新log表-通过id删除", notes="市场清单版本更新log表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + marketListVersionUpdateLogEOService.deleteById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "市场清单版本更新log表-批量删除") + @ApiOperation(value="市场清单版本更新log表-批量删除", notes="市场清单版本更新log表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.marketListVersionUpdateLogEOService.deleteByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "市场清单版本更新log表-通过id查询") + @ApiOperation(value="市场清单版本更新log表-通过id查询", notes="市场清单版本更新log表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + MarketListVersionUpdateLogEO marketListVersionUpdateLogEO = marketListVersionUpdateLogEOService.queryById(id); + if(marketListVersionUpdateLogEO==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(marketListVersionUpdateLogEO); + } + + /** + * 导出excel + * + * @param request + * @param marketListVersionUpdateLogEO + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, MarketListVersionUpdateLogEO marketListVersionUpdateLogEO) { + return super.exportXls(request, marketListVersionUpdateLogEO, MarketListVersionUpdateLogEO.class, "市场清单版本更新log表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, MarketListVersionUpdateLogEO.class); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/entity/MarketListVersionUpdateLogEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/entity/MarketListVersionUpdateLogEO.java new file mode 100644 index 000000000..421932ae8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/entity/MarketListVersionUpdateLogEO.java @@ -0,0 +1,81 @@ +package com.jero.modules.log.entity; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 市场清单版本更新log表 + * @Author: jero-boot + * @Date: 2023-04-24 + * @Version: V1.0 + */ +@Data +@TableName("market_list_version_update_log") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="market_list_version_update_log对象", description="市场清单版本更新log表") +public class MarketListVersionUpdateLogEO implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + + /**创建人*/ + @ApiModelProperty(value = "创建人") + private String createBy; + + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private Date createTime; + + /**更新人*/ + @ApiModelProperty(value = "更新人") + private String updateBy; + + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private Date updateTime; + + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private String sysOrgCode; + + /**版本号*/ + @Excel(name = "版本号", width = 15) + @ApiModelProperty(value = "版本号") + private String versionNum; + + /**升版说明*/ + @Excel(name = "升版说明", width = 15) + @ApiModelProperty(value = "升版说明") + private String upgradeExplanation; + + /**清单类型*/ + @Excel(name = "清单类型", width = 15) + @ApiModelProperty(value = "清单类型") + private String listType; + + /**清单id*/ + @Excel(name = "清单id", width = 15) + @ApiModelProperty(value = "清单id") + private String listId; + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/enums/ListTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/enums/ListTypeEnum.java new file mode 100644 index 000000000..bcfd884a2 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/enums/ListTypeEnum.java @@ -0,0 +1,33 @@ +package com.jero.modules.log.enums; + +/** + * 清单类型枚举类 + */ +public enum ListTypeEnum { + MARKET_REGULATION_LIST("市场法规清单","Market Regulation List"), + MARKET_CERTIFICATION_LIST("市场认证清单","Market Certification List"); + + String name; + String value; + + private ListTypeEnum(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; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/mapper/MarketListVersionUpdateLogEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/mapper/MarketListVersionUpdateLogEOMapper.java new file mode 100644 index 000000000..c3ec07429 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/mapper/MarketListVersionUpdateLogEOMapper.java @@ -0,0 +1,17 @@ +package com.jero.modules.log.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import com.jero.modules.log.entity.MarketListVersionUpdateLogEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 市场清单版本更新log表 + * @Author: jero-boot + * @Date: 2023-04-24 + * @Version: V1.0 + */ +public interface MarketListVersionUpdateLogEOMapper extends BaseMapper { + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/mapper/xml/MarketListVersionUpdateLogEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/mapper/xml/MarketListVersionUpdateLogEOMapper.xml new file mode 100644 index 000000000..63d029a07 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/mapper/xml/MarketListVersionUpdateLogEOMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/service/IMarketListVersionUpdateLogEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/service/IMarketListVersionUpdateLogEOService.java new file mode 100644 index 000000000..cd43030f5 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/service/IMarketListVersionUpdateLogEOService.java @@ -0,0 +1,61 @@ +package com.jero.modules.log.service; + +import com.jero.modules.log.entity.MarketListVersionUpdateLogEO; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + * @Description: 市场清单版本更新log表 + * @Author: jero-boot + * @Date: 2023-04-24 + * @Version: V1.0 + */ +public interface IMarketListVersionUpdateLogEOService extends IService { + + /** + * 保存 + * + * @param marketListVersionUpdateLogEO + * @return + */ + void add(MarketListVersionUpdateLogEO marketListVersionUpdateLogEO); + + /** + * 更新 + * + * @param marketListVersionUpdateLogEO + * @return + */ + void editById(MarketListVersionUpdateLogEO marketListVersionUpdateLogEO); + + /** + * 通过id删除 + * + * @param id + * @return + */ + void deleteById(String id); + + /** + * 批量删除 + * + * @param ids + * @return + */ + void deleteByIds(List ids); + + /** + * 通过id查询 + * + * @param id + * @return + */ + MarketListVersionUpdateLogEO queryById(String id); + + /** + * 列表查询 + * + * @return + */ + List queryList(); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/service/impl/MarketListVersionUpdateLogEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/service/impl/MarketListVersionUpdateLogEOServiceImpl.java new file mode 100644 index 000000000..d11b33a94 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/log/service/impl/MarketListVersionUpdateLogEOServiceImpl.java @@ -0,0 +1,89 @@ +package com.jero.modules.log.service.impl; + +import com.jero.modules.log.entity.MarketListVersionUpdateLogEO; +import com.jero.modules.log.mapper.MarketListVersionUpdateLogEOMapper; +import com.jero.modules.log.service.IMarketListVersionUpdateLogEOService; +import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Date; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 市场清单版本更新log表 + * @Author: jero-boot + * @Date: 2023-04-24 + * @Version: V1.0 + */ +@Service +public class MarketListVersionUpdateLogEOServiceImpl extends ServiceImpl implements IMarketListVersionUpdateLogEOService { + + /** + * 保存 + * + * @param marketListVersionUpdateLogEO + * @return + */ + @Override + public void add(MarketListVersionUpdateLogEO marketListVersionUpdateLogEO) { + Date now = new Date(); + marketListVersionUpdateLogEO.setCreateTime(now); + marketListVersionUpdateLogEO.setUpdateTime(now); + save(marketListVersionUpdateLogEO); + } + + /** + * 更新 + * + * @param marketListVersionUpdateLogEO + * @return + */ + @Override + public void editById(MarketListVersionUpdateLogEO marketListVersionUpdateLogEO) { + Date now = new Date(); + marketListVersionUpdateLogEO.setUpdateTime(now); + saveOrUpdate(marketListVersionUpdateLogEO); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @Override + public void deleteById(String id) { + removeById(id); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @Override + public void deleteByIds(List ids) { + removeByIds(ids); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override + public MarketListVersionUpdateLogEO queryById(String id) { + return getById(id); + } + + /** + * 列表查询 + * + * @return + */ + @Override + public List queryList() { + return list(); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java index 5982d82e7..da571bd3b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java @@ -540,4 +540,30 @@ public class ProjectLawsInventoryEOController extends JeroController>> res = this.projectLawsInventoryEOService.queryDutyPersonByProjectId(params); return Result.OK(res); } + + /** + * 分页查询不符合项列表 + * @return + */ + @AutoLog(value = "项目库-法规清单表-查询不符合项列表") + @ApiOperation(value="项目库-法规清单表-查询不符合项列表", notes="项目库-法规清单表-查询不符合项列表") + @GetMapping(value = "/queryNotComplianList") + public Result queryNotComplianList(@RequestParam Map params) { + List> result = this.projectLawsInventoryEOService.queryNotComplianList(params); + return Result.OK(result); + } + + /** + * 导出不符合项列表 + * @param request + * @param params + */ + @AutoLog(value = "项目库-法规清单表-导出不符合项列表") + @ApiOperation(value="项目库-法规清单表-导出不符合项列表", notes="项目库-法规清单表-导出不符合项列表") + @RequestMapping(value = "/exportNotComplianList") + public void exportNotComplianList(HttpServletResponse response, + HttpServletRequest request, + @RequestParam Map params) { + this.projectLawsInventoryEOService.exportNotComplianList(response,request, params); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java index f49a2ca42..b870ca39e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLibraryBaseController.java @@ -286,4 +286,9 @@ public class ProjectLibraryBaseController extends JeroController params) { + this.projectLibraryBaseService.exportProjectProgressStatisticsXls(response,request, params); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectStatusBoardController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectStatusBoardController.java index 6d3e4570c..d2da8dcb3 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectStatusBoardController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectStatusBoardController.java @@ -12,9 +12,11 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.Date; import java.util.List; import java.util.Map; @@ -81,6 +83,11 @@ public class ProjectStatusBoardController { return Result.OK(mapList); } + // 导出excel文件 + @RequestMapping(value = "/exportXls") + public void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase) { + this.iProjectStatusBoardService.exportXls(response,request, projectLibraryBase); + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskPlanningController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskPlanningController.java index c28965530..ddee18b2a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskPlanningController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskPlanningController.java @@ -13,6 +13,7 @@ import com.jero.modules.project.vo.TimeNodeVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -70,8 +71,12 @@ public class ProjectTaskPlanningController extends JeroController queryList(@RequestParam(name="projectId",required=true) String projectId) { + ProjectTaskPlanning result = new ProjectTaskPlanning(); List projectTaskPlanning = projectTaskPlanningService.queryList(projectId); - return Result.OK(projectTaskPlanning.get(0)); + if(CollectionUtils.isNotEmpty(projectTaskPlanning)){ + result = projectTaskPlanning.get(0); + } + return Result.OK(result); } /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java index c6da492f3..f739e73aa 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectLawsInventoryEO.java @@ -522,4 +522,12 @@ public class ProjectLawsInventoryEO implements Serializable { @DateTimeFormat(pattern="yyyy-MM-dd") @ApiModelProperty(value = "验证符合性确认-责任确认截止时间") private Date verifyDutyDueDate; + + /**流程类型*/ + @TableField(exist = false) + private String flowType; + + /**流程类型展示名称*/ + @TableField(exist = false) + private String flowTypeName; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectTaskPlanning.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectTaskPlanning.java index 30dd70050..32324c8c2 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectTaskPlanning.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectTaskPlanning.java @@ -102,4 +102,49 @@ public class ProjectTaskPlanning implements Serializable { @TableField(exist = false) List timeNodeVOS; + + /**概念验证阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date zero; + + /**初样阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date one; + + /**工艺方案阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date two; + + /**零件试制阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date three; + + /**整车装配工艺方案阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date four; + + /**预生产阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date five; + + /**试产阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date six; + + /**小批量生产阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date seven; + + /**大规模生产阶段*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + private Date eight; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java index c440e0b3c..64790607f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java @@ -38,6 +38,11 @@ public enum OperatorTypeEnum { QUERY_PREHOMO_STATISTICS("查询prehomo统计","queryPrehomoStatistics"), QUERY_VERIFY_STATISTICS("查询验证符合性统计","queryVerifyStatistics"), QUERY_CERTIFICATION_PROGRESS_STATISTICS("查询认证进度统计","queryCertificationProgressStatistics"), + QUERY_FG_TASK_TO_CONFIRM_STATISTICS("查询法规任务确认统计","queryFGTaskToConfirmStatistics"), + QUERY_RZ_TASK_TO_CONFIRM_STATISTICS("查询认证任务确认统计","queryRZTaskToConfirmStatistics"), + QUERY_CERTIFICATION_PROGRESS_STATISTICS_ALL("查询认证进度统计-全部","queryCertificationProgressStatisticsAll"), + QUERY_CERTIFICATION_PROGRESS_STATISTICS_CAR("查询认证进度统计-整车","queryCertificationProgressStatisticsCar"), + QUERY_CERTIFICATION_PROGRESS_STATISTICS_PART("查询认证进度统计-零部件","queryCertificationProgressStatisticsPart"), ADD_LAWS_OPINION_GATHER("添加法规意见收集数据","addLawsOpinionGather"), UPDATE_LAWS_OPINION_GATHER_GATHER_RESULT("更新法规意见收集数据收集结果","updateLawsOpinionGatherGatherResult"), diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectTaskPlanningNameEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectTaskPlanningNameEnum.java index 6d2563696..767676d4c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectTaskPlanningNameEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectTaskPlanningNameEnum.java @@ -10,7 +10,6 @@ public enum ProjectTaskPlanningNameEnum { // PREHOMO_DEADLINE("摸底试验结束","Pre-Homo Confirmation"), // name:Pre-Homo value:Pre-Homo // ATTESTATION_START_TIME("认证试验结束","Homo Completion"),// name:认证开始 value:Certification begins ATTESTATION_END_TIME("认证批准","Homo KO"),// name:认证结束 value:End of certification -// VERIFY_DEADLINE("验证符合性确认","Validation Compliance Confirmation"), LIST_CONFIRMATION("清单发布","List Publishing"), LEGAL_TASK_CONFIRMATION("责任确认","Responsibility Confirmation"), @@ -19,7 +18,16 @@ public enum ProjectTaskPlanningNameEnum { ATTESTATION_START_TIME("认证开始","Certification Start"),// name:认证开始 value:Certification begins VERIFY_DEADLINE("验证核查","Verification And Verification"), CERTIFICATION_SUBMISSION("认证提交","Certification Submission"), + G_ZERO("G0","G0"), + G_ONE("G1","G1"), + G_TWO("G2","G2"), + G_THREE("G3","G3"), + G_FOUR("G4","G4"), + G_FIVE("G5","G5"), + G_SIX("G6","G6"), + G_SEVEN("G7","G7"), +// VERIFY_DEADLINE("验证符合性确认","Validation Compliance Confirmation"), ; String name; String value; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/ProjectLawsInventoryEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/ProjectLawsInventoryEOMapper.java index 3306200d3..22ebe11b0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/ProjectLawsInventoryEOMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/ProjectLawsInventoryEOMapper.java @@ -3,6 +3,7 @@ package com.jero.modules.project.mapper; import java.util.List; import java.util.Map; +import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import com.jero.modules.project.entity.ProjectLawsInventoryEO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -44,4 +45,6 @@ public interface ProjectLawsInventoryEOMapper extends BaseMapper> getTaskToConfirmStatisticsGroupByTerritory(@Param("projectLibraryId") String projectLibraryId, @Param("taskAffirmStatus") String taskAffirmStatus); + + List> queryNotComplianList(@Param("params") Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectLawsInventoryEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectLawsInventoryEOMapper.xml index 333452acb..6d2dc3451 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectLawsInventoryEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectLawsInventoryEOMapper.xml @@ -105,4 +105,91 @@ and task_affirm_status = #{taskAffirmStatus} group by duty_territory; + + + + + + + and temp.serial_number like CONCAT(CONCAT('%',#{params.serialNumber}),'%') + + + and temp.title like CONCAT(CONCAT('%',#{params.title}),'%') + + + and temp.duty_territory like CONCAT(CONCAT('%',#{params.dutyTerritory}),'%') + + + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectTaskPlanningMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectTaskPlanningMapper.xml index a883441db..ca124104e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectTaskPlanningMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectTaskPlanningMapper.xml @@ -11,6 +11,15 @@ + + + + + + + + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 67bdd8777..e8b43edfa 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -254,4 +254,60 @@ public interface IProjectCertificationInventoryEOService extends IService projectCertificationInventoryEOList); void certificationInventoryEOListSortByTaskConfirmEndTimeAsc(List projectCertificationInventoryEOList); Map>> queryDutyPersonByProjectId(Map params); + + /** + * 获取任务确认统计信息 + * @param pciEoList + * @return + */ + List> getTaskToConfirmStatistics(List pciEoList); + + /** + * 获取Pre-Homo统计信息 + * @param pciEoList + * @return + */ + List> getPrehomoStatistice(List pciEoList); + + /** + * 获取认证进度统计信息 全部 + * @param pciEoList + * @return + */ + List> getAllCertificationProgressStatistics(List pciEoList); + + /** + * 获取认证进度统计信息 整车 + * @param pciEoList + * @return + */ + List> getCarCertificationProgressStatistics(List pciEoList); + + /** + * 获取认证进度统计信息 零部件 + * @param pciEoList + * @return + */ + List> getPartCertificationProgressStatistics(List pciEoList); + + /** + * 按照认证任务确认状态分组 + * @param pciEos + * @return + */ + Map groupByFGRwqrStatus(List pciEos); + + /** + * 按照preHomo确认状态分组 + * @param pciEos + * @return + */ + Map groupByPreHomoStatus(List pciEos); + + /** + * 根据认证进度分组 + * @param pciEos + * @return + */ + Map groupByCertificationProgress(List pciEos); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java index 363994741..4c2437e46 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java @@ -2,6 +2,7 @@ package com.jero.modules.project.service; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.itextpdf.text.DocumentException; import com.jero.common.api.vo.Result; @@ -257,4 +258,50 @@ public interface IProjectLawsInventoryEOService extends IService compulsoryTransfer(JSONObject json); Map>> queryDutyPersonByProjectId(Map params); + + /** + * 获取任务确认统计信息 + * @param projectLawsInventoryEOList + * @return + */ + List> getTaskToConfirmStatistics(List projectLawsInventoryEOList); + + /** + * 获取设计符合性统计信息 + * @param projectLawsInventoryEOList + * @return + */ + List> getDesignComplianceStatistice(List projectLawsInventoryEOList); + + /** + * 获取验证符合性统计信息 + * @param projectLawsInventoryEOList + * @return + */ + List> getVerifyComplianceStatistice(List projectLawsInventoryEOList); + + List> queryNotComplianList(Map params); + + void exportNotComplianList(HttpServletResponse response, HttpServletRequest request, Map params); + + /** + * 按照法规任务确认状态分组 + * @param pliEos + * @return + */ + Map groupByFGRwqrStatus(List pliEos); + + /** + * 按照设计符合性状态分组 + * @param pliEos + * @return + */ + Map groupByDesignStatus(List pliEos); + + /** + * 按照验证符合性状态分组 + * @param pliEos + * @return + */ + Map groupByVerifyStatus(List pliEos); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java index f68aa498e..34ea29c85 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryBaseService.java @@ -159,4 +159,12 @@ public interface IProjectLibraryBaseService extends IService * @return */ JSONArray getProjectProgressInfo(); + + /** + * 导出项目进度统计(状态导出) + * @param response + * @param request + * @param params + */ + void exportProjectProgressStatisticsXls(HttpServletResponse response, HttpServletRequest request, Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryStatisticsService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryStatisticsService.java new file mode 100644 index 000000000..8bac94398 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLibraryStatisticsService.java @@ -0,0 +1,85 @@ +package com.jero.modules.project.service; + +import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.jero.modules.project.entity.ProjectLawsInventoryEO; + +import java.util.List; +import java.util.Map; + +/** + * 项目库统计service + */ +public interface IProjectLibraryStatisticsService { + + /** + * 获取法规清单-任务确认统计信息-根据责任领域分组 + * @param datas + * @return + */ + Map getFGTaskToConfirmStatisticsGroupByTerritory(List datas, Map params); + + /** + * 获取设计符合性确认流程统计信息-根据责任领域分组 + * @param datas + * @param params + * @return + */ + Map getDesignComplianceStatisticeGroupByTerritory(List datas, Map params); + + /** + * 获取验证符合性确认流程统计信息-根据责任领域分组 + * @param datas + * @param params + * @return + */ + Map getVerifyComplianceStatisticeGroupByTerritory(List datas, Map params); + + /** + * 获取认证清单-任务确认统计信息-根据责任领域分组 + * @param datas + * @param params + * @return + */ + Map getRZTaskToConfirmStatisticsGroupByTerritory(List datas, Map params); + + /** + * 获取认证清单-Pre-Homo统计信息-根据责任领域分组 + * @param datas + * @param params + * @return + */ + Map getPrehomoStatisticeGroupByTerritory(List datas, Map params); + + /** + * 获取认证清单-全部-认证进度统计信息-根据责任领域分组 + * @param datas + * @param params + * @return + */ + Map getAllCertificationProgressStatisticsGroupByTerritory(List datas, Map params); + + /** + * 获取认证清单-整车-认证进度统计信息-根据责任领域分组 + * @param datas + * @param params + * @return + */ + Map getCarCertificationProgressStatisticsGroupByTerritory(List datas, Map params); + + /** + * 获取认证清单-零部件-认证进度统计信息-根据责任领域分组 + * @param datas + * @param params + * @return + */ + Map getPartCertificationProgressStatisticsGroupByTerritory(List datas, Map params); + + /** + * 获取认证参数收集-统计信息 + * @param datas + * @param params + * @return + */ + Map getParameterCollectingStatisticsGroupByTerritory(List datas, Map params); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectStatusBoardService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectStatusBoardService.java index 36e76b058..3194b7e20 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectStatusBoardService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectStatusBoardService.java @@ -4,6 +4,7 @@ import com.jero.modules.project.entity.ProjectLibraryBase; import com.jero.modules.project.vo.TimeNodeVO; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import java.util.Date; import java.util.List; import java.util.Map; @@ -31,4 +32,12 @@ public interface IProjectStatusBoardService { * @param req */ List> scheduleInfoList(ProjectLibraryBase projectLibraryBase, HttpServletRequest req); + + /** + * 导出excel文件 + * @param response + * @param request + * @param projectLibraryBase + */ + void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectLibraryBase projectLibraryBase); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index fd5e39de5..381b14bb4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -84,10 +84,7 @@ import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import java.io.*; -import java.text.Collator; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; +import java.text.*; import java.util.*; import java.util.stream.Collectors; @@ -112,6 +109,9 @@ import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServic @Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl implements IProjectCertificationInventoryEOService { + private static DecimalFormat df = new DecimalFormat("#.00"); + private static String percentSign = "%"; + @Autowired private ISysUserService sysUserService; @Autowired @@ -795,6 +795,21 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl processInfoDetailEOList = new ArrayList<>(); + pciEoList.forEach(pciEo -> { + ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO(); + processInfoDetailEO.setUserId(pciEo.getDutyPerson()); + processInfoDetailEO.setEndTime(pciEo.getEndTime()); + processInfoDetailEO.setProjectLawsInventoryId(pciEo.getId()); + processInfoDetailEOList.add(processInfoDetailEO); + }); + + // 给责任人分配待办中心的任务 (待提交) + this.addProcessInfoDetailEO(processInfoDetailEOList,pciEoList.get(0).getProjectLibraryId(),CertificationFlowNodeEnum.ZRRTJRW.getKey()); + } } } return new Result<>().success("批量更新状态成功!"); @@ -2525,6 +2540,316 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl> getTaskToConfirmStatistics(List pciEoList) { + List> result = new ArrayList<>(); + + int notStartedCount = 0; + int toConfirmCount = 0; + int acceptedCount = 0; + int rejectedCount = 0; + if(CollectionUtils.isNotEmpty(pciEoList)){ + // 未发起 + notStartedCount = (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 -> { + 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()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ); + return flag; + }).count(); + // 拒绝 + rejectedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) + ); + return flag; + }).count(); + } + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map 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> getPrehomoStatistice(List pciEoList) { + List> result = new ArrayList<>(); + + int notStartedCount = 0; + int toConfirmCount = 0; + int acceptedCount = 0; + int rejectedCount = 0; + if(CollectionUtils.isNotEmpty(pciEoList)){ + // 未发起 + notStartedCount = (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.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) + ); + return flag; + }).count(); + // 待确认 + toConfirmCount = (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(); + // 审查通过 + acceptedCount = (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 -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ); + return flag; + }).count(); + } + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map 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",CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()); + acceptedMap.put("taskAffirmStatusCount",acceptedCount); + + rejectedMap.put("taskAffirmStatus",CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()); + rejectedMap.put("taskAffirmStatusCount",rejectedCount); + + result.add(notStartedMap); + result.add(toConfirmMap); + result.add(acceptedMap); + result.add(rejectedMap); + return result; + } + + @Override + public List> getAllCertificationProgressStatistics(List pciEoList) { + List> result = new ArrayList<>(); + + int notStartedCount = 0; + int inProgressCount = 0; + int testPassedCount = 0; + int testFailedCount = 0; + if(CollectionUtils.isNotEmpty(pciEoList)){ + // 未开始 + notStartedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.NOT_START.getValue()) + ); + return flag; + }).count(); + // 进行中 + inProgressCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.IN_PROGRESS.getValue()) + || StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()) + ); + return flag; + }).count(); + // 实验通过 + testPassedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue()) + || StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()) + || StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue()) + ); + return flag; + }).count(); + // 实验失败 + testFailedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.TEST_FAILED.getValue()) + ); + return flag; + }).count(); + } + Map notStartedMap = new HashMap<>(); + Map inProgressMap = new HashMap<>(); + Map testPassedMap = new HashMap<>(); + Map testFailedMap = new HashMap<>(); + + notStartedMap.put("certificationProgress",CertificationProgressEnum.NOT_START.getValue()); + notStartedMap.put("certificationProgressCount",notStartedCount); + + inProgressMap.put("certificationProgress",CertificationProgressEnum.IN_PROGRESS.getValue()); + inProgressMap.put("certificationProgressCount",inProgressCount); + + testPassedMap.put("certificationProgress",CertificationProgressEnum.TEST_PASSED.getValue()); + testPassedMap.put("certificationProgressCount",testPassedCount); + + testFailedMap.put("certificationProgress",CertificationProgressEnum.TEST_FAILED.getValue()); + testFailedMap.put("certificationProgressCount",testFailedCount); + + result.add(notStartedMap); + result.add(inProgressMap); + result.add(testPassedMap); + result.add(testFailedMap); + return result; + } + + @Override + public List> getCarCertificationProgressStatistics(List pciEoList) { + List> result = new ArrayList<>(); + + int notStartedCount = 0; + int inProgressCount = 0; + int testPassedCount = 0; + int testFailedCount = 0; + if(CollectionUtils.isNotEmpty(pciEoList)){ + // 未开始 + notStartedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.NOT_START.getValue()) + ); + return flag; + }).count(); + // 进行中 + inProgressCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.IN_PROGRESS.getValue()) + ); + return flag; + }).count(); + // 实验通过 + testPassedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue()) + ); + return flag; + }).count(); + // 实验失败 + testFailedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.TEST_FAILED.getValue()) + ); + return flag; + }).count(); + } + Map notStartedMap = new HashMap<>(); + Map inProgressMap = new HashMap<>(); + Map testPassedMap = new HashMap<>(); + Map testFailedMap = new HashMap<>(); + + notStartedMap.put("certificationProgress",CertificationProgressEnum.NOT_START.getValue()); + notStartedMap.put("certificationProgressCount",notStartedCount); + + inProgressMap.put("certificationProgress",CertificationProgressEnum.IN_PROGRESS.getValue()); + inProgressMap.put("certificationProgressCount",inProgressCount); + + testPassedMap.put("certificationProgress",CertificationProgressEnum.TEST_PASSED.getValue()); + testPassedMap.put("certificationProgressCount",testPassedCount); + + testFailedMap.put("certificationProgress",CertificationProgressEnum.TEST_FAILED.getValue()); + testFailedMap.put("certificationProgressCount",testFailedCount); + + result.add(notStartedMap); + result.add(inProgressMap); + result.add(testPassedMap); + result.add(testFailedMap); + return result; + } + + @Override + public List> getPartCertificationProgressStatistics(List pciEoList) { + List> result = new ArrayList<>(); + + int notSubmitCount = 0; + int reportSubmitCount = 0; + int storedCount = 0; + if(CollectionUtils.isNotEmpty(pciEoList)){ + // 部件报告未提交 + notSubmitCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()) + ); + return flag; + }).count(); + // 部件报告已提交 + reportSubmitCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()) + ); + return flag; + }).count(); + // 部件报告已入库 + storedCount = (int) pciEoList.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue()) + ); + return flag; + }).count(); + } + Map notSubmitMap = new HashMap<>(); + Map reportSubmitMap = new HashMap<>(); + Map storedMap = new HashMap<>(); + + notSubmitMap.put("certificationProgress",CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()); + notSubmitMap.put("certificationProgressCount",notSubmitCount); + + reportSubmitMap.put("certificationProgress",CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()); + reportSubmitMap.put("certificationProgressCount",reportSubmitCount); + + storedMap.put("certificationProgress",CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue()); + storedMap.put("certificationProgressCount",storedCount); + + result.add(notSubmitMap); + result.add(reportSubmitMap); + result.add(storedMap); + return result; + } + @Override public Result saveBatch(JSONObject json) { Date now = new Date(); @@ -5278,6 +5603,258 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl groupByFGRwqrStatus(List pciEos) { + Map result = new HashMap<>(); + Map projectScheduleExportMap = new HashMap<>(); + + 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 toBeReleased = pciEos.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; + }).collect(Collectors.toList()); + + List toBeVerified = pciEos.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List toBeConfirmed = pciEos.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List accept = pciEos.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()) + || StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()) + || StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List refuse = pciEos.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + toBeReleasedCount = toBeReleased.size(); + toBeVerifiedCount = toBeVerified.size(); + toBeConfirmedCount = toBeConfirmed.size(); + acceptCount = accept.size(); + refuseCount = refuse.size(); + + count = toBeReleasedCount + toBeVerifiedCount + toBeConfirmedCount + acceptCount + refuseCount; + // 计算百分比 + percentage = acceptCount / count * 100; + percentageStr = percentage != 0 ? df.format(percentage) : "0"; + } + + projectScheduleExportMap.put("toBeReleased",toBeReleasedCount); + projectScheduleExportMap.put("toBeVerified",toBeVerifiedCount); + projectScheduleExportMap.put("toBeConfirmed",toBeConfirmedCount); + projectScheduleExportMap.put("accept",acceptCount); + projectScheduleExportMap.put("refuse",refuseCount); + projectScheduleExportMap.put("percentage",percentageStr + percentSign); + result.put("projectScheduleExportMap",projectScheduleExportMap); + return result; + } + + @Override + public Map groupByPreHomoStatus(List pciEos) { + Map result = new HashMap<>(); + Map projectScheduleExportMap = new HashMap<>(); + + double notStartCount = 0; // 未发起 + double toBeSubmittedCount = 0; // 待提交 + double toBeReviewedCount = 0; // 待审查 + double acceptCount = 0; // 审查通过 + double refuseCount = 0; // 审查退回 + double taskTerminationCount = 0; // 任务终止 + double count = 0; + // 计算百分比 + double percentage = 0; + String percentageStr = "0"; + if(CollectionUtils.isNotEmpty(pciEos)){ + List 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()) + || 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; + }).collect(Collectors.toList()); + + List toBeSubmitted = pciEos.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List toBeReviewed = pciEos.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List accept = pciEos.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List refuse = pciEos.stream().filter(pciEo -> { + boolean flag = ( + StringUtils.equals(pciEo.getFlowStatus(), CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + notStartCount = notStart.size(); + toBeSubmittedCount = toBeSubmitted.size(); + toBeReviewedCount = toBeReviewed.size(); + acceptCount = accept.size(); + refuseCount = refuse.size(); + + count = notStartCount + toBeSubmittedCount + toBeReviewedCount + acceptCount + refuseCount; + // 计算百分比 + percentage = acceptCount / count * 100; + percentageStr = percentage != 0 ? df.format(percentage) : "0"; + } + + projectScheduleExportMap.put("notStartCount",notStartCount); + projectScheduleExportMap.put("toBeSubmittedCount",toBeSubmittedCount); + projectScheduleExportMap.put("toBeReviewedCount",toBeReviewedCount); + projectScheduleExportMap.put("accept",acceptCount); + projectScheduleExportMap.put("refuse",refuseCount); + projectScheduleExportMap.put("percentage",percentageStr + percentSign); + result.put("projectScheduleExportMap",projectScheduleExportMap); + return result; + } + + @Override + public Map groupByCertificationProgress(List pciEos) { + Map result = new HashMap<>(); + Map projectScheduleExportMap = new HashMap<>(); + + double notStartCount = 0; // 待开始 + double inProgressCount = 0; // 进行中 + double testPassedCount = 0; // 实验通过 + double testFailedCount = 0; // 实验失败 + double notSubmitCount = 0; // 部件报告未上传 + double reportSubmitCount = 0; // 部件报告已上传 + double storedCount = 0; // 部件报告已入库 + double count = 0; + // 计算百分比 + double percentage = 0; + String percentageStr = "0"; + + if(CollectionUtils.isNotEmpty(pciEos)){ + // 未开始 + List notStartPciEoList = pciEos.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.NOT_START.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + notStartCount = (double) notStartPciEoList.size(); + + // 进行中 + List inProgressPciEoList = pciEos.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.IN_PROGRESS.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + inProgressCount = (double) inProgressPciEoList.size(); + + // 实验通过 + List testPassedPciEoList = pciEos.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + testPassedCount = (double) testPassedPciEoList.size(); + + // 实验失败 + List testFailedPciEoList = pciEos.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_FAILED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + testFailedCount = (double) testFailedPciEoList.size(); + + // 部件报告未提交 + List notSubmitPciEoList = pciEos.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + notSubmitCount = (double) notSubmitPciEoList.size(); + + // 部件报告已提交 + List reportSubmitPciEoList = pciEos.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + reportSubmitCount = (double) reportSubmitPciEoList.size(); + + // 部件报告已入库 + List storedPciEoList = pciEos.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + storedCount = (double) storedPciEoList.size(); + + count = notStartCount + inProgressCount + testPassedCount + testFailedCount + testFailedCount + notSubmitCount + reportSubmitCount + storedCount; + // 计算百分比 + percentage = testPassedCount / count * 100; + percentageStr = percentage != 0 ? df.format(percentage) : "0"; + } + projectScheduleExportMap.put("notStartCount",notStartCount); + projectScheduleExportMap.put("inProgressCount",inProgressCount); + projectScheduleExportMap.put("testPassedCount",testPassedCount); + projectScheduleExportMap.put("testFailedCount",testFailedCount); + projectScheduleExportMap.put("notSubmitCount",notSubmitCount); + projectScheduleExportMap.put("reportSubmitCount",reportSubmitCount); + projectScheduleExportMap.put("storedCount",storedCount); + projectScheduleExportMap.put("count",count); + projectScheduleExportMap.put("percentage",percentageStr + percentSign); + result.put("projectScheduleExportMap",projectScheduleExportMap); + return result; + } + @Override public Map>> queryDutyPersonByProjectId(Map params) { Map>> result = new HashMap<>(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index 411164699..66caed9de 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -8,6 +8,8 @@ import com.aliyuncs.utils.IOUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.itextpdf.text.Font; import com.itextpdf.text.*; @@ -76,6 +78,7 @@ import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum; import com.jero.modules.todoCenter.enums.VerifyComplianceFlowNodeKeyEnum; import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService; import com.jero.modules.todoCenter.service.IProcessInfoEOService; +import com.jero.modules.todoCenter.vo.ProcessInfoVO; import com.jero.modules.wkflow.entity.ProcessHistoryEO; import com.jero.modules.wkflow.enums.DesignComplianceNodeEnum; import com.jero.modules.wkflow.enums.FlowTypeEnum; @@ -122,10 +125,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.URLEncoder; -import java.text.Collator; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; +import java.text.*; import java.util.List; import java.util.*; import java.util.stream.Collectors; @@ -145,6 +145,8 @@ import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServic @Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl implements IProjectLawsInventoryEOService { + private static DecimalFormat df = new DecimalFormat("#.00"); + private static String percentSign = "%"; @Autowired private ProjectLibraryBaseMapper projectLibraryBaseMapper; @@ -12413,6 +12415,395 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl> getTaskToConfirmStatistics(List projectLawsInventoryEOList) { + List> 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()) + || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.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()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.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 notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map 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> getDesignComplianceStatistice(List projectLawsInventoryEOList) { + List> result = new ArrayList<>(); + + int notStartedCount = 0; + int toConfirmCount = 0; + int complianceCount = 0; + int nonComplianceCount = 0; + if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ + // 未发起 + notStartedCount = (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.DUTY_PERSON_REJECTED.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).count(); + + // 待确认 + toConfirmCount = (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.TO_TRACK.getValue()) + ); + return flag; + }).count(); + + // 符合 + complianceCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + ); + return flag; + }).count(); + + // 不符合 + nonComplianceCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + ); + return flag; + }).count(); + } + + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map rejectedMap = new HashMap<>(); + + notStartedMap.put("designFlowTaskStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue()); + notStartedMap.put("designFlowTaskStatusCount",notStartedCount); + + toConfirmMap.put("designFlowTaskStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + toConfirmMap.put("designFlowTaskStatusCount",toConfirmCount); + + acceptedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.CONFORMITY.getValue()); + acceptedMap.put("designFlowTaskStatusCount",complianceCount); + + rejectedMap.put("designFlowTaskStatus",ComplianceFlowStatusEnum.INCONFORMITY.getValue()); + rejectedMap.put("designFlowTaskStatusCount",nonComplianceCount); + + result.add(notStartedMap); + result.add(toConfirmMap); + result.add(acceptedMap); + result.add(rejectedMap); + return result; + } + + @Override + public List> getVerifyComplianceStatistice(List projectLawsInventoryEOList) { + List> result = new ArrayList<>(); + + int notStartedCount = 0; + int toConfirmCount = 0; + int complianceCount = 0; + int nonComplianceCount = 0; + if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ + // 未发起 + notStartedCount = (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.DUTY_PERSON_REJECTED.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).count(); + + // 待确认 + toConfirmCount = (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.TO_TRACK.getValue()) + ); + return flag; + }).count(); + + // 符合 + complianceCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + ); + return flag; + }).count(); + + // 不符合 + nonComplianceCount = (int) projectLawsInventoryEOList.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + ); + return flag; + }).count(); + } + + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map rejectedMap = new HashMap<>(); + + notStartedMap.put("verifyFlowTaskStatus",TaskAffirmStatusEnum.NOT_STARTED.getValue()); + notStartedMap.put("verifyFlowTaskStatusCount",notStartedCount); + + toConfirmMap.put("verifyFlowTaskStatus",TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + toConfirmMap.put("verifyFlowTaskStatusCount",toConfirmCount); + + acceptedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.CONFORMITY.getValue()); + acceptedMap.put("verifyFlowTaskStatusCount",complianceCount); + + rejectedMap.put("verifyFlowTaskStatus",ComplianceFlowStatusEnum.INCONFORMITY.getValue()); + rejectedMap.put("verifyFlowTaskStatusCount",nonComplianceCount); + + result.add(notStartedMap); + result.add(toConfirmMap); + result.add(acceptedMap); + result.add(rejectedMap); + return result; + } + + @Override + public List> queryNotComplianList(Map params) { + String cut = (String) params.get("cut"); + + List complianceFlowStatusList = new ArrayList<>(); + complianceFlowStatusList.add(ComplianceFlowStatusEnum.INCONFORMITY.getValue()); + complianceFlowStatusList.add(ComplianceFlowStatusEnum.TO_TRACK.getValue()); + params.put("complianceFlowStatusList",complianceFlowStatusList); + List> result = this.baseMapper.queryNotComplianList(params); + if(CollectionUtils.isNotEmpty(result)){ + List sysDictItems = sysDictItemServiceImpl.selectItemsAll(); + + List userIdList = new ArrayList<>(); + + List regulationOwnerIdList = result.stream().filter( + data -> StringUtils.isNotEmpty((String) data.get("regulationOwnerId")) + ).map(e -> (String) e.get("regulationOwnerId")).distinct().collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(regulationOwnerIdList)){ + userIdList.addAll(regulationOwnerIdList); + } + + List dutyIdList = result.stream().filter( + data -> StringUtils.isNotEmpty((String) data.get("dutyId")) + ).map(e -> (String) e.get("dutyId")).distinct().collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(dutyIdList)){ + userIdList.addAll(dutyIdList); + } + List userList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(userIdList)){ + userList = this.sysUserService.querySysUserListByIdList(userIdList); + } + for (Map dataMap : result) { + String dutyTerritory = (String) dataMap.get("dutyTerritory"); + if(StringUtils.isNotEmpty(dutyTerritory)){ + if(StringUtils.isNotEmpty(dutyTerritory)){ + String dutyTerritory_dictText = this.disposeShowDictItemValue(sysDictItems, dutyTerritory,cut,ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue()); + dataMap.put("dutyTerritory_dictText",dutyTerritory_dictText); + } + } + + String flowStatus = (String) dataMap.get("flowStatus"); + if(StringUtils.isNotEmpty(flowStatus)){ + dataMap.put("flowStatusName",ComplianceFlowStatusEnum.getTextByValue(flowStatus,cut)); + } + + if(CollectionUtils.isNotEmpty(userList)){ + String regulationOwnerId = (String) dataMap.get("regulationOwnerId"); + if(StringUtils.isNotEmpty(regulationOwnerId)){ + String regulationOwnerIdName = this.sysUserService.getUsernameByUserId(userList,regulationOwnerId); + dataMap.put("regulationOwnerIdName",regulationOwnerIdName); + } + String dutyId = (String) dataMap.get("dutyId"); + if(StringUtils.isNotEmpty(dutyId)){ + String dutyIdName = this.sysUserService.getUsernameByUserId(userList,dutyId); + dataMap.put("dutyIdName",dutyIdName); + } + } + + String flowType = (String) dataMap.get("flowType"); + if(StringUtils.isNotEmpty(flowType)){ + dataMap.put("flowTypeName",FlowTypeEnum.getTextByValue(flowType,cut)); + } + + // 返回符合性流程的流程实例id + QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId,(String)dataMap.get("id")); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType,flowType); + processInfoDetailEOQueryWrapper.orderByDesc("create_time"); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if(CollectionUtils.isNotEmpty(processInfoDetailEOS)){ + dataMap.put("actiProcInstId",processInfoDetailEOS.get(0).getActiProcInstId()); + } + } + } + return result; + } + + @Override + public void exportNotComplianList(HttpServletResponse response, HttpServletRequest request, Map params) { + String cut = (String) params.get("cut"); + String header = ""; + String sheetName = "未符合项"; + if (StringUtils.equals(cut,CutEnum.CN.getValue())) { + header = "编号,标题,流程类型,责任领域,问题类型,发起人,责任人"; + } else if (StringUtils.equals(cut,CutEnum.EN.getValue())) { + header = "Number,Title,Process Type,Responsible Field,Issue Type,Creator,Assignee"; + sheetName = "Non-compliant"; + } + + OutputStream os = null; + Workbook workbook = new XSSFWorkbook(); + Sheet sheet = workbook.createSheet(sheetName); + + List> dataList = this.queryNotComplianList(params); + + CellStyle cellStyle = workbook.createCellStyle(); + cellStyle.setAlignment(HorizontalAlignment.CENTER); + Row rowHeader = sheet.createRow(0);//开始创建标题行 + if (com.jero.modules.system.util.StringUtils.isNotBlank(header)) { + String[] headerArr = header.split(","); + for (int i = 0; i < headerArr.length; i++) { + sheet.setColumnWidth(i, 5000); // 设置列宽度为5000 + Cell cellHeader = rowHeader.createCell(i); + cellHeader.setCellStyle(cellStyle); + cellHeader.setCellValue(headerArr[i]); + } + } + + if(CollectionUtils.isNotEmpty(dataList)){ + for (int i = 0; i < dataList.size(); i++) { + Row row = sheet.createRow(i + 1); + row.createCell(0).setCellValue((String) dataList.get(i).get("serialNumber")); + row.createCell(1).setCellValue((String) dataList.get(i).get("title")); + row.createCell(2).setCellValue((String) dataList.get(i).get("flowTypeName")); + row.createCell(3).setCellValue((String) dataList.get(i).get("dutyTerritory_dictText")); + row.createCell(4).setCellValue((String) dataList.get(i).get("flowStatusName")); + row.createCell(5).setCellValue((String) dataList.get(i).get("regulationOwnerIdName")); + row.createCell(6).setCellValue((String) dataList.get(i).get("dutyIdName")); + } + } + + try { + os = response.getOutputStream(); + workbook.write(os); + os.flush(); + } catch (IOException e) { + e.printStackTrace(); + if(CutEnum.CN.getValue().equals(cut)){ + throw new JeroBootException("导出失败"); + }else{ + throw new JeroBootException("Export failure"); + } + } finally { + IOUtils.closeQuietly(os); + } + } + /** * 设计符合性相关待办任务强制转办 * @@ -12624,6 +13015,356 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl groupByFGRwqrStatus(List pliEos) { + Map result = new HashMap<>(); + + Map projectScheduleExportMap = new HashMap<>(); + Map toBeReleasedMap = new HashMap<>(); + Map toBeVerifiedMap = new HashMap<>(); + Map toBeConfirmedMap = new HashMap<>(); + Map acceptMap = new HashMap<>(); + Map refuseMap = new HashMap<>(); + + 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(pliEos)){ + List designToBeReleased = pliEos.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; + }).collect(Collectors.toList()); + List verifyToBeReleased = pliEos.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; + }).collect(Collectors.toList()); + toBeReleasedMap.put("designToBeReleased",designToBeReleased); + toBeReleasedMap.put("verifyToBeReleased",verifyToBeReleased); + + List designToBeVerified = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List verifyToBeVerified = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + toBeVerifiedMap.put("designToBeVerified",designToBeVerified); + toBeVerifiedMap.put("verifyToBeVerified",verifyToBeVerified); + + List designToBeConfirmed = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List verifyToBeConfirmed = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + toBeConfirmedMap.put("designToBeConfirmed",designToBeConfirmed); + toBeConfirmedMap.put("verifyToBeConfirmed",verifyToBeConfirmed); + + List designAccept = pliEos.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()) + || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List verifyAccept = pliEos.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()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + acceptMap.put("designAccept",designAccept); + acceptMap.put("verifyAccept",verifyAccept); + + List designRefuse = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List verifyRefuse = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + refuseMap.put("designRefuse",designRefuse); + refuseMap.put("verifyRefuse",verifyRefuse); + + toBeReleasedCount = designToBeReleased.size() + verifyToBeReleased.size(); + toBeVerifiedCount = designToBeVerified.size() + verifyToBeVerified.size(); + toBeConfirmedCount = designToBeConfirmed.size() + verifyToBeConfirmed.size(); + acceptCount = designAccept.size() + verifyAccept.size(); + refuseCount = designRefuse.size() + verifyRefuse.size(); + count = toBeReleasedCount + toBeVerifiedCount + toBeConfirmedCount + acceptCount + refuseCount; + // 计算百分比 + percentage = acceptCount / count * 100; + percentageStr = percentage != 0 ? df.format(percentage) : "0"; + } + result.put(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue(),toBeReleasedMap); + result.put(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue(),toBeVerifiedMap); + result.put(ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue(),toBeConfirmedMap); + result.put(ComplianceFlowStatusEnum.CONFORMITY.getValue(),acceptMap); + result.put(ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue(),refuseMap); + + projectScheduleExportMap.put("toBeReleased",toBeReleasedCount); + projectScheduleExportMap.put("toBeVerified",toBeVerifiedCount); + projectScheduleExportMap.put("toBeConfirmed",toBeConfirmedCount); + projectScheduleExportMap.put("accept",acceptCount); + projectScheduleExportMap.put("refuse",refuseCount); + projectScheduleExportMap.put("percentage",percentageStr + percentSign); + result.put("projectScheduleExportMap",projectScheduleExportMap); + return result; + } + + @Override + public Map groupByDesignStatus(List pliEos) { + Map result = new HashMap<>(); + + Map projectScheduleExportMap = new HashMap<>(); + + double notStartCount = 0; // 未发起 + double toBeSubmittedCount = 0; // 待提交 + double toBeReviewedCount = 0; // 待审查 + double complianceCount = 0; // 符合 + double nonComplianceCount = 0; // 不符合 + double toBeTrackedCount = 0; // 待追踪 + double notInvolvedCount = 0; // 不涉及 + double taskTerminationCount = 0; // 任务终止 + double count = 0; + // 计算百分比 + double percentage = 0; + String percentageStr = "0"; + if(CollectionUtils.isNotEmpty(pliEos)){ + List designNotStart = pliEos.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.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + || StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List designToBeSubmitted = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List designToBeReviewed = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List designCompliance = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List designNonCompliance = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List designToBeTracked = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List designNotInvolved = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List taskTermination = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getDesignFlowStatus(),ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + notStartCount = designNotStart.size(); + toBeSubmittedCount = designToBeSubmitted.size(); + toBeReviewedCount = designToBeReviewed.size(); + complianceCount = designCompliance.size(); + nonComplianceCount = designNonCompliance.size(); + toBeTrackedCount = designToBeTracked.size(); + notInvolvedCount = designNotInvolved.size(); + taskTerminationCount = taskTermination.size(); + count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + notInvolvedCount + taskTerminationCount; + // 计算百分比 + percentage = complianceCount / count * 100; + percentageStr = percentage != 0 ? df.format(percentage) : "0"; + } + + projectScheduleExportMap.put("notStart",notStartCount); + projectScheduleExportMap.put("toBeSubmitted",toBeSubmittedCount); + projectScheduleExportMap.put("toBeReviewed",toBeReviewedCount); + projectScheduleExportMap.put("compliance",complianceCount); + projectScheduleExportMap.put("nonCompliance",nonComplianceCount); + projectScheduleExportMap.put("toBeTracked",toBeTrackedCount); + projectScheduleExportMap.put("notInvolved",notInvolvedCount); + projectScheduleExportMap.put("taskTermination",taskTerminationCount); + projectScheduleExportMap.put("count",count); + projectScheduleExportMap.put("percentage",percentageStr + percentSign); + result.put("projectScheduleExportMap",projectScheduleExportMap); + return result; + } + + @Override + public Map groupByVerifyStatus(List pliEos) { + Map result = new HashMap<>(); + + Map projectScheduleExportMap = new HashMap<>(); + + double notStartCount = 0; // 未发起 + double toBeSubmittedCount = 0; // 待提交 + double toBeReviewedCount = 0; // 待审查 + double complianceCount = 0; // 符合 + double nonComplianceCount = 0; // 不符合 + double toBeTrackedCount = 0; // 待追踪 + double notInvolvedCount = 0; // 不涉及 + double taskTerminationCount = 0; // 任务终止 + double count = 0; + // 计算百分比 + double percentage = 0; + String percentageStr = "0"; + if(CollectionUtils.isNotEmpty(pliEos)){ + List verifyNotStart = pliEos.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.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + || StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List verifyToBeSubmitted = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List verifyToBeReviewed = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List verifyCompliance = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List verifyNonCompliance = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List verifyToBeTracked = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List verifyNotInvolved = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + List taskTermination = pliEos.stream().filter(pliEo -> { + boolean flag = ( + StringUtils.equals(pliEo.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + notStartCount = verifyNotStart.size(); + toBeSubmittedCount = verifyToBeSubmitted.size(); + toBeReviewedCount = verifyToBeReviewed.size(); + complianceCount = verifyCompliance.size(); + nonComplianceCount = verifyNonCompliance.size(); + toBeTrackedCount = verifyToBeTracked.size(); + notInvolvedCount = verifyNotInvolved.size(); + taskTerminationCount = taskTermination.size(); + count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + notInvolvedCount + taskTerminationCount; + // 计算百分比 + percentage = complianceCount / count * 100; + percentageStr = percentage != 0 ? df.format(percentage) : "0"; + } + + projectScheduleExportMap.put("notStart",notStartCount); + projectScheduleExportMap.put("toBeSubmitted",toBeSubmittedCount); + projectScheduleExportMap.put("toBeReviewed",toBeReviewedCount); + projectScheduleExportMap.put("compliance",complianceCount); + projectScheduleExportMap.put("nonCompliance",nonComplianceCount); + projectScheduleExportMap.put("toBeTracked",toBeTrackedCount); + projectScheduleExportMap.put("notInvolved",notInvolvedCount); + projectScheduleExportMap.put("taskTermination",taskTerminationCount); + projectScheduleExportMap.put("count",count); + projectScheduleExportMap.put("percentage",percentageStr + percentSign); + result.put("projectScheduleExportMap",projectScheduleExportMap); + return result; + } +} + @Override public Map>> queryDutyPersonByProjectId(Map params) { Map>> result = new HashMap<>(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index 1e8fc39d4..71dd57ef4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -14,6 +14,7 @@ import com.jero.common.system.vo.LoginUser; import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO; import com.jero.modules.cert.collect.entity.ParamsManifestEO; import com.jero.modules.cert.collect.enums.CollectManifestStateEnum; +import com.jero.modules.cert.collect.enums.CollectManifestStatisticsStateEnum; import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService; import com.jero.modules.cert.collect.service.IParamsManifestEOService; import com.jero.modules.dummy.enums.OrderEnum; @@ -50,7 +51,10 @@ import org.apache.commons.lang3.ObjectUtils; 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.CellStyle; +import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.util.CellRangeAddress; import org.apache.shiro.SecurityUtils; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; @@ -165,7 +169,12 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl params, List targetMarketList, ProjectLibraryBase projectLibraryBase) { + public String getMarket(Map params, List targetMarketList, ProjectLibraryBase projectLibraryBase) { List dictModelList = new ArrayList<>(); for (String s : projectLibraryBase.getTargetMarket().split(",")) { List dictModelListTemp = targetMarketList.stream() @@ -1493,27 +1502,27 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl verifyComplianceMap = new HashMap<>(); //认证进度 Map certificationProgressMap = new HashMap<>(); + // 认证任务确认 + Map rzTaskToConfirmMap = new HashMap<>(); //清单确认统计 - List> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id); + /*List> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id); listingToConfirmMap.put("listingToConfirmMapList",listingToConfirmMapList); - result.put("listingToConfirmMap",listingToConfirmMap); - - //任务确认统计 - List> taskToConfirmMapList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatistics(id); - taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList); - result.put("taskToConfirmMap",taskToConfirmMap); + result.put("listingToConfirmMap",listingToConfirmMap);*/ QueryWrapper lawsInventoryEOQueryWrapper = new QueryWrapper<>(); lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getProjectLibraryId,Arrays.asList(id.split(","))); - //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue()); - //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue()); List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ List projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); + //任务确认统计 + List> taskToConfirmMapList = this.projectLawsInventoryEOService.getTaskToConfirmStatistics(projectLawsInventoryEOList); + taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList); + result.put("taskToConfirmMap",taskToConfirmMap); + //当前项目状态统计 获取一个 最差的结果 统计的数据 就是studio看到的数据。 - List> currentProjectStatusMapList = new ArrayList<>(); + /*List> currentProjectStatusMapList = new ArrayList<>(); CurrentProjectStatusEnum[] values = CurrentProjectStatusEnum.values(); for (CurrentProjectStatusEnum value : values) { Map map = new HashMap<>(); @@ -1536,25 +1545,20 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl> designComplianceMapList = this.projectTaskInventoryEOMapper.getDesignComplianceStatistice(projectLawsInventoryIdList); + List> designComplianceMapList = this.projectLawsInventoryEOService.getDesignComplianceStatistice(projectLawsInventoryEOList); designComplianceMap.put("designComplianceMapList",designComplianceMapList); result.put("designComplianceMap",designComplianceMap); - //prehomo确认 - List> prehomoMapList = this.projectTaskInventoryEOMapper.getPrehomoStatistice(projectLawsInventoryIdList); - prehomoMap.put("prehomoMapList",prehomoMapList); - result.put("prehomoMap",prehomoMap); - //验证符合性 - List> verifyComplianceMapList = this.projectTaskInventoryEOMapper.getVerifyComplianceStatistice(projectLawsInventoryIdList); + List> verifyComplianceMapList = this.projectLawsInventoryEOService.getVerifyComplianceStatistice(projectLawsInventoryEOList); verifyComplianceMap.put("verifyComplianceMapList",verifyComplianceMapList); result.put("verifyComplianceMap",verifyComplianceMap); //认证进度统计 - int certificationProgressTotal; + /*int certificationProgressTotal; List> certificationProgressMapList = this.projectTaskInventoryEOMapper.getCertificationProgressStatistics(projectLawsInventoryIdList); certificationProgressTotal = certificationProgressMapList.stream().filter( certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString()) != 0 @@ -1581,6 +1585,30 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().in(ProjectCertificationInventoryEO::getProjectLibraryId,Arrays.asList(id.split(","))); + List pciEoList = this.projectCertificationInventoryEOService.list(pciQueryWrap); + if(CollectionUtils.isNotEmpty(pciEoList)){ + // 认证清单-任务确认统计 + List> rzTaskToConfirmMapList = this.projectCertificationInventoryEOService.getTaskToConfirmStatistics(pciEoList); + rzTaskToConfirmMap.put("rzTaskToConfirmMapList",rzTaskToConfirmMapList); + result.put("rzTaskToConfirmMap",rzTaskToConfirmMap); + + // Pre-Homo 统计 + List> prehomoMapList = this.projectCertificationInventoryEOService.getPrehomoStatistice(pciEoList); + prehomoMap.put("prehomoMapList",prehomoMapList); + result.put("prehomoMap",prehomoMap); + + // 认证进度 统计 + List> allMapList = this.projectCertificationInventoryEOService.getAllCertificationProgressStatistics(pciEoList); + List> carMapList = this.projectCertificationInventoryEOService.getCarCertificationProgressStatistics(pciEoList); + List> partMapList = this.projectCertificationInventoryEOService.getPartCertificationProgressStatistics(pciEoList); + certificationProgressMap.put("allMapList",allMapList);// 全部 + certificationProgressMap.put("carMapList",carMapList);// 整车 + certificationProgressMap.put("partMapList",partMapList);// 零部件 result.put("certificationProgressMap",certificationProgressMap); } @@ -1712,66 +1740,245 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl result = new HashMap<>(); + List> dataList = new ArrayList<>(); QueryWrapper lawsInventoryEOQueryWrapper = new QueryWrapper<>(); lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); - lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue()); - lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue()); List projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); - List projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); - if(StringUtils.equals(OperatorTypeEnum.QUERY_CURRENT_PROJECT_STATUS_STATISTICS.getValue(),operatorType)){ - params.put("projectLawsInventoryIdList",projectLawsInventoryIdList); - List> conditionAssessmentMapList = this.conditionAssessmentEOService.getProjectStatusAssessStatisticsGroupByTerritory(params); - disposeData(conditionAssessmentMapList,cut); - result.put("dataList",conditionAssessmentMapList); - }else if(StringUtils.equals(OperatorTypeEnum.QUERY_LISTING_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ - //清单确认 状态 - String inventoryAffirmStatus = (String) params.get("inventoryAffirmStatus"); - List> listingToConfirmList = this.projectLawsInventoryEOMapper.getListingToConfirmStatisticsGroupByTerritory(projectLibraryId,inventoryAffirmStatus); - disposeData(listingToConfirmList,cut); - result.put("dataList",listingToConfirmList); - }else if(StringUtils.equals(OperatorTypeEnum.QUERY_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ - //任务确认 状态 - String taskAffirmStatus = (String) params.get("taskAffirmStatus"); - List> taskToConfirmList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatisticsGroupByTerritory(projectLibraryId,taskAffirmStatus); - disposeData(taskToConfirmList,cut); - result.put("dataList",taskToConfirmList); - }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ - //设计符合性 流程任务状态 - String designFlowTaskStatus = (String) params.get("designFlowTaskStatus"); - if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ - List> designComplianceList = this.projectTaskInventoryEOMapper.getDesignComplianceStatisticeGroupByTerritory(projectLawsInventoryIdList,designFlowTaskStatus); - disposeData(designComplianceList,cut); - result.put("dataList",designComplianceList); - } - }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ - //prehomo确认 流程任务状态 - String prehomoFlowTaskStatus = (String) params.get("prehomoFlowTaskStatus"); - if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ - List> prehomoList = this.projectTaskInventoryEOMapper.getPrehomoStatisticeGroupByTerritory(projectLawsInventoryIdList,prehomoFlowTaskStatus); - disposeData(prehomoList,cut); - result.put("dataList",prehomoList); - } - }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ - //验证符合性 流程任务状态 - String verifyFlowTaskStatus = (String) params.get("verifyFlowTaskStatus"); + List sysDictItems = new ArrayList<>(); + // 法规清单所有的责任领域 + String pliDutyTerritoryStr = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pliDutyTerritoryStr)) { + List pliDutyTerritoryList = Arrays.asList(pliDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pliDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } - if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ - List> verifyComplianceList = this.projectTaskInventoryEOMapper.getVerifyComplianceStatisticeGroupByTerritory(projectLawsInventoryIdList,verifyFlowTaskStatus); - disposeData(verifyComplianceList,cut); - result.put("dataList",verifyComplianceList); - } - }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS.getValue(),operatorType)){ - //认证进度 流程任务状态 - String certificationProgress = (String) params.get("certificationProgress"); + Map pliEoMap = new HashMap<>(); - if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ - List> certificationProgressList = this.projectTaskInventoryEOMapper.getCertificationProgressStatisticsGroupByTerritory(projectLawsInventoryIdList,certificationProgress); - disposeData(certificationProgressList,cut); - result.put("dataList",certificationProgressList); + Map> firstLevelDutyTerritoryMapFG = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMapFG)){ + // 根据责任领域组装法规清单数据,后续计算使用 + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMapFG.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pliEoList = projectLawsInventoryEOList.stream().filter(pliEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pliEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + JSONObject json = new JSONObject(); + json.put("dutyTerritoryList",dutyTerritoryList); + json.put("pliEoList",pliEoList); + pliEoMap.put(key,json); } } + String status = (String) params.get("status"); + if (CollectionUtils.isNotEmpty(projectLawsInventoryEOList)) { + for (Map.Entry pliMap : pliEoMap.entrySet()) { + String key = pliMap.getKey(); + JSONObject json = (JSONObject) pliMap.getValue(); + List pliEoList = (List) json.get("pliEoList"); + Map dataMaps = new HashMap<>(); + if(StringUtils.equals(OperatorTypeEnum.QUERY_FG_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritory(pliEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getDesignComplianceStatisticeGroupByTerritory(pliEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getVerifyComplianceStatisticeGroupByTerritory(pliEoList,params); + } + if(ObjectUtils.isEmpty(dataMaps)){ + continue; + } + Map dataMap = (Map) dataMaps.get(status); + double amount = (double) dataMap.get("amount"); + if(amount != 0){ + dataMap.put("dutyTerritoryName",key); + dataList.add(dataMap); + } + } + if(CollectionUtils.isNotEmpty(dataList)){ + result.put("dataList",dataList); + return result; + } +// if(StringUtils.equals(OperatorTypeEnum.QUERY_FG_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ +// if(ObjectUtils.isNotEmpty(pliEoMap)){ +// +// List> dataList = new ArrayList<>(); +// for (Map.Entry pliMap : pliEoMap.entrySet()) { +// String key = pliMap.getKey(); +// JSONObject json = (JSONObject) pliMap.getValue(); +// List pliEoList = (List) json.get("pliEoList"); +// Map dataMaps = this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritory(pliEoList,params); +// Map dataMap = (Map) dataMaps.get(status); +// double amount = (double) dataMap.get("amount"); +// if(amount != 0){ +// dataMap.put("dutyTerritoryName",key); +// dataList.add(dataMap); +// } +// } +// result.put("dataList",dataList); +// } +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CURRENT_PROJECT_STATUS_STATISTICS.getValue(),operatorType)){ +// params.put("projectLawsInventoryIdList",projectLawsInventoryIdList); +// List> conditionAssessmentMapList = this.conditionAssessmentEOService.getProjectStatusAssessStatisticsGroupByTerritory(params); +// disposeData(conditionAssessmentMapList,cut); +// result.put("dataList",conditionAssessmentMapList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_LISTING_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ +// //清单确认 状态 +// String inventoryAffirmStatus = (String) params.get("inventoryAffirmStatus"); +// List> listingToConfirmList = this.projectLawsInventoryEOMapper.getListingToConfirmStatisticsGroupByTerritory(projectLibraryId,inventoryAffirmStatus); +// disposeData(listingToConfirmList,cut); +// result.put("dataList",listingToConfirmList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ +// //任务确认 状态 +// String taskAffirmStatus = (String) params.get("taskAffirmStatus"); +// List> taskToConfirmList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatisticsGroupByTerritory(projectLibraryId,taskAffirmStatus); +// disposeData(taskToConfirmList,cut); +// result.put("dataList",taskToConfirmList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_DESIGN_STATISTICS.getValue(),operatorType)){ +// //设计符合性 +// List> dataList = new ArrayList<>(); +// for (Map.Entry pliMap : pliEoMap.entrySet()) { +// String key = pliMap.getKey(); +// JSONObject json = (JSONObject) pliMap.getValue(); +// List pliEoList = (List) json.get("pliEoList"); +// Map dataMaps = this.projectLibraryStatisticsService.getDesignComplianceStatisticeGroupByTerritory(pliEoList,params); +// Map dataMap = (Map) dataMaps.get(status); +// double amount = (double) dataMap.get("amount"); +// if(amount != 0){ +// dataMap.put("dutyTerritoryName",key); +// dataList.add(dataMap); +// } +// } +// result.put("dataList",dataList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ +// //prehomo确认 流程任务状态 +// String prehomoFlowTaskStatus = (String) params.get("prehomoFlowTaskStatus"); +// if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ +// List> prehomoList = this.projectTaskInventoryEOMapper.getPrehomoStatisticeGroupByTerritory(projectLawsInventoryIdList,prehomoFlowTaskStatus); +// disposeData(prehomoList,cut); +// result.put("dataList",prehomoList); +// } +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_VERIFY_STATISTICS.getValue(),operatorType)){ +// //验证符合性 流程任务状态 +// List> dataList = new ArrayList<>(); +// for (Map.Entry pliMap : pliEoMap.entrySet()) { +// String key = pliMap.getKey(); +// JSONObject json = (JSONObject) pliMap.getValue(); +// List pliEoList = (List) json.get("pliEoList"); +// Map dataMaps = this.projectLibraryStatisticsService.getVerifyComplianceStatisticeGroupByTerritory(pliEoList,params); +// Map dataMap = (Map) dataMaps.get(status); +// double amount = (double) dataMap.get("amount"); +// if(amount != 0){ +// dataMap.put("dutyTerritoryName",key); +// dataList.add(dataMap); +// } +// } +// result.put("dataList",dataList); +// }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS.getValue(),operatorType)){ +// //认证进度 流程任务状态 +// String certificationProgress = (String) params.get("certificationProgress"); +// +// if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ +// List> certificationProgressList = this.projectTaskInventoryEOMapper.getCertificationProgressStatisticsGroupByTerritory(projectLawsInventoryIdList,certificationProgress); +// disposeData(certificationProgressList,cut); +// result.put("dataList",certificationProgressList); +// } +// } + } + + Map pciEoMap = new HashMap<>(); + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryId); + List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(pciQueryWrap); + String pciDutyTerritoryStr = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pciDutyTerritoryStr)) { + List pciDutyTerritoryList = Arrays.asList(pciDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pciDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + Map> firstLevelDutyTerritoryMapRZ = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMapRZ)){ + // 根据责任领域组装法规清单数据,后续计算使用 + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMapRZ.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pciEoList = projectCertificationInventoryEOList.stream().filter(pciEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pciEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + JSONObject json = new JSONObject(); + json.put("dutyTerritoryList",dutyTerritoryList); + json.put("pciEoList",pciEoList); + pciEoMap.put(key,json); + } + } + if (CollectionUtils.isNotEmpty(projectCertificationInventoryEOList) && ObjectUtils.isNotEmpty(pciEoMap)) { + for (Map.Entry pciMap : pciEoMap.entrySet()) { + String key = pciMap.getKey(); + JSONObject json = (JSONObject) pciMap.getValue(); + List pciEoList = (List) json.get("pciEoList"); + Map dataMaps = new HashMap<>(); + if(StringUtils.equals(OperatorTypeEnum.QUERY_RZ_TASK_TO_CONFIRM_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getRZTaskToConfirmStatisticsGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_PREHOMO_STATISTICS.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getPrehomoStatisticeGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_ALL.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getAllCertificationProgressStatisticsGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_CAR.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getCarCertificationProgressStatisticsGroupByTerritory(pciEoList,params); + }else if(StringUtils.equals(OperatorTypeEnum.QUERY_CERTIFICATION_PROGRESS_STATISTICS_PART.getValue(),operatorType)){ + dataMaps = this.projectLibraryStatisticsService.getPartCertificationProgressStatisticsGroupByTerritory(pciEoList,params); + } + if(ObjectUtils.isEmpty(dataMaps)){ + continue; + } + Map dataMap = (Map) dataMaps.get(status); + double amount = (double) dataMap.get("amount"); + if(amount != 0){ + dataMap.put("dutyTerritoryName",key); + dataList.add(dataMap); + } + } + result.put("dataList",dataList); + } return result; } @@ -1783,8 +1990,25 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl projectDetailsStatisticsGroupByTerritory, Map params){ - List> exportData = new ArrayList<>(); - exportData = (List>) projectDetailsStatisticsGroupByTerritory.get("dataList"); + public void createSheetData(HSSFSheet sheet,Map exportDataMap, Map params){ + List> exportDataList = (List>) exportDataMap.get("dataList"); int rowIndex = 1; - for (int dataIndex = 0; dataIndex < exportData.size(); dataIndex++) { + for (int dataIndex = 0; dataIndex < exportDataList.size(); dataIndex++) { Row dataRow = sheet.createRow(rowIndex); - dataRow.createCell(0).setCellValue(exportData.get(dataIndex).get("dutyTerritoryName").toString()); - dataRow.createCell(1).setCellValue(exportData.get(dataIndex).get("amount").toString()); + dataRow.createCell(0).setCellValue(exportDataList.get(dataIndex).get("dutyTerritoryName").toString()); + dataRow.createCell(1).setCellValue(String.valueOf(Math.round((Double) exportDataList.get(dataIndex).get("amount")))); + dataRow.createCell(2).setCellValue(exportDataList.get(dataIndex).get("percentage").toString()); rowIndex ++; } } @@ -1989,7 +2234,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl list = this.list(wrapper); if(list.size() != 0){ - Collections.sort(list); +// Collections.sort(list); } return list; } @@ -2157,6 +2402,515 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl params) { + String fileName = ""; + String cut = (String) params.get("cut"); + String projectLibraryId = (String) params.get("projectLibraryId"); + if(StringUtils.isEmpty(projectLibraryId)){ + throw new JeroBootException("项目库id不能为空!"); + } + OutputStream ops = null; + HSSFWorkbook workbook = new HSSFWorkbook(); + this.exportRegulatoryManagement(workbook,params); + this.exportCertificationManagement(workbook,params); + this.exportParameterCollecting(workbook,params); + try { + response.setHeader("Content-Disposition", + "attachment; filename=" + fileName); + response.setContentType("application/force-download"); + ops = response.getOutputStream(); + workbook.write(ops); + ops.flush(); + }catch (IOException ex){ + if(CutEnum.CN.getValue().equals(cut)){ + throw new JeroBootException("下载文件失败"); + }else{ + throw new JeroBootException("Failed to download file"); + } + } + } + + /** + * 导出法规符合性管理 + * @param workbook + * @param params + */ + private void exportRegulatoryManagement(HSSFWorkbook workbook,Map 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"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + //合并单元格 起始行,结束行,起始列,结束列 + CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5); + sheet.addMergedRegion(region1); + CellRangeAddress region2 = new CellRangeAddress(0, 0, 6, 10); + sheet.addMergedRegion(region2); + CellRangeAddress region3 = new CellRangeAddress(0, 0, 11, 15); + sheet.addMergedRegion(region3); + + String[] firstTitleArr = firstTitle.split(","); + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i <= 15; i++){ + sheet.setColumnWidth(i, 3500); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 1){ + firstRowCell.setCellValue(firstTitleArr[0]); + }else if(i==6){ + firstRowCell.setCellValue(firstTitleArr[1]); + }else if(i==11){ + firstRowCell.setCellValue(firstTitleArr[2]); + } + + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i]); + } + + String projectLibraryId = (String) params.get("projectLibraryId"); + + QueryWrapper pliQueryWrap = new QueryWrapper<>(); + pliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId); + List pliEOList = this.projectLawsInventoryEOMapper.selectList(pliQueryWrap); + List sysDictItems = new ArrayList<>(); + String pliDutyTerritoryStr = pliEOList.stream().map(ProjectLawsInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pliDutyTerritoryStr)) { + List pliDutyTerritoryList = Arrays.asList(pliDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pliDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + + Map> firstLevelDutyTerritoryMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMap)){ + int dataIndex = 2; + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMap.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pliEoList = pliEOList.stream().filter(pliEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pliEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + this.exportRegulatoryManagementSetData(params, sheet, dataIndex ,key,pliEoList); + dataIndex ++; + } + } + } + + /** + * 导出法规符合性管理-设置数据 + * @param params + * @param sheet + * @param dataIndex + * @param key + * @param pliEoList + */ + private void exportRegulatoryManagementSetData(Map params, HSSFSheet sheet, int dataIndex, String key, List pliEoList) { + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(key); + + Map taskConfirmMap= this.projectLibraryStatisticsService.getFGTaskToConfirmStatisticsGroupByTerritory(pliEoList, params); + Map taskConfirmNotStartedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double taskConfirmNotStartedAmount = (double) taskConfirmNotStartedMap.get("amount"); + Map taskConfirmToConfirmMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double taskConfirmToConfirmAmount = (double) taskConfirmToConfirmMap.get("amount"); + Map taskConfirmAcceptedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.ACCEPTED.getValue()); + double taskConfirmAcceptedAmount = (double) taskConfirmAcceptedMap.get("amount"); + Map taskConfirmRejectedMap = (Map) 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 designMap = this.projectLibraryStatisticsService.getDesignComplianceStatisticeGroupByTerritory(pliEoList, params); + Map designNotStartedMap = (Map) designMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double designNotStartedAmount = (double) designNotStartedMap.get("amount"); + Map designToConfirmMap = (Map) designMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double designToConfirmAmount = (double) designToConfirmMap.get("amount"); + Map designComplianceMap = (Map) designMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue()); + double designComplianceAmount = (double) designComplianceMap.get("amount"); + Map designNonComplianceMap = (Map) 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 verifyMap = this.projectLibraryStatisticsService.getVerifyComplianceStatisticeGroupByTerritory(pliEoList, params); + Map verifyNotStartedMap = (Map) verifyMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double verifyNotStartedAmount = (double) verifyNotStartedMap.get("amount"); + Map verifyToConfirmMap = (Map) verifyMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double verifyToConfirmAmount = (double) verifyToConfirmMap.get("amount"); + Map verifyComplianceMap = (Map) verifyMap.get(ComplianceFlowStatusEnum.CONFORMITY.getValue()); + double verifyComplianceAmount = (double) verifyComplianceMap.get("amount"); + Map verifyNonComplianceMap = (Map) 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; + String verifyPercentageStr = (verifyPercentage != 0 && (verifyCount !=0 )) ? df.format(verifyPercentage) : "0"; + dataRow.createCell(15).setCellValue(verifyPercentageStr + percentSign); + } + + /** + * 导出认证活动管理 + * @param workbook + * @param params + */ + private void exportCertificationManagement(HSSFWorkbook workbook,Map params){ + String cut = (String) params.get("cut"); + String sheetName = "认证活动管理"; + String firstTitle = "认证任务确认," + + "Pre-Homo," + + "认证进度"; + String secondTitle = "责任领域(一级)," + + "未发起,待确认,接受,拒绝,完成度," + + "未发起,待确认,审查通过,审查退回,完成度," + + "未开始,进行中,实验通过,实验失败,部件报告未上传,部件报告已上传,部件报告已入库,完成度"; + if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "Certification Activity Management"; + firstTitle = "Authentication task confirmation," + + "Pre-Homo," + + "Certification progress"; + 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"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + + //合并单元格 起始行,结束行,起始列,结束列 + CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5); + sheet.addMergedRegion(region1); + CellRangeAddress region2 = new CellRangeAddress(0, 0, 6, 10); + sheet.addMergedRegion(region2); + CellRangeAddress region3 = new CellRangeAddress(0, 0, 11, 18); + sheet.addMergedRegion(region3); + CellRangeAddress region4 = new CellRangeAddress(0, 0, 19, 23); + sheet.addMergedRegion(region4); + + String[] firstTitleArr = firstTitle.split(","); + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i <= 18; i++){ + sheet.setColumnWidth(i, 3500); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 1){ + firstRowCell.setCellValue(firstTitleArr[0]); + }else if(i==6){ + firstRowCell.setCellValue(firstTitleArr[1]); + }else if(i==11){ + firstRowCell.setCellValue(firstTitleArr[2]); + }else if(i==19){ + firstRowCell.setCellValue(firstTitleArr[3]); + } + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i]); + } + + String projectLibraryId = (String) params.get("projectLibraryId"); + QueryWrapper pciQueryWrap = new QueryWrapper<>(); + pciQueryWrap.lambda().eq(ProjectCertificationInventoryEO::getProjectLibraryId,projectLibraryId); + List projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(pciQueryWrap); + String pciDutyTerritoryStr = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyTerritory).collect(Collectors.joining(",")); + List sysDictItems = new ArrayList<>(); + if (StringUtils.isNotEmpty(pciDutyTerritoryStr)) { + List pciDutyTerritoryList = Arrays.asList(pciDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pliDutyTerritory : pciDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pliDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + Map> firstLevelDutyTerritoryMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMap)){ + int dataIndex = 2; + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMap.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pciEoList = projectCertificationInventoryEOList.stream().filter(pciEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pciEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + this.exportCertificationManagementSetData(params, sheet, dataIndex, key, pciEoList); + + dataIndex ++; + } + } + } + + /** + * 导出认证活动管理-设置数据 + * @param params + * @param sheet + * @param dataIndex + * @param key + * @param pciEoList + */ + private void exportCertificationManagementSetData(Map params, HSSFSheet sheet, int dataIndex, String key, List pciEoList) { + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(key); + + Map taskConfirmMap = this.projectLibraryStatisticsService.getRZTaskToConfirmStatisticsGroupByTerritory(pciEoList, params); + Map taskConfirmNotStartedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double taskConfirmNotStartedAmount = (double) taskConfirmNotStartedMap.get("amount"); + Map taskConfirmToConfirmMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double taskConfirmToConfirmAmount = (double) taskConfirmToConfirmMap.get("amount"); + Map taskConfirmAcceptedMap = (Map) taskConfirmMap.get(TaskAffirmStatusEnum.ACCEPTED.getValue()); + double taskConfirmAcceptedAmount = (double) taskConfirmAcceptedMap.get("amount"); + Map taskConfirmRejectedMap = (Map) 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 prehomoMap = this.projectLibraryStatisticsService.getPrehomoStatisticeGroupByTerritory(pciEoList, params); + Map prehomoNotStartedMap = (Map) prehomoMap.get(TaskAffirmStatusEnum.NOT_STARTED.getValue()); + double prehomoNotStartedAmount = (double) prehomoNotStartedMap.get("amount"); + Map prehomoToConfirmMap = (Map) prehomoMap.get(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue()); + double prehomoToConfirmAmount = (double) prehomoToConfirmMap.get("amount"); + Map prehomoAcceptedMap = (Map) prehomoMap.get(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()); + double prehomoAcceptedAmount = (double) prehomoAcceptedMap.get("amount"); + Map prehomoRejectedMap = (Map) 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; + String prehomoPercentageStr = (prehomoPercentage != 0 && (prehomoCount !=0 )) ? df.format(prehomoPercentage) : "0"; + dataRow.createCell(10).setCellValue(prehomoPercentageStr + percentSign); + + Map certificationProgressMap = this.projectLibraryStatisticsService.getPartCertificationProgressStatisticsGroupByTerritory(pciEoList, params); + Map certificationProgressNotStartMap = (Map)certificationProgressMap.get(CertificationProgressEnum.NOT_START.getValue()); + double certificationProgressNotStartAmount = (double) certificationProgressNotStartMap.get("amount"); + Map certificationProgressInProgressMap = (Map)certificationProgressMap.get(CertificationProgressEnum.IN_PROGRESS.getValue()); + double certificationProgressInProgressAmount = (double) certificationProgressInProgressMap.get("amount"); + Map certificationProgressTestPassedMap = (Map)certificationProgressMap.get(CertificationProgressEnum.TEST_PASSED.getValue()); + double certificationProgressTestPassedAmount = (double) certificationProgressTestPassedMap.get("amount"); + Map certificationProgressTestFailedMap = (Map)certificationProgressMap.get(CertificationProgressEnum.TEST_FAILED.getValue()); + double certificationProgressTestFailedAmount = (double) certificationProgressTestFailedMap.get("amount"); + Map certificationProgressNotSubmitMap = (Map)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()); + double certificationProgressNotSubmitAmount = (double) certificationProgressNotSubmitMap.get("amount"); + Map certificationProgressSubmitMap = (Map)certificationProgressMap.get(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()); + double certificationProgressSubmitAmount = (double) certificationProgressSubmitMap.get("amount"); + Map certificationProgressStoredMap = (Map)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); + double certificationProgressCount = certificationProgressNotStartAmount + certificationProgressInProgressAmount + + certificationProgressTestPassedAmount + certificationProgressTestFailedAmount + + certificationProgressNotSubmitAmount + certificationProgressSubmitAmount + + certificationProgressStoredAmount; + double certificationProgressPercentage = (certificationProgressTestPassedAmount / certificationProgressCount) * 100; + String certificationProgressPercentageStr = (certificationProgressPercentage != 0 && (certificationProgressCount !=0 )) ? df.format(certificationProgressPercentage) : "0"; + dataRow.createCell(18).setCellValue(certificationProgressPercentageStr + percentSign); + } + + /** + * 导出认证参数收集 + * @param workbook + * @param params + */ + private void exportParameterCollecting(HSSFWorkbook workbook, Map params) { + String cut = (String) params.get("cut"); + String sheetName = "认证参数收集"; + String firstTitle = "认证参数收集"; + String secondTitle = "责任领域(一级),未开始,收集中,已提交,已同步至上报库,完成度"; + if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "Authentication parameter collection"; + firstTitle = "Authentication parameter collection"; + secondTitle = "Area of responsibility (level 1),Not started,Collecting,Has submitted,Synced to the report library,Degree of completion"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + //合并单元格 起始行,结束行,起始列,结束列 + CellRangeAddress region1 = new CellRangeAddress(0, 0, 1, 5); + sheet.addMergedRegion(region1); + + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + for (int i = 0; i <= 5; i++){ + sheet.setColumnWidth(i, 3500); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 1){ + firstRowCell.setCellValue(firstTitle); + } + + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i]); + } + + String projectLibraryId = (String) params.get("projectLibraryId"); + + QueryWrapper pmQueryWrap = new QueryWrapper<>(); + pmQueryWrap.lambda().eq(ParamsManifestEO::getProjectId,projectLibraryId); + List pmEoList = this.paramsManifestEOService.list(pmQueryWrap); + if(CollectionUtils.isNotEmpty(pmEoList)){ + List pmIdList = pmEoList.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pcmQueryWrap = new QueryWrapper<>(); + pcmQueryWrap.lambda().in(ParamsCollectManifestEO::getParamsManifestId,pmIdList); + List pcmEoList = this.paramsCollectManifestEOService.list(pcmQueryWrap); + + List sysDictItems = new ArrayList<>(); + String pcmDutyTerritoryStr = pcmEoList.stream().map(ParamsCollectManifestEO::getDutyTerritory).collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(pcmDutyTerritoryStr)) { + List pcmDutyTerritoryList = Arrays.asList(pcmDutyTerritoryStr.split(",")).stream().distinct().collect(Collectors.toList()); + sysDictItems = this.sysDictItemServiceImpl.selectItemsAll().stream().filter(sysDictItem -> { + boolean flag = false; + for (String pcmDutyTerritory : pcmDutyTerritoryList) { + if(StringUtils.equals(sysDictItem.getItemValue(),pcmDutyTerritory)){ + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + } + + Map> firstLevelDutyTerritoryMap = this.sysDictItemServiceImpl.getFirstLevelSysDictItemByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue(),sysDictItems); + if(ObjectUtils.isNotEmpty(firstLevelDutyTerritoryMap)){ + int dataIndex = 2; + for (Map.Entry> firstLevelMap : firstLevelDutyTerritoryMap.entrySet()) { + String key = firstLevelMap.getKey(); + List dutyTerritoryList = firstLevelMap.getValue(); + if(StringUtils.isEmpty(key) || CollectionUtils.isEmpty(dutyTerritoryList)){ + continue; + } + List pcmEos = pcmEoList.stream().filter(pcmEo -> { + boolean flag = false; + for (SysDictItem dutyTerritory : dutyTerritoryList) { + if (StringUtils.contains(pcmEo.getDutyTerritory(), dutyTerritory.getItemValue())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(pcmEos)){ + this.exportParameterCollectingSetData(params, sheet, dataIndex ,key,pcmEos); + } + dataIndex ++; + } + } + } + } + + /** + * 导出认证参数收集-设置数据 + * @param params + * @param sheet + * @param dataIndex + * @param key + * @param pcmEos + */ + private void exportParameterCollectingSetData(Map params, HSSFSheet sheet, int dataIndex, String key, List pcmEos) { + Map parameterCollectingMap = this.projectLibraryStatisticsService.getParameterCollectingStatisticsGroupByTerritory(pcmEos,params); + Map notStartMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.NOT_START.getValue()); + double notStartAmount = (double) notStartMap.get("amount"); + Map collectingMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.COLLECTING.getValue()); + double collectingAmount = (double) collectingMap.get("amount"); + Map submitMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SUBMIT.getValue()); + double submitAmount = (double) submitMap.get("amount"); + Map syncReporMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SYNC_REPORT.getValue()); + double syncReporAmount = (double) syncReporMap.get("amount"); + + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(key); + dataRow.createCell(1).setCellValue(notStartAmount); + dataRow.createCell(2).setCellValue(collectingAmount); + dataRow.createCell(3).setCellValue(submitAmount); + dataRow.createCell(4).setCellValue(syncReporAmount); + double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount; + double parameterCollectingPercentage = (syncReporAmount / parameterCollectingCount) * 100; + String parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? df.format(parameterCollectingPercentage) : "0"; + dataRow.createCell(5).setCellValue(parameterCollectingPercentageStr + percentSign); + } + private JSONArray getNodeProgressList(TimeNodeVO nodeTnVo) { //根据节点获取对应进度和时间 JSONArray nodeList = new JSONArray(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryStatisticsServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryStatisticsServiceImpl.java new file mode 100644 index 000000000..301eb8142 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryStatisticsServiceImpl.java @@ -0,0 +1,754 @@ +package com.jero.modules.project.service.impl; + +import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO; +import com.jero.modules.cert.collect.enums.CollectManifestStateEnum; +import com.jero.modules.cert.collect.enums.CollectManifestStatisticsStateEnum; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.jero.modules.project.entity.ProjectLawsInventoryEO; +import com.jero.modules.project.enums.CertificationInventoryFlowStatusEnum; +import com.jero.modules.project.enums.CertificationProgressEnum; +import com.jero.modules.project.enums.ComplianceFlowStatusEnum; +import com.jero.modules.project.enums.TaskAffirmStatusEnum; +import com.jero.modules.project.service.IProjectCertificationInventoryEOService; +import com.jero.modules.project.service.IProjectLawsInventoryEOService; +import com.jero.modules.project.service.IProjectLibraryStatisticsService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.DecimalFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Service +public class ProjectLibraryStatisticsServiceImpl implements IProjectLibraryStatisticsService { + + private static DecimalFormat df = new DecimalFormat("#.00"); + private static String percentSign = "%"; + @Autowired + private IProjectLawsInventoryEOService projectLawsInventoryEOService; + @Autowired + private IProjectCertificationInventoryEOService projectCertificationInventoryEOService; + + @Override + public Map getFGTaskToConfirmStatisticsGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map rejectedMap = new HashMap<>(); + + // 未发起 + List notStartedDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List notStartedVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notStartedComplianceFlowCount = (double) notStartedDesignPliEoList.size() + notStartedVerifyPliEoList.size(); + double notStartedPercentage = (notStartedComplianceFlowCount / (datas.size() * 2)) * 100; + String notStartedPercentageStr = notStartedPercentage != 0 ? df.format(notStartedPercentage) : "0"; + notStartedMap.put("amount",notStartedComplianceFlowCount); + notStartedMap.put("percentage",notStartedPercentageStr + percentSign); + + // 待确认 + List toConfirmDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List toConfirmVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double toConfirmComplianceFlowCount = (double) toConfirmDesignPliEoList.size() + toConfirmVerifyPliEoList.size(); + double toConfirmPercentage = (toConfirmComplianceFlowCount / (datas.size() * 2)) * 100; + String toConfirmPercentageStr = toConfirmPercentage != 0 ? df.format(toConfirmPercentage) : "0"; + toConfirmMap.put("amount",toConfirmComplianceFlowCount); + toConfirmMap.put("percentage",toConfirmPercentageStr + percentSign); + + // 接受 + List acceptedDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List acceptedVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double acceptedComplianceFlowCount = (double) acceptedDesignPliEoList.size() + acceptedVerifyPliEoList.size(); + double acceptedPercentage = (acceptedComplianceFlowCount / (datas.size() * 2)) * 100; + String acceptedPercentageStr = acceptedPercentage != 0 ? df.format(acceptedPercentage) : "0"; + acceptedMap.put("amount",acceptedComplianceFlowCount); + acceptedMap.put("percentage",acceptedPercentageStr + percentSign); + + // 拒绝 + List rejectedDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + List rejectedVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double rejectedComplianceFlowCount = (double) rejectedDesignPliEoList.size() + rejectedVerifyPliEoList.size(); + double rejectedPercentage = (rejectedComplianceFlowCount / (datas.size() * 2)) * 100; + String rejectedPercentageStr = rejectedPercentage != 0 ? df.format(rejectedPercentage) : "0"; + rejectedMap.put("amount",rejectedComplianceFlowCount); + rejectedMap.put("percentage",rejectedPercentageStr + percentSign); + + result.put(TaskAffirmStatusEnum.NOT_STARTED.getValue(),notStartedMap); + result.put(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue(),toConfirmMap); + result.put(TaskAffirmStatusEnum.ACCEPTED.getValue(),acceptedMap); + result.put(TaskAffirmStatusEnum.REJECTED.getValue(),rejectedMap); + } + return result; + } + + @Override + public Map getDesignComplianceStatisticeGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map complianceMap = new HashMap<>(); + Map nonComplianceMap = new HashMap<>(); + + // 未发起 + List notStartedDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notStartedComplianceFlowCount = (double) notStartedDesignPliEoList.size(); + double notStartedPercentage = (notStartedComplianceFlowCount / (datas.size())) * 100; + String notStartedPercentageStr = notStartedPercentage != 0 ? df.format(notStartedPercentage) : "0"; + notStartedMap.put("amount",notStartedComplianceFlowCount); + notStartedMap.put("percentage",notStartedPercentageStr + percentSign); + + // 待确认 + List toConfirmDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double toConfirmComplianceFlowCount = (double) toConfirmDesignPliEoList.size(); + double toConfirmPercentage = (toConfirmComplianceFlowCount / (datas.size())) * 100; + String toConfirmPercentageStr = toConfirmPercentage != 0 ? df.format(toConfirmPercentage) : "0"; + toConfirmMap.put("amount",toConfirmComplianceFlowCount); + toConfirmMap.put("percentage",toConfirmPercentageStr + percentSign); + + // 符合 + List complianceDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double complianceFlowCount = (double) complianceDesignPliEoList.size(); + double compliancePercentage = (complianceFlowCount / (datas.size())) * 100; + String compliancePercentageStr = compliancePercentage != 0 ? df.format(compliancePercentage) : "0"; + complianceMap.put("amount",complianceFlowCount); + complianceMap.put("percentage",compliancePercentageStr + percentSign); + + // 不符合 + List nonComplianceDesignPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getDesignFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double nonComplianceComplianceFlowCount = (double) nonComplianceDesignPliEoList.size(); + double nonCompliancePercentage = (nonComplianceComplianceFlowCount / (datas.size())) * 100; + String nonCompliancePercentageStr = nonCompliancePercentage != 0 ? df.format(nonCompliancePercentage) : "0"; + nonComplianceMap.put("amount",nonComplianceComplianceFlowCount); + nonComplianceMap.put("percentage",nonCompliancePercentageStr + percentSign); + + result.put(TaskAffirmStatusEnum.NOT_STARTED.getValue(),notStartedMap); + result.put(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue(),toConfirmMap); + result.put(ComplianceFlowStatusEnum.CONFORMITY.getValue(),complianceMap); + result.put(ComplianceFlowStatusEnum.INCONFORMITY.getValue(),nonComplianceMap); + } + return result; + } + + @Override + public Map getVerifyComplianceStatisticeGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map complianceMap = new HashMap<>(); + Map nonComplianceMap = new HashMap<>(); + // 未发起 + List notStartedVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.REGULATORY_ENGINEER_RETURNS.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.DUTY_PERSON_REJECTED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notStartedComplianceFlowCount = (double) notStartedVerifyPliEoList.size(); + double notStartedPercentage = (notStartedComplianceFlowCount / (datas.size())) * 100; + String notStartedPercentageStr = notStartedPercentage != 0 ? df.format(notStartedPercentage) : "0"; + notStartedMap.put("amount",notStartedComplianceFlowCount); + notStartedMap.put("percentage",notStartedPercentageStr + percentSign); + + // 待确认 + List toConfirmVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.TO_TRACK.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double toConfirmComplianceFlowCount = (double) toConfirmVerifyPliEoList.size(); + double toConfirmPercentage = (toConfirmComplianceFlowCount / (datas.size())) * 100; + String toConfirmPercentageStr = toConfirmPercentage != 0 ? df.format(toConfirmPercentage) : "0"; + toConfirmMap.put("amount",toConfirmComplianceFlowCount); + toConfirmMap.put("percentage",toConfirmPercentageStr + percentSign); + + // 符合 + List complianceVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.CONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double complianceFlowCount = (double) complianceVerifyPliEoList.size(); + double compliancePercentage = (complianceFlowCount / (datas.size())) * 100; + String compliancePercentageStr = compliancePercentage != 0 ? df.format(compliancePercentage) : "0"; + complianceMap.put("amount",complianceFlowCount); + complianceMap.put("percentage",compliancePercentageStr + percentSign); + + // 不符合 + List nonComplianceVerifyPliEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getVerifyFlowStatus(),ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double nonComplianceComplianceFlowCount = (double) nonComplianceVerifyPliEoList.size(); + double nonCompliancePercentage = (nonComplianceComplianceFlowCount / (datas.size())) * 100; + String nonCompliancePercentageStr = nonCompliancePercentage != 0 ? df.format(nonCompliancePercentage) : "0"; + nonComplianceMap.put("amount",nonComplianceComplianceFlowCount); + nonComplianceMap.put("percentage",nonCompliancePercentageStr + percentSign); + + result.put(TaskAffirmStatusEnum.NOT_STARTED.getValue(),notStartedMap); + result.put(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue(),toConfirmMap); + result.put(ComplianceFlowStatusEnum.CONFORMITY.getValue(),complianceMap); + result.put(ComplianceFlowStatusEnum.INCONFORMITY.getValue(),nonComplianceMap); + } + return result; + } + + @Override + public Map getRZTaskToConfirmStatisticsGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map rejectedMap = new HashMap<>(); + // 未发起 + List notStartedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + double notStartedCount = (double) notStartedPciEoList.size(); + double notStartedPercentage = (notStartedCount / (datas.size())) * 100; + String notStartedPercentageStr = notStartedPercentage != 0 ? df.format(notStartedPercentage) : "0"; + notStartedMap.put("amount",notStartedCount); + notStartedMap.put("percentage",notStartedPercentageStr + percentSign); + + // 待确认 + List toConfirmPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double toConfirmCount = (double) toConfirmPciEoList.size(); + double toConfirmPercentage = (toConfirmCount / (datas.size())) * 100; + String toConfirmPercentageStr = toConfirmPercentage != 0 ? df.format(toConfirmPercentage) : "0"; + toConfirmMap.put("amount",toConfirmCount); + toConfirmMap.put("percentage",toConfirmPercentageStr + percentSign); + + // 接受 + List acceptedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double acceptedCount = (double) acceptedPciEoList.size(); + double acceptedPercentage = (acceptedCount / (datas.size())) * 100; + String acceptedPercentageStr = acceptedPercentage != 0 ? df.format(acceptedPercentage) : "0"; + acceptedMap.put("amount",acceptedCount); + acceptedMap.put("percentage",acceptedPercentageStr + percentSign); + + // 拒绝 + List rejectedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double rejectedCount = (double) rejectedPciEoList.size(); + double rejectedPercentage = (rejectedCount / (datas.size())) * 100; + String rejectedPercentageStr = rejectedPercentage != 0 ? df.format(rejectedPercentage) : "0"; + rejectedMap.put("amount",rejectedCount); + rejectedMap.put("percentage",rejectedPercentageStr + percentSign); + + result.put(TaskAffirmStatusEnum.NOT_STARTED.getValue(),notStartedMap); + result.put(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue(),toConfirmMap); + result.put(TaskAffirmStatusEnum.ACCEPTED.getValue(),acceptedMap); + result.put(TaskAffirmStatusEnum.REJECTED.getValue(),rejectedMap); + } + return result; + } + + @Override + public Map getPrehomoStatisticeGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + DecimalFormat df = new DecimalFormat("#.00"); + + Map notStartedMap = new HashMap<>(); + Map toConfirmMap = new HashMap<>(); + Map acceptedMap = new HashMap<>(); + Map rejectedMap = new HashMap<>(); + + // 未发起 + List notStartedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.CERTIFICATION_RETURNED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + double notStartedCount = (double) notStartedPciEoList.size(); + double notStartedPercentage = (notStartedCount / (datas.size())) * 100; + String notStartedPercentageStr = notStartedPercentage != 0 ? df.format(notStartedPercentage) : "0"; + notStartedMap.put("amount",notStartedCount); + notStartedMap.put("percentage",notStartedPercentageStr + percentSign); + + // 待确认 + List toConfirmPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double toConfirmCount = (double) toConfirmPciEoList.size(); + double toConfirmPercentage = (toConfirmCount / (datas.size())) * 100; + String toConfirmPercentageStr = toConfirmPercentage != 0 ? df.format(toConfirmPercentage) : "0"; + toConfirmMap.put("amount",toConfirmCount); + toConfirmMap.put("percentage",toConfirmPercentageStr + percentSign); + + // 审查通过 + List acceptedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double acceptedCount = (double) acceptedPciEoList.size(); + double acceptedPercentage = (acceptedCount / (datas.size())) * 100; + String acceptedPercentageStr = acceptedPercentage != 0 ? df.format(acceptedPercentage) : "0"; + acceptedMap.put("amount",acceptedCount); + acceptedMap.put("percentage",acceptedPercentageStr + percentSign); + + // 审查退回 + List rejectedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(),CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double rejectedCount = (double) rejectedPciEoList.size(); + double rejectedPercentage = (rejectedCount / (datas.size())) * 100; + String rejectedPercentageStr = rejectedPercentage != 0 ? df.format(rejectedPercentage) : "0"; + rejectedMap.put("amount",rejectedCount); + rejectedMap.put("percentage",rejectedPercentageStr + percentSign); + + result.put(TaskAffirmStatusEnum.NOT_STARTED.getValue(),notStartedMap); + result.put(TaskAffirmStatusEnum.LIST_TO_CONFIRM.getValue(),toConfirmMap); + result.put(CertificationInventoryFlowStatusEnum.REVIEW_AND_PASS.getValue(),acceptedMap); + result.put(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue(),rejectedMap); + } + return result; + } + + @Override + public Map getAllCertificationProgressStatisticsGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + Map notStartedMap = new HashMap<>(); + Map inProgressMap = new HashMap<>(); + Map testPassedMap = new HashMap<>(); + Map testFailedMap = new HashMap<>(); + + // 未开始 + List notStartedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(), CertificationProgressEnum.NOT_START.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notStartedCount = (double) notStartedPciEoList.size(); + double notStartedPercentage = (notStartedCount / (datas.size())) * 100; + String notStartedPercentageStr = notStartedPercentage != 0 ? df.format(notStartedPercentage) : "0"; + notStartedMap.put("amount",notStartedCount); + notStartedMap.put("percentage",notStartedPercentageStr + percentSign); + + // 进行中 + List inProgressPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.IN_PROGRESS.getValue()) + || StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double inProgressCount = (double) inProgressPciEoList.size(); + double inProgressPercentage = (inProgressCount / (datas.size())) * 100; + String inProgressPercentageStr = inProgressPercentage != 0 ? df.format(inProgressPercentage) : "0"; + inProgressMap.put("amount",inProgressCount); + inProgressMap.put("percentage",inProgressPercentageStr + percentSign); + + // 实验通过 + List testPassedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue()) + || StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()) + || StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double testPassedCount = (double) testPassedPciEoList.size(); + double testPassedPercentage = (testPassedCount / (datas.size())) * 100; + String testPassedPercentageStr = testPassedPercentage != 0 ? df.format(testPassedPercentage) : "0"; + testPassedMap.put("amount",testPassedCount); + testPassedMap.put("percentage",testPassedPercentageStr + percentSign); + + // 实验失败 + List testFailedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_FAILED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double testFailedCount = (double) testFailedPciEoList.size(); + double testFailedPercentage = (testFailedCount / (datas.size())) * 100; + String testFailedPercentageStr = testFailedPercentage != 0 ? df.format(testFailedPercentage) : "0"; + testFailedMap.put("amount",testFailedCount); + testFailedMap.put("percentage",testFailedPercentageStr + percentSign); + + result.put(CertificationProgressEnum.NOT_START.getValue(),notStartedMap); + result.put(CertificationProgressEnum.IN_PROGRESS.getValue(),inProgressMap); + result.put(CertificationProgressEnum.TEST_PASSED.getValue(),testPassedMap); + result.put(CertificationProgressEnum.TEST_FAILED.getValue(),testFailedMap); + } + return result; + } + + @Override + public Map getCarCertificationProgressStatisticsGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + Map notStartedMap = new HashMap<>(); + Map inProgressMap = new HashMap<>(); + Map testPassedMap = new HashMap<>(); + Map testFailedMap = new HashMap<>(); + + // 未开始 + List notStartedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.NOT_START.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notStartedCount = (double) notStartedPciEoList.size(); + double notStartedPercentage = (notStartedCount / (datas.size())) * 100; + String notStartedPercentageStr = notStartedPercentage != 0 ? df.format(notStartedPercentage) : "0"; + notStartedMap.put("amount",notStartedCount); + notStartedMap.put("percentage",notStartedPercentageStr + percentSign); + + // 进行中 + List inProgressPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.IN_PROGRESS.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double inProgressCount = (double) inProgressPciEoList.size(); + double inProgressPercentage = (inProgressCount / (datas.size())) * 100; + String inProgressPercentageStr = inProgressPercentage != 0 ? df.format(inProgressPercentage) : "0"; + inProgressMap.put("amount",inProgressCount); + inProgressMap.put("percentage",inProgressPercentageStr + percentSign); + + // 实验通过 + List testPassedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double testPassedCount = (double) testPassedPciEoList.size(); + double testPassedPercentage = (testPassedCount / (datas.size())) * 100; + String testPassedPercentageStr = testPassedPercentage != 0 ? df.format(testPassedPercentage) : "0"; + testPassedMap.put("amount",testPassedCount); + testPassedMap.put("percentage",testPassedPercentageStr + percentSign); + + // 实验失败 + List testFailedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_FAILED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double testFailedCount = (double) testFailedPciEoList.size(); + double testFailedPercentage = (testFailedCount / (datas.size())) * 100; + String testFailedPercentageStr = testFailedPercentage != 0 ? df.format(testFailedPercentage) : "0"; + testFailedMap.put("amount",testFailedCount); + testFailedMap.put("percentage",testFailedPercentageStr + percentSign); + + result.put(CertificationProgressEnum.NOT_START.getValue(),notStartedMap); + result.put(CertificationProgressEnum.IN_PROGRESS.getValue(),inProgressMap); + result.put(CertificationProgressEnum.TEST_PASSED.getValue(),testPassedMap); + result.put(CertificationProgressEnum.TEST_FAILED.getValue(),testFailedMap); + } + return result; + } + + @Override + public Map getPartCertificationProgressStatisticsGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + Map notSubmitMap = new HashMap<>(); + Map reportSubmitMap = new HashMap<>(); + Map storedMap = new HashMap<>(); + Map notStartMap = new HashMap<>(); + Map inProgressMap = new HashMap<>(); + Map testPassedMap = new HashMap<>(); + Map testFailedMap = new HashMap<>(); + + // 部件报告未提交 + List notSubmitPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notSubmitCount = (double) notSubmitPciEoList.size(); + double notSubmitPercentage = (notSubmitCount / (datas.size())) * 100; + String notSubmitPercentageStr = notSubmitPercentage != 0 ? df.format(notSubmitPercentage) : "0"; + notSubmitMap.put("amount",notSubmitCount); + notSubmitMap.put("percentage",notSubmitPercentageStr + percentSign); + + // 部件报告已提交 + List reportSubmitPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double reportSubmitCount = (double) reportSubmitPciEoList.size(); + double reportSubmitPercentage = (reportSubmitCount / (datas.size())) * 100; + String reportSubmitPercentageStr = reportSubmitPercentage != 0 ? df.format(reportSubmitPercentage) : "0"; + reportSubmitMap.put("amount",reportSubmitCount); + reportSubmitMap.put("percentage",reportSubmitPercentageStr + percentSign); + + // 部件报告已入库 + List storedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double storedCount = (double) storedPciEoList.size(); + double storedPercentage = (storedCount / (datas.size())) * 100; + String storedPercentageStr = storedPercentage != 0 ? df.format(storedPercentage) : "0"; + storedMap.put("amount",storedCount); + storedMap.put("percentage",storedPercentageStr + percentSign); + + // 未开始 + List notStartPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.NOT_START.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notStartCount = (double) notStartPciEoList.size(); + double notStartPercentage = (notStartCount / (datas.size())) * 100; + String notStartPercentageStr = notStartPercentage != 0 ? df.format(notStartPercentage) : "0"; + notStartMap.put("amount",notStartCount); + notStartMap.put("percentage",notStartPercentageStr + percentSign); + // 进行中 + List inProgressPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.IN_PROGRESS.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double inProgressCount = (double) inProgressPciEoList.size(); + double inProgressPercentage = (inProgressCount / (datas.size())) * 100; + String inProgressPercentageStr = inProgressPercentage != 0 ? df.format(inProgressPercentage) : "0"; + inProgressMap.put("amount",inProgressCount); + inProgressMap.put("percentage",inProgressPercentageStr + percentSign); + // 实验通过 + List testPassedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_PASSED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double testPassedCount = (double) testPassedPciEoList.size(); + double testPassedPercentage = (testPassedCount / (datas.size())) * 100; + String testPassedPercentageStr = testPassedPercentage != 0 ? df.format(testPassedPercentage) : "0"; + testPassedMap.put("amount",testPassedCount); + testPassedMap.put("percentage",testPassedPercentageStr + percentSign); + + // 实验失败 + List testFailedPciEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getCertificationProgress(),CertificationProgressEnum.TEST_FAILED.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double testFailedCount = (double) testFailedPciEoList.size(); + double testFailedPercentage = (testFailedCount / (datas.size())) * 100; + String testFailedPercentageStr = testFailedPercentage != 0 ? df.format(testFailedPercentage) : "0"; + testFailedMap.put("amount",testFailedCount); + testFailedMap.put("percentage",testFailedPercentageStr + percentSign); + + result.put(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue(),notSubmitMap); + result.put(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue(),reportSubmitMap); + result.put(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue(),storedMap); + result.put(CertificationProgressEnum.NOT_START.getValue(),notStartMap); + result.put(CertificationProgressEnum.IN_PROGRESS.getValue(),inProgressMap); + result.put(CertificationProgressEnum.TEST_PASSED.getValue(),testPassedMap); + result.put(CertificationProgressEnum.TEST_FAILED.getValue(),testFailedMap); + } + return result; + } + + @Override + public Map getParameterCollectingStatisticsGroupByTerritory(List datas, Map params) { + Map result = new HashMap<>(); + if(CollectionUtils.isNotEmpty(datas)){ + Map notStartMap = new HashMap<>(); + Map collectingMap = new HashMap<>(); + Map submitMap = new HashMap<>(); + Map syncReporMap = new HashMap<>(); + + List notStartPcmEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getState(), CollectManifestStateEnum.WAIT_COLLECT.getValue()) + || StringUtils.equals(data.getState(), CollectManifestStateEnum.SDT_BACK.getValue()) + || StringUtils.equals(data.getState(), CollectManifestStateEnum.CHANGE.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double notStartCount = (double) notStartPcmEoList.size(); + notStartMap.put("amount",notStartCount); + + List collectingPcmEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getState(), CollectManifestStateEnum.WAIT_FILL.getValue()) + || StringUtils.equals(data.getState(),CollectManifestStateEnum.WAIT_SDT.getValue()) + || StringUtils.equals(data.getState(),CollectManifestStateEnum.DRE_BACK.getValue()) + || StringUtils.equals(data.getState(),CollectManifestStateEnum.CERT_BACK.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double collectingCount = (double) collectingPcmEoList.size(); + collectingMap.put("amount",collectingCount); + + List submitPcmEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getState(), CollectManifestStateEnum.SUBMIT.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double submitCount = (double) submitPcmEoList.size(); + submitMap.put("amount",submitCount); + + List syncReporPcmEoList = datas.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getState(), CollectManifestStateEnum.SYNC_REPORT.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + double syncReporCount = (double) syncReporPcmEoList.size(); + syncReporMap.put("amount",syncReporCount); + + result.put(CollectManifestStatisticsStateEnum.NOT_START.getValue(),notStartMap); + result.put(CollectManifestStatisticsStateEnum.COLLECTING.getValue(),collectingMap); + result.put(CollectManifestStatisticsStateEnum.SUBMIT.getValue(),submitMap); + result.put(CollectManifestStatisticsStateEnum.SYNC_REPORT.getValue(),syncReporMap); + } + return result; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java index 170c0f48e..c8bc99b02 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectStatusBoardServiceImpl.java @@ -1,33 +1,52 @@ package com.jero.modules.project.service.impl; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.utils.IOUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.modules.project.entity.ConditionAssessmentEO; -import com.jero.modules.project.entity.ProjectLawsInventoryEO; -import com.jero.modules.project.entity.ProjectLibraryBase; -import com.jero.modules.project.entity.ProjectTaskInventoryEO; +import com.jero.common.util.DateUtils; +import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO; +import com.jero.modules.cert.collect.entity.ParamsManifestEO; +import com.jero.modules.cert.collect.enums.CollectManifestStatisticsStateEnum; +import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService; +import com.jero.modules.cert.collect.service.IParamsManifestEOService; +import com.jero.modules.project.entity.*; import com.jero.modules.project.enums.*; import com.jero.modules.project.mapper.ProjectUserPermissionMapper; import com.jero.modules.project.service.IConditionAssessmentEOService; +import com.jero.modules.project.service.IProjectCertificationInventoryEOService; +import com.jero.modules.project.service.IProjectLibraryStatisticsService; import com.jero.modules.project.service.IProjectStatusBoardService; import com.jero.modules.project.vo.TimeNodeVO; import com.jero.modules.system.entity.SysDictItem; +import com.jero.modules.system.enums.DicCodeEnum; import com.jero.modules.system.mapper.SysRoleMapper; import com.jero.modules.system.service.IProjectUserBrandService; import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import lombok.SneakyThrows; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; import org.apache.shiro.SecurityUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -39,6 +58,8 @@ import java.util.stream.Collectors; */ @Service public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService { + private static DecimalFormat df = new DecimalFormat("#.00"); + private static String percentSign = "%"; @Autowired private ProjectTaskPlanningServiceImpl projectTaskPlanningService; @Autowired @@ -59,6 +80,14 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService private IProjectUserBrandService projectUserBrandService; @Autowired private ISysUserService sysUserService; + @Autowired + private IProjectCertificationInventoryEOService projectCertificationInventoryEOService; + @Autowired + private IParamsManifestEOService paramsManifestEOService; + @Autowired + private IParamsCollectManifestEOService paramsCollectManifestEOService; + @Autowired + private IProjectLibraryStatisticsService projectLibraryStatisticsService; /** @@ -508,4 +537,601 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService } + @Override + public void exportXls(HttpServletResponse response, HttpServletRequest request,ProjectLibraryBase projectLibraryBase) { + String fileName = ""; + String cut = projectLibraryBase.getCut(); + OutputStream ops = null; + HSSFWorkbook workbook = new HSSFWorkbook(); + List plbEoList = this.projectLibraryBaseService.getList(projectLibraryBase); + List dictItemList = sysDictItemServiceImpl.selectItemsByDictCode("region"); + for (ProjectLibraryBase libraryBase : plbEoList) { + targetMarket(projectLibraryBase, dictItemList, libraryBase); + } + List pliEoList = this.projectLawsInventoryEOService.list(); + List pciEoList = this.projectCertificationInventoryEOService.list(); + List ptpEoList = this.projectTaskPlanningService.list(); + List pmEoList = this.paramsManifestEOService.list(); + List pcmEoList = this.paramsCollectManifestEOService.getList(null); + + this.exportCrossProjectProgress(workbook,projectLibraryBase,plbEoList,pliEoList,pciEoList,pmEoList,pcmEoList,ptpEoList); + this.exportOverviewCrossProjectProgress(workbook,projectLibraryBase,plbEoList,pliEoList,pciEoList,pmEoList,pcmEoList,ptpEoList); + try { + response.setHeader("Content-Disposition", + "attachment; filename=" + fileName); + response.setContentType("application/force-download"); + ops = response.getOutputStream(); + workbook.write(ops); + ops.flush(); + }catch (IOException ex){ + ex.printStackTrace(); + if(CutEnum.CN.getValue().equals(cut)){ + throw new JeroBootException("下载文件失败"); + }else{ + throw new JeroBootException("Failed to download file"); + } + }finally { + IOUtils.closeQuietly(ops); + } + } + + /** + * 导出跨项目进度 + * @param workbook + * @param projectLibraryBase + * @param plbEoList + * @param pliEoList + * @param pciEoList + * @param pmEoList + * @param pcmEoList + * @param ptpEoList + */ + private void exportCrossProjectProgress(HSSFWorkbook workbook, + ProjectLibraryBase projectLibraryBase, + List plbEoList, + List pliEoList, + List pciEoList, + List pmEoList, + List pcmEoList, + List ptpEoList) { + String cut = projectLibraryBase.getCut(); + String sheetName = "项目进度"; + String firstTitle = "项目," + + "法规任务确认," + + "设计符合性确认," + + "验证符合性确认," + + "认证任务确认," + + "Pre-Homo确认," + + "认证进度," + + "参数收集"; + String secondTitle = "待发布,待校核,待确认,接受,拒绝,完成度,责任确认日期," + + "未发起,待提交,待审查,符合,不符合,待追踪,不涉及,任务终止,完成度,设计核查日期," + + "未发起,待提交,待审查,符合,不符合,待追踪,不涉及,任务终止,完成度,验证核查日期," + + "待发布,待校核,待确认,接受,拒绝,完成度,责任确认日期," + + "未发起,待提交,待审查,审查通过,审查退回,完成度,认证开始日期," + + "待开始,进行中,实验通过,实验失败,部件报告未提交,部件报告已提交,部件报告已入库,完成度,认证提交时间," + + "未开始,收集中,已提交,已同步至上报库,完成度,认证提交时间"; + if(com.jero.modules.system.util.StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "Project Progress"; + 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); + + CellRangeAddress region1 = new CellRangeAddress(0, 1, 0, 0); + sheet.addMergedRegion(region1); + CellRangeAddress region6 = new CellRangeAddress(0, 0, 1, 7); + sheet.addMergedRegion(region6); + CellRangeAddress region7 = new CellRangeAddress(0, 0, 8, 17); + sheet.addMergedRegion(region7); + CellRangeAddress region8 = new CellRangeAddress(0, 0, 18, 27); + sheet.addMergedRegion(region8); + CellRangeAddress region9 = new CellRangeAddress(0, 0, 28, 34); + sheet.addMergedRegion(region9); + CellRangeAddress region10 = new CellRangeAddress(0, 0, 35, 41); + sheet.addMergedRegion(region10); + CellRangeAddress region11 = new CellRangeAddress(0, 0, 42, 50); + sheet.addMergedRegion(region11); + CellRangeAddress region12 = new CellRangeAddress(0, 0, 51, 56); + sheet.addMergedRegion(region12); + + String[] firstTitleArr = firstTitle.split(","); + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);//垂直居中 + cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中 + for (int i = 0; i <= 56; i++){ + sheet.setColumnWidth(i, 4000); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 0){ + firstRowCell.setCellValue(firstTitleArr[0]); + }else if(i == 1){ + firstRowCell.setCellValue(firstTitleArr[1]); + }else if(i == 8){ + firstRowCell.setCellValue(firstTitleArr[2]); + }else if(i == 18){ + firstRowCell.setCellValue(firstTitleArr[3]); + }else if(i == 28){ + firstRowCell.setCellValue(firstTitleArr[4]); + }else if(i == 35){ + firstRowCell.setCellValue(firstTitleArr[5]); + }else if(i == 42){ + firstRowCell.setCellValue(firstTitleArr[6]); + }else if(i == 51){ + firstRowCell.setCellValue(firstTitleArr[7]); + } + if(i >= 1){ + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellValue(secondTitleArr[i-1]); + } + } + + this.exportCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList); + } + + /** + * 导出跨项目进度-设置数据 + * @param plbEoList + * @param sheet + * @param pliEoList + * @param pciEoList + * @param pmEoList + * @param pcmEoList + * @param projectLibraryBase + * @param ptpEoList + */ + private void exportCrossProjectProgressSetData(List plbEoList, + HSSFSheet sheet, + List pliEoList, + List pciEoList, + List pmEoList, + List pcmEoList, + ProjectLibraryBase projectLibraryBase, + List ptpEoList) { + int dataIndex = 2; + for (ProjectLibraryBase plbEo : plbEoList) { + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(plbEo.getShowName()); + + List ptpEoListTemp = ptpEoList.stream().filter(ptpEo -> StringUtils.equals(ptpEo.getProjectId(), plbEo.getId())).collect(Collectors.toList()); + String legalTaskConfirmationStr = ""; + String designDeadlineStr = ""; + String verifyDeadlineStr = ""; + String attestationStartTimeStr = ""; + String certificationSubmissionStr = ""; + if(CollectionUtils.isNotEmpty(ptpEoListTemp)){ + Date legalTaskConfirmation = ptpEoListTemp.get(0).getLegalTaskConfirmation(); + if (ObjectUtils.isNotEmpty(legalTaskConfirmation)) { + legalTaskConfirmationStr = DateUtils.formatDate(legalTaskConfirmation); + } + Date designDeadline = ptpEoListTemp.get(0).getDesignDeadline(); + if (ObjectUtils.isNotEmpty(designDeadline)) { + designDeadlineStr = DateUtils.formatDate(designDeadline); + } + Date verifyDeadline = ptpEoListTemp.get(0).getVerifyDeadline(); + if (ObjectUtils.isNotEmpty(verifyDeadline)) { + verifyDeadlineStr = DateUtils.formatDate(verifyDeadline); + } + Date attestationStartTime = ptpEoListTemp.get(0).getAttestationStartTime(); + if (ObjectUtils.isNotEmpty(attestationStartTime)) { + attestationStartTimeStr = DateUtils.formatDate(attestationStartTime); + } + Date certificationSubmission = ptpEoListTemp.get(0).getCertificationSubmission(); + if (ObjectUtils.isNotEmpty(certificationSubmission)) { + certificationSubmissionStr = DateUtils.formatDate(certificationSubmission); + } + } + List pliEos = pliEoList.stream().filter(pliEo -> StringUtils.equals(pliEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList()); + Map fgRwqrMap = this.projectLawsInventoryEOService.groupByFGRwqrStatus(pliEos); + Map fgRwqrProjectScheduleExportMap = (Map) 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); + dataRow.createCell(6).setCellValue(fgrqqrPercentage); + dataRow.createCell(7).setCellValue(legalTaskConfirmationStr); + + Map designMap = this.projectLawsInventoryEOService.groupByDesignStatus(pliEos); + Map designMapProjectScheduleExportMap = (Map) designMap.get("projectScheduleExportMap"); + double designNotStart = (double) designMapProjectScheduleExportMap.get("notStart"); + double designToBeSubmitted = (double) designMapProjectScheduleExportMap.get("toBeSubmitted"); + double designToBeReviewed = (double) designMapProjectScheduleExportMap.get("toBeReviewed"); + 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); + dataRow.createCell(16).setCellValue(designPercentage); + dataRow.createCell(17).setCellValue(designDeadlineStr); + + Map verifyMap = this.projectLawsInventoryEOService.groupByVerifyStatus(pliEos); + Map verifyMapProjectScheduleExportMap = (Map) verifyMap.get("projectScheduleExportMap"); + double verifyNotStart = (double) verifyMapProjectScheduleExportMap.get("notStart"); + double verifyToBeSubmitted = (double) verifyMapProjectScheduleExportMap.get("toBeSubmitted"); + double verifyToBeReviewed = (double) verifyMapProjectScheduleExportMap.get("toBeReviewed"); + double verifyCompliance = (double) verifyMapProjectScheduleExportMap.get("compliance"); + double verifyNonCompliance = (double) verifyMapProjectScheduleExportMap.get("nonCompliance"); + double verifyToBeTracked = (double) verifyMapProjectScheduleExportMap.get("toBeTracked"); + double verifyNotInvolved = (double) verifyMapProjectScheduleExportMap.get("notInvolved"); + double verifyTaskTermination = (double) verifyMapProjectScheduleExportMap.get("taskTermination"); + double verifyCount = (double) verifyMapProjectScheduleExportMap.get("count"); + String verifyPercentage = (String) verifyMapProjectScheduleExportMap.get("percentage"); + dataRow.createCell(18).setCellValue(verifyNotStart); + dataRow.createCell(19).setCellValue(verifyToBeSubmitted); + dataRow.createCell(20).setCellValue(verifyToBeReviewed); + dataRow.createCell(21).setCellValue(verifyCompliance); + dataRow.createCell(22).setCellValue(verifyNonCompliance); + dataRow.createCell(23).setCellValue(verifyToBeTracked); + dataRow.createCell(24).setCellValue(verifyNotInvolved); + dataRow.createCell(25).setCellValue(verifyTaskTermination); + dataRow.createCell(26).setCellValue(verifyPercentage); + dataRow.createCell(27).setCellValue(verifyDeadlineStr); + + List pciEos = pciEoList.stream().filter(pciEo -> StringUtils.equals(pciEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList()); + Map rzRwqrMap = this.projectCertificationInventoryEOService.groupByFGRwqrStatus(pciEos); + Map rzRwqrProjectScheduleExportMap = (Map) rzRwqrMap.get("projectScheduleExportMap"); + double rzRqqrToBeReleased = (double) rzRwqrProjectScheduleExportMap.get("toBeReleased"); + double rzRqqrToBeVerified = (double) rzRwqrProjectScheduleExportMap.get("toBeVerified"); + double rzRqqrToBeConfirmed = (double) rzRwqrProjectScheduleExportMap.get("toBeConfirmed"); + double rzRqqrAccept = (double) rzRwqrProjectScheduleExportMap.get("accept"); + double rzRqqrRefuse = (double) rzRwqrProjectScheduleExportMap.get("refuse"); + String rzRqqrPercentage = (String) rzRwqrProjectScheduleExportMap.get("percentage"); + dataRow.createCell(28).setCellValue(rzRqqrToBeReleased); + dataRow.createCell(29).setCellValue(rzRqqrToBeVerified); + dataRow.createCell(30).setCellValue(rzRqqrToBeConfirmed); + dataRow.createCell(31).setCellValue(rzRqqrAccept); + dataRow.createCell(32).setCellValue(rzRqqrRefuse); + dataRow.createCell(33).setCellValue(rzRqqrPercentage); + dataRow.createCell(34).setCellValue(legalTaskConfirmationStr); + + Map preHomoMap = this.projectCertificationInventoryEOService.groupByPreHomoStatus(pciEos); + Map preHomoProjectScheduleExportMap = (Map) preHomoMap.get("projectScheduleExportMap"); + double preHomoNotStartCount = (double) preHomoProjectScheduleExportMap.get("notStartCount"); + double preHomoToBeSubmittedCount = (double) preHomoProjectScheduleExportMap.get("toBeSubmittedCount"); + double preHomoToBeReviewedCount = (double) preHomoProjectScheduleExportMap.get("toBeReviewedCount"); + double preHomoAccept = (double) preHomoProjectScheduleExportMap.get("accept"); + double preHomoRefuse = (double) preHomoProjectScheduleExportMap.get("refuse"); + String preHomoPercentage = (String) preHomoProjectScheduleExportMap.get("percentage"); + dataRow.createCell(35).setCellValue(preHomoNotStartCount); + dataRow.createCell(36).setCellValue(preHomoToBeSubmittedCount); + dataRow.createCell(37).setCellValue(preHomoToBeReviewedCount); + dataRow.createCell(38).setCellValue(preHomoAccept); + dataRow.createCell(39).setCellValue(preHomoRefuse); + dataRow.createCell(40).setCellValue(preHomoPercentage); + dataRow.createCell(41).setCellValue(attestationStartTimeStr); + + Map certificationProgressMap = this.projectCertificationInventoryEOService.groupByCertificationProgress(pciEos); + Map certificationProgressMapProjectScheduleExportMap = (Map) certificationProgressMap.get("projectScheduleExportMap"); + double certificationProgressNotStartCount = (double) certificationProgressMapProjectScheduleExportMap.get("notStartCount"); + double certificationProgressInProgressCount = (double) certificationProgressMapProjectScheduleExportMap.get("inProgressCount"); + double certificationProgressTestPassedCount = (double) certificationProgressMapProjectScheduleExportMap.get("testPassedCount"); + double certificationProgressTestFailedCount = (double) certificationProgressMapProjectScheduleExportMap.get("testFailedCount"); + double certificationProgressNotSubmitCount = (double) certificationProgressMapProjectScheduleExportMap.get("notSubmitCount"); + double certificationProgressReportSubmitCount = (double) certificationProgressMapProjectScheduleExportMap.get("reportSubmitCount"); + double certificationProgressStoredCount = (double) certificationProgressMapProjectScheduleExportMap.get("storedCount"); + // String certificationProgressCount = (String) certificationProgressMapProjectScheduleExportMap.get("count"); + String certificationProgressPercentage = (String) certificationProgressMapProjectScheduleExportMap.get("percentage"); + dataRow.createCell(42).setCellValue(certificationProgressNotStartCount); + dataRow.createCell(43).setCellValue(certificationProgressInProgressCount); + dataRow.createCell(44).setCellValue(certificationProgressTestPassedCount); + dataRow.createCell(45).setCellValue(certificationProgressTestFailedCount); + dataRow.createCell(46).setCellValue(certificationProgressNotSubmitCount); + dataRow.createCell(47).setCellValue(certificationProgressReportSubmitCount); + dataRow.createCell(48).setCellValue(certificationProgressStoredCount); + dataRow.createCell(49).setCellValue(certificationProgressPercentage); + dataRow.createCell(50).setCellValue(certificationSubmissionStr); + + + List pmEos = pmEoList.stream().filter(pmEo -> { + return StringUtils.equals(pmEo.getProjectId(), plbEo.getId()); + }).collect(Collectors.toList()); + + double notStartAmount = 0; + double collectingAmount = 0; + double submitAmount = 0; + double syncReporAmount = 0; + String parameterCollectingPercentageStr = "0"; + if(CollectionUtils.isNotEmpty(pmEos)){ + List pmEoIdList = pmEos.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList()); + + List pcmEos = pcmEoList.stream().filter(pcmEo -> { + boolean flag = false; + for (String pmEoId : pmEoIdList) { + if (StringUtils.equals(pmEoId, pcmEo.getParamsManifestId())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + Map parameterCollectingMap = this.projectLibraryStatisticsService.getParameterCollectingStatisticsGroupByTerritory(pcmEos,null); + Map notStartMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.NOT_START.getValue()); + notStartAmount = (double) notStartMap.get("amount"); + Map collectingMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.COLLECTING.getValue()); + collectingAmount = (double) collectingMap.get("amount"); + Map submitMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SUBMIT.getValue()); + submitAmount = (double) submitMap.get("amount"); + Map syncReporMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SYNC_REPORT.getValue()); + syncReporAmount = (double) syncReporMap.get("amount"); + + double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount; + double parameterCollectingPercentage = (syncReporAmount / parameterCollectingCount) * 100; + parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? df.format(parameterCollectingPercentage) : "0"; + } + dataRow.createCell(51).setCellValue(notStartAmount); + dataRow.createCell(52).setCellValue(collectingAmount); + dataRow.createCell(53).setCellValue(submitAmount); + dataRow.createCell(54).setCellValue(syncReporAmount); + dataRow.createCell(55).setCellValue(parameterCollectingPercentageStr + percentSign); + dataRow.createCell(56).setCellValue(certificationSubmissionStr); + dataIndex ++; + } + } + + /** + * 导出跨项目进度概览 + * @param workbook + * @param projectLibraryBase + * @param plbEoList + * @param pliEoList + * @param pciEoList + * @param pmEoList + * @param pcmEoList + * @param ptpEoList + */ + private void exportOverviewCrossProjectProgress(HSSFWorkbook workbook, + ProjectLibraryBase projectLibraryBase, + List plbEoList, + List pliEoList, + List pciEoList, + List pmEoList, + List pcmEoList, + List ptpEoList) { + String cut = projectLibraryBase.getCut(); + String sheetName = "项目进度概览"; + String firstTitle = "项目,R&H Studio,法规符合性管理,认证活动管理"; + String secondTitle = ",,法规任务确认,设计符合性,验证符合性,认证任务确认,Pre-Homo确认,认证参数收集,认证进度"; + if(com.jero.modules.system.util.StringUtils.equals(cut,CutEnum.EN.getValue())){ + sheetName = "Overview of project progress"; + firstTitle = "Project,R&H Studio,Regulatory compliance management,Certification Activity Management"; + secondTitle = ",,Confirmation of regulatory tasks," + + "Design compliance," + + "Verify compliance," + + "Certification task confirmation," + + "Pre Homo confirmation," + + "Authentication parameter collection," + + "Certification progress"; + } + HSSFSheet sheet = workbook.createSheet(sheetName); + CellRangeAddress region1 = new CellRangeAddress(0, 1, 0, 0); + sheet.addMergedRegion(region1); + CellRangeAddress region2 = new CellRangeAddress(0, 1, 1, 1); + sheet.addMergedRegion(region2); + CellRangeAddress region3 = new CellRangeAddress(0, 0, 2, 4); + sheet.addMergedRegion(region3); + CellRangeAddress region4 = new CellRangeAddress(0, 0, 5, 8); + sheet.addMergedRegion(region4); + + String[] firstTitleArr = firstTitle.split(","); + String[] secondTitleArr = secondTitle.split(","); + Row firstRow = sheet.createRow(0); + Row secondRow = sheet.createRow(1); + + CellStyle cellStyleTitle = workbook.createCellStyle(); + cellStyleTitle.setAlignment(HorizontalAlignment.CENTER); + cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER); + for (int i = 0; i <= 8; i++){ + sheet.setColumnWidth(i, 4000); + Cell firstRowCell = firstRow.createCell(i); + firstRowCell.setCellStyle(cellStyleTitle); + if(i == 0){ + firstRowCell.setCellValue(firstTitleArr[0]); + }else if(i == 1){ + firstRowCell.setCellValue(firstTitleArr[1]); + }else if(i == 2){ + firstRowCell.setCellValue(firstTitleArr[2]); + }else if(i == 5){ + firstRowCell.setCellValue(firstTitleArr[3]); + } + + if(i >= 2){ + Cell secondRowCell = secondRow.createCell(i); + secondRowCell.setCellStyle(cellStyleTitle); + secondRowCell.setCellValue(secondTitleArr[i]); + } + } + this.exportOverviewCrossProjectProgressSetData(plbEoList, sheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList,cellStyleTitle); + } + + /** + * 导出跨项目进度概览-设置数据 + * @param plbEoList + * @param sheet + * @param pliEoList + * @param pciEoList + * @param pmEoList + * @param pcmEoList + * @param projectLibraryBase + * @param ptpEoList + * @param cellStyleTitle + */ + private void exportOverviewCrossProjectProgressSetData(List plbEoList, + HSSFSheet sheet, + List pliEoList, + List pciEoList, + List pmEoList, + List pcmEoList, + ProjectLibraryBase projectLibraryBase, + List ptpEoList, + CellStyle cellStyleTitle) { + int dataIndex = 2; + for (ProjectLibraryBase plbEo : plbEoList) { + List ptpEoListTemp = ptpEoList.stream().filter(ptpEo -> StringUtils.equals(ptpEo.getProjectId(), plbEo.getId())).collect(Collectors.toList()); + String legalTaskConfirmationStr = ""; + String designDeadlineStr = ""; + String verifyDeadlineStr = ""; + String attestationStartTimeStr = ""; + String certificationSubmissionStr = ""; + if(CollectionUtils.isNotEmpty(ptpEoListTemp)){ + Date legalTaskConfirmation = ptpEoListTemp.get(0).getLegalTaskConfirmation(); + if (ObjectUtils.isNotEmpty(legalTaskConfirmation)) { + legalTaskConfirmationStr = DateUtils.formatDate(legalTaskConfirmation); + } + Date designDeadline = ptpEoListTemp.get(0).getDesignDeadline(); + if (ObjectUtils.isNotEmpty(designDeadline)) { + designDeadlineStr = DateUtils.formatDate(designDeadline); + } + Date verifyDeadline = ptpEoListTemp.get(0).getVerifyDeadline(); + if (ObjectUtils.isNotEmpty(verifyDeadline)) { + verifyDeadlineStr = DateUtils.formatDate(verifyDeadline); + } + Date attestationStartTime = ptpEoListTemp.get(0).getAttestationStartTime(); + if (ObjectUtils.isNotEmpty(attestationStartTime)) { + attestationStartTimeStr = DateUtils.formatDate(attestationStartTime); + } + Date certificationSubmission = ptpEoListTemp.get(0).getCertificationSubmission(); + if (ObjectUtils.isNotEmpty(certificationSubmission)) { + certificationSubmissionStr = DateUtils.formatDate(certificationSubmission); + } + } + + List pliEos = pliEoList.stream().filter(pliEo -> StringUtils.equals(pliEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList()); + Map fgRwqrMap = this.projectLawsInventoryEOService.groupByFGRwqrStatus(pliEos); + Map fgRwqrProjectScheduleExportMap = (Map) fgRwqrMap.get("projectScheduleExportMap"); + String fgrqqrPercentage = (String) fgRwqrProjectScheduleExportMap.get("percentage"); + + Map designMap = this.projectLawsInventoryEOService.groupByDesignStatus(pliEos); + Map designMapProjectScheduleExportMap = (Map) designMap.get("projectScheduleExportMap"); + String designPercentage = (String) designMapProjectScheduleExportMap.get("percentage"); + + Map verifyMap = this.projectLawsInventoryEOService.groupByVerifyStatus(pliEos); + Map verifyMapProjectScheduleExportMap = (Map) verifyMap.get("projectScheduleExportMap"); + String verifyPercentage = (String) verifyMapProjectScheduleExportMap.get("percentage"); + + List pciEos = pciEoList.stream().filter(pciEo -> StringUtils.equals(pciEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList()); + Map rzRwqrMap = this.projectCertificationInventoryEOService.groupByFGRwqrStatus(pciEos); + Map rzRwqrProjectScheduleExportMap = (Map) rzRwqrMap.get("projectScheduleExportMap"); + String rzRqqrPercentage = (String) rzRwqrProjectScheduleExportMap.get("percentage"); + + Map preHomoMap = this.projectCertificationInventoryEOService.groupByPreHomoStatus(pciEos); + Map preHomoProjectScheduleExportMap = (Map) preHomoMap.get("projectScheduleExportMap"); + String preHomoPercentage = (String) preHomoProjectScheduleExportMap.get("percentage"); + + List pmEos = pmEoList.stream().filter(pmEo -> { + return StringUtils.equals(pmEo.getProjectId(), plbEo.getId()); + }).collect(Collectors.toList()); + + String parameterCollectingPercentageStr = "0" + percentSign; + if(CollectionUtils.isNotEmpty(pmEos)){ + List pmEoIdList = pmEos.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList()); + + List pcmEos = pcmEoList.stream().filter(pcmEo -> { + boolean flag = false; + for (String pmEoId : pmEoIdList) { + if (StringUtils.equals(pmEoId, pcmEo.getParamsManifestId())) { + flag = true; + break; + } + } + return flag; + }).collect(Collectors.toList()); + + Map parameterCollectingMap = this.projectLibraryStatisticsService.getParameterCollectingStatisticsGroupByTerritory(pcmEos,null); + Map notStartMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.NOT_START.getValue()); + double notStartAmount = (double) notStartMap.get("amount"); + Map collectingMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.COLLECTING.getValue()); + double collectingAmount = (double) collectingMap.get("amount"); + Map submitMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SUBMIT.getValue()); + double submitAmount = (double) submitMap.get("amount"); + Map syncReporMap = (Map) parameterCollectingMap.get(CollectManifestStatisticsStateEnum.SYNC_REPORT.getValue()); + double syncReporAmount = (double) syncReporMap.get("amount"); + + double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount; + double parameterCollectingPercentage = (syncReporAmount / parameterCollectingCount) * 100; + parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? df.format(parameterCollectingPercentage) + percentSign : "0" + percentSign; + } + + Map certificationProgressMap = this.projectCertificationInventoryEOService.groupByCertificationProgress(pciEos); + Map certificationProgressMapProjectScheduleExportMap = (Map) certificationProgressMap.get("projectScheduleExportMap"); + String certificationProgressPercentage = (String) certificationProgressMapProjectScheduleExportMap.get("percentage"); + + CellRangeAddress regionCell1 = new CellRangeAddress(dataIndex, dataIndex + 1, 0, 0); + sheet.addMergedRegion(regionCell1); + CellRangeAddress regionCell2 = new CellRangeAddress(dataIndex, dataIndex + 1, 1, 1); + sheet.addMergedRegion(regionCell2); + Row dataRow = sheet.createRow(dataIndex); + Row dataRow2 = sheet.createRow(dataIndex + 1); + + for (int i = 0; i < 9; i++) { + sheet.setColumnWidth(i, 4000); + Cell dataRowCell = dataRow.createCell(i); + dataRowCell.setCellStyle(cellStyleTitle); + Cell dataRow2Cell = dataRow2.createCell(i); + dataRow2Cell.setCellStyle(cellStyleTitle); + if(i == 0){ + dataRowCell.setCellValue(plbEo.getShowName()); + }else if(i==1){ + dataRowCell.setCellValue(plbEo.getStudioEngineerName()); + }else if(i==2){ + dataRowCell.setCellValue(legalTaskConfirmationStr); + dataRow2Cell.setCellValue(fgrqqrPercentage); + }else if(i==3){ + dataRowCell.setCellValue(designDeadlineStr); + dataRow2Cell.setCellValue(designPercentage); + }else if(i==4){ + dataRowCell.setCellValue(verifyDeadlineStr); + dataRow2Cell.setCellValue(verifyPercentage); + }else if(i==5){ + dataRowCell.setCellValue(legalTaskConfirmationStr); + dataRow2Cell.setCellValue(rzRqqrPercentage); + }else if(i==6){ + dataRowCell.setCellValue(attestationStartTimeStr); + dataRow2Cell.setCellValue(preHomoPercentage); + }else if(i==7){ + dataRowCell.setCellValue(attestationStartTimeStr); + dataRow2Cell.setCellValue(parameterCollectingPercentageStr); + }else if(i==8){ + dataRowCell.setCellValue(certificationSubmissionStr); + dataRow2Cell.setCellValue(certificationProgressPercentage); + } + } + dataIndex += 2; + } + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskPlanningServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskPlanningServiceImpl.java index 52343e473..478d48fd1 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskPlanningServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskPlanningServiceImpl.java @@ -135,6 +135,7 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl { private Date time; private String status; private String projectId; + private boolean isG; // 是否是G0 - G8 @Override public int compare(TimeNodeVO o1, TimeNodeVO o2) { diff --git a/jero-boot/path带文件导出/军品数据.xls b/jero-boot/path带文件导出/军品数据.xls new file mode 100644 index 000000000..84d215a28 Binary files /dev/null and b/jero-boot/path带文件导出/军品数据.xls differ diff --git a/jero-web/src/assets/heiTop.png b/jero-web/src/assets/heiTop.png new file mode 100644 index 000000000..9f44b0938 Binary files /dev/null and b/jero-web/src/assets/heiTop.png differ diff --git a/jero-web/src/assets/huiBottom.png b/jero-web/src/assets/huiBottom.png new file mode 100644 index 000000000..89a47cc08 Binary files /dev/null and b/jero-web/src/assets/huiBottom.png differ diff --git a/jero-web/src/assets/kongBottom.png b/jero-web/src/assets/kongBottom.png new file mode 100644 index 000000000..105ea2a07 Binary files /dev/null and b/jero-web/src/assets/kongBottom.png differ diff --git a/jero-web/src/assets/kongTop.png b/jero-web/src/assets/kongTop.png new file mode 100644 index 000000000..849789dae Binary files /dev/null and b/jero-web/src/assets/kongTop.png differ diff --git a/jero-web/src/assets/shiBottom.png b/jero-web/src/assets/shiBottom.png new file mode 100644 index 000000000..5ad60ff2b Binary files /dev/null and b/jero-web/src/assets/shiBottom.png differ diff --git a/jero-web/src/assets/shiTop.png b/jero-web/src/assets/shiTop.png new file mode 100644 index 000000000..3645b8c8f Binary files /dev/null and b/jero-web/src/assets/shiTop.png differ diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index f7102a75a..ead0be870 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1802,4 +1802,29 @@ module.exports = { designaconformancedeliverabletype:'Design a conformance deliverable type', reasonForReturnOfCompliance:'Reason for compliance return', have:'Yes', + supplementarySubmission:'Supplementary Submission', + confirmSupplementarySubmission:'Confirm Supplementary Submission ?', + onlyProcessStatusOfApprovedCanBeSelected:'Only data with a process status of approved can be selected', + andTheOperatorCurrentData:' And the operator is the responsible person for the current data', + upgradeInstructions:'Upgrade Instructions', + upgradeOrNot:'Upgrade or not', + operationRecords:'Operation Records', + versionUpdatedRecord:'Version Updated Record', + regulatoryComplianceManagement:'Regulatory Compliance Management', + certificationActivityManagement:'Certification Activity Management', + parameterCollectionProgressManagement:'Parameter Collection Progress Management', + certificationTaskConfirmation:'Certification Task Confirmation', + selectTime:'Select Time', + designCompliance:'Design Compliance', + verifyCompliance:'Verify Compliance', + stateExport:'State Export', + completeVehicle:'Complete Vehicle', + components:'Components', + componentReportNotSubmitted:'Component report not submitted', + componentReportSubmitted:'Component report submitted', + componentReportHasBeenStored:'Component report has been stored', + parameterCollectionProgress:'Parameter Collection Progress', + proportion:'Proportion', + projectProgressStatistics:'Project Progress Statistics', + GRPSystemProjectProgressStatistics:'GRP system project progress statistics', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 1e153a6b3..f6bab58b0 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1903,4 +1903,29 @@ module.exports = { verifytheconformancedeliverabletype:'验证符合性交付物类型', designaconformancedeliverabletype:'设计符合性交付物类型', reasonForReturnOfCompliance: '符合性退回原因', + supplementarySubmission:'补充提交', + confirmSupplementarySubmission:'确认补充提交?', + onlyProcessStatusOfApprovedCanBeSelected:'只能选择流程状态为审查通过的数据', + andTheOperatorCurrentData:',并且登录人为当前数据的责任人', + upgradeInstructions:'升版说明', + upgradeOrNot:'是否升版', + operationRecords:'操作记录', + versionUpdatedRecord:'版本更新记录', + regulatoryComplianceManagement:'法规符合性管理', + certificationActivityManagement:'认证活动管理', + parameterCollectionProgressManagement:'参数收集进度管理', + certificationTaskConfirmation:'认证任务确认', + selectTime:'选择时间', + designCompliance:'设计符合性', + verifyCompliance:'验证符合性', + stateExport:'状态导出', + completeVehicle:'整车', + components:'零部件', + componentReportNotSubmitted:'部件报告未提交', + componentReportSubmitted:'部件报告已提交', + componentReportHasBeenStored:'部件报告已入库', + parameterCollectionProgress:'参数收集进度', + proportion:'占比', + projectProgressStatistics:'项目进度统计', + GRPSystemProjectProgressStatistics:'GRP系统项目进度统计', } \ No newline at end of file diff --git a/jero-web/src/components/UpdateLog/index.vue b/jero-web/src/components/UpdateLog/index.vue index f29fb58b8..6388938fb 100644 --- a/jero-web/src/components/UpdateLog/index.vue +++ b/jero-web/src/components/UpdateLog/index.vue @@ -12,15 +12,21 @@ {{$t('cancel')}} - + + + + + +

+ @@ -126,11 +156,13 @@ text-align: right; margin-top: 20px; } - /deep/.tooltipColor .ant-tooltip-inner { + + /deep/ .tooltipColor .ant-tooltip-inner { color: #333; background-color: #fff !important; } - /deep/.tooltipColor .ant-tooltip-arrow::before { + + /deep/ .tooltipColor .ant-tooltip-arrow::before { background-color: #fff; } \ No newline at end of file diff --git a/jero-web/src/components/UpdateLog/versionUpdatedRecordList.vue b/jero-web/src/components/UpdateLog/versionUpdatedRecordList.vue new file mode 100644 index 000000000..1642c6f6c --- /dev/null +++ b/jero-web/src/components/UpdateLog/versionUpdatedRecordList.vue @@ -0,0 +1,138 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue index 3965a9050..1b8c32b24 100644 --- a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue +++ b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue @@ -323,7 +323,7 @@
- + @@ -434,7 +434,8 @@ exportData: '/dummy/dummyInventoryInfoEO/exportData', exportTemplate: '/dummy/dummyInventoryInfoEO/exportTemplate', getSysCategoryTree: '/sys/category/getSysCategoryTree', - logList: '/dummy/dummyLogEO/page' + logList: '/dummy/dummyLogEO/page', + versionList:'/log/marketListVersionUpdateLogEO/page', }, loading: false, dataSource: [], @@ -1062,7 +1063,8 @@ this.getList() }, UpdateLogClick() { - this.$refs.UpdateLogRef.getList({ dummyInventoryBaseId: this.$route.query.id }) + this.$refs.UpdateLogRef.getList({ dummyInventoryBaseId: this.$route.query.id, }, + {listId:this.$route.query.id,listType:'Market Regulation List'}) }, searchQuery() { this.getList() diff --git a/jero-web/src/views/documentTools/virtualList/index.vue b/jero-web/src/views/documentTools/virtualList/index.vue index e7f3d88f2..007427c79 100644 --- a/jero-web/src/views/documentTools/virtualList/index.vue +++ b/jero-web/src/views/documentTools/virtualList/index.vue @@ -128,6 +128,20 @@ + +
+
+ * + {{$t('VersionNumber')}} +
+ + + +
+
@@ -150,6 +164,7 @@
+ @@ -160,6 +175,7 @@ import VueDraggableResizable from 'vue-draggable-resizable' import tableDragResize from '@/mixins/tableDragResize' import setCreator from '@/components/setCreator/index' + import releaseForm from '../../virtualAuthenticationList/components/releaseForm' import { mapGetters } from 'vuex' import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header' @@ -167,7 +183,8 @@ name: 'index', components: { VueDraggableResizable, - setCreator + setCreator, + releaseForm }, mixins: [tableDragResize, ResizeHeader, ResizeColumnProvide], data() { @@ -189,6 +206,18 @@ trigger: 'blur' } ], + versionNum:[ + { + required: true, + message: this.$t('VersionNumber') + this.$t('cannotEmpty'), + trigger: 'blur' + }, + { + max: 100, + message: this.$t('VersionNumber') + this.$t('cannotExceed') + 100 + this.$t('Characters'), + trigger: 'blur' + } + ], useExplain: [ { required: true, @@ -225,17 +254,24 @@ ellipsis: true, scopedSlots: { customRender: 'VirtualListName' } }, + { + title: this.$t('VersionNumber'), + align: 'left', + width: '10%', + ellipsis: true, + dataIndex: 'versionNum' + }, { title: this.$t('listStatus'), align: 'left', - width: '20%', + width: '15%', ellipsis: true, dataIndex: 'state_dictText' }, { title: this.$t('creater'), align: 'left', - width: '20%', + width: '15%', ellipsis: true, dataIndex: 'createBy' }, @@ -362,17 +398,40 @@ } item.id = val.id let _this = this - this.$confirm({ - content: content, - onOk() { - postAction(_this.url.urlWithdraw, item).then((res) => { - if (res.success) { - _this.$message.success(_this.$t('OperationSuccessful')) - _this.getList() - } else { - _this.$message.warning(res.message) - } - }) + if (item.state == 1){ + this.$refs.releaseFormRef.getData(val.id) + }else{ + this.$confirm({ + content: content, + onOk() { + postAction(_this.url.urlWithdraw, item).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + } else { + _this.$message.warning(res.message) + } + }) + } + }) + } + }, + releaseFormData(id, val) { + let _this = this + let item = { + state: 1, + id: id, + ...val + } + postAction(_this.url.urlWithdraw, item).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + _this.$refs.releaseFormRef.confirmLoading = false + _this.$refs.releaseFormRef.visible = false + } else { + _this.$message.warning(res.message) + _this.$refs.releaseFormRef.confirmLoading = false } }) }, diff --git a/jero-web/src/views/projectManagement/ProjectDetails/index.vue b/jero-web/src/views/projectManagement/ProjectDetails/index.vue index 4f382282d..72e5bb2bd 100644 --- a/jero-web/src/views/projectManagement/ProjectDetails/index.vue +++ b/jero-web/src/views/projectManagement/ProjectDetails/index.vue @@ -103,13 +103,13 @@ {{$t('TaskParameterCollection')}}
-
- - {{$t('projectStatus')}} -
+ + + + + + +
@@ -143,30 +143,31 @@ @click="textClick(4,$t('TaskParameterCollection'))">
-
- -
+ + + + + +
- + - + + - + + @@ -417,7 +418,7 @@ this.textTitle = this.$t('listOfRegulations') } else { this.areaOfResponsibility = item - this.textTitle = this.$t('taskList') + this.textTitle = this.$t('certificationList') } let textColor = document.getElementsByClassName('Virtual-detail-left-text-color') if (textColor && textColor.length > 0) { diff --git a/jero-web/src/views/projectManagement/components/ProjectDetails.vue b/jero-web/src/views/projectManagement/components/ProjectDetails.vue index 7c7970d5b..060322c38 100644 --- a/jero-web/src/views/projectManagement/components/ProjectDetails.vue +++ b/jero-web/src/views/projectManagement/components/ProjectDetails.vue @@ -28,23 +28,8 @@ {{queryForm.projectStatus_dictText}}
- - - - - - - - - -
- - - - -
{{$t('StudioEngineer')}}
{{$t('ListOfRelevantPersonnel')}} - - - {{$t('ListOfRelevantPersonnel')}} - + + + {{$t('ListOfRelevantPersonnel')}} + + + + + + +
@@ -84,18 +74,6 @@ {{queryForm.softwareVersion}}
- - - - - - - - - - - -
@@ -112,13 +90,13 @@ @click="urlClick(queryForm.attestationPlan)" >{{queryForm.attestationPlan}}
-
- {{$t('configurationInformation')}} - {{queryForm.ipdInfo}} -
+
+ {{$t('configurationInformation')}} + {{queryForm.ipdInfo}} +
@@ -127,34 +105,7 @@ >{{queryForm.explanation}}
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
{{$t('complianceCertificationProgram')}}
@@ -167,35 +118,40 @@
- -
-
- - - -
-
{{item.name}}
-
{{item.time?item.time.slice(0,11): item.time}}
-
-
-
-
+ + + + + + + + + + + + +
- - - - - - - - - - - - - - - +
+
+ {{$t('projectStatus')}} +
+
+ {{$t('stateExport')}} + + {{$t('versionStatistics')}} + +
+
+ + @@ -207,30 +163,28 @@ import listOfRelevantPersonnel from './listOfRelevantPersonnel' import { getAction, postAction, downloadFile, putAction } from '@/api/manage' import addModel from './addModel' + import versionStatistics from './versionStatistics' + import complianceCertificationForm from './complianceCertificationForm' import settingList from './settingList' - import currentStatusOfTheProjectEcharts from './currentStatusOfTheProjectEcharts' - import deliverableStatusEchart from './deliverableStatusEchart' - import ParameterCollectionEchart from './ParameterCollectionEchart' - import certificationProgressEchart from './certificationProgressEchart' + import projectStatus from './projectStatus' import { mapGetters } from 'vuex' export default { name: 'ProjectDetails', components: { listOfRelevantPersonnel, - ParameterCollectionEchart, addModel, settingList, - currentStatusOfTheProjectEcharts, - deliverableStatusEchart, - certificationProgressEchart + projectStatus, + versionStatistics, + complianceCertificationForm }, data() { return { queryForm: {}, - cut:'', - administrators:false, - activeKey: this.$t('CurrentStatusOfTheProject'), + cut: '', + administrators: false, + activeKey: this.$t('regulatoryComplianceManagement'), url: { queryById: 'project/projectLibraryBase/queryById', add: 'project/projectLibraryBase/add', @@ -240,13 +194,15 @@ editSettingUrl: 'project/projectTaskPlanning/edit', settingQueryForm: '/project/projectTaskPlanning/list' }, + selectedRowKeys: [], + idList: [], regulatoryCertificationTaskPlanList: [] } }, mounted() { this.getForm() - this.getSetting() this.administrators = false + this.activeKey = this.$t('regulatoryComplianceManagement') if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { this.userInfo().userRoleList.forEach(res => { if (res.roleCode == 'admin') { @@ -262,9 +218,9 @@ if (res.success) { this.cut = res.cut this.queryForm = res.result[0] || {} - if(this.cut == 'en'){ + if (this.cut == 'en') { this.queryForm.brandText = this.queryForm.brandTextEn - }else{ + } else { this.queryForm.brandText = this.queryForm.brandText } } else { @@ -272,20 +228,11 @@ } }) }, - // currentStatus(item) { - // this.$emit('TaskListChange', item) - // }, - getSetting() { - getAction(this.url.queryByProjectId, { projectId: this.$route.query.id }).then((res) => { - if (res.success) { - this.regulatoryCertificationTaskPlanList = res.result || [] - } else { - this.regulatoryCertificationTaskPlanList = [] - } - }) + currentStatus(item) { + this.$emit('TaskListChange', item) }, settingListForm() { - this.getSetting() + this.$refs.complianceCertificationRef.getSetting() }, ListOfRelevantPersonnelClick() { this.$refs.listOfRelevantPersonnelRef.getData() @@ -296,7 +243,6 @@ } }, edit() { - console.log(this.queryForm) this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(this.queryForm))) }, addModelList() { @@ -304,6 +250,24 @@ }, settingClick() { this.$refs.settingListRef.edit() + }, + stateExportClick() { + let query = { + projectLibraryId: this.$route.query.id + } + downloadFile('/project/projectLibraryBase/exportProjectProgressStatisticsXls', + this.queryForm.projectName+'-'+this.queryForm.projectVersion+'-'+this.$t('projectProgressStatistics') + '.xls', query) + }, + + versionStatisticsClick() { + this.$refs.versionStatisticsRef.addModel(JSON.parse(JSON.stringify(this.selectedRowKeys))) + }, + versionStatisticsForm(value) { + this.$refs.projectStatusRef.versionStatisticsForm(value) + this.selectedRowKeys = JSON.parse(JSON.stringify(value)) + }, + projectStatusForm(activeKey) { + this.activeKey = activeKey } } } @@ -319,7 +283,7 @@ .header-text { font-size: 16px; - font-weight: 400; + font-weight: bold; color: #000F16; } @@ -359,7 +323,7 @@ .text-field-content { width: 100%; - margin-bottom: 34px; + /*margin-bottom: 34px;*/ .text-field-left { width: 124px; @@ -463,11 +427,19 @@ .box-text { display: flex; justify-content: space-between; - height: 80px; + height: 72px; line-height: 80px; } + .header-tight { + line-height: 90px; + } + .button-text { padding: 0 13px; } + + .box-button { + margin-left: 12px; + } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/certificationActivity.vue b/jero-web/src/views/projectManagement/components/certificationActivity.vue new file mode 100644 index 000000000..499e9893f --- /dev/null +++ b/jero-web/src/views/projectManagement/components/certificationActivity.vue @@ -0,0 +1,432 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/certificationList/index.vue b/jero-web/src/views/projectManagement/components/certificationList/index.vue index 62cc82161..1d40ff894 100644 --- a/jero-web/src/views/projectManagement/components/certificationList/index.vue +++ b/jero-web/src/views/projectManagement/components/certificationList/index.vue @@ -236,6 +236,14 @@ {{ $t('reviewAndReturn') }} + +
+ + {{ $t('supplementarySubmission') }} +
+
0) { + let ids = [] + let notConditions = [] + let _this = this + for (let i = 0; i < this.selectedRowKeysList.length; i++) { + if (this.selectedRowKeysList[i].flowStatus == 'Review and pass') { + if (this.roleSwitchingCode == 20 && this.selectedRowKeysList[i].dutyPersonName == this.userInfo().username) { + ids.push(this.selectedRowKeysList[i].id) + } else if (this.roleSwitchingCode == 21) { + ids.push(this.selectedRowKeysList[i].id) + } else { + notConditions.push(this.selectedRowKeysList[i].inspectionItem) + } + } else { + notConditions.push(this.selectedRowKeysList[i].inspectionItem) + } + } + let data = '' + if (notConditions && notConditions.length > 0) { + if (this.roleSwitchingCode == 20) { + data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyProcessStatusOfApprovedCanBeSelected') + this.$t('andTheOperatorCurrentData') + } else { + data = this.$t('inspectionItems') + '"' + notConditions.join('、') + '"' + this.$t('conditionsNotMet') + ',' + this.$t('onlyProcessStatusOfApprovedCanBeSelected') + } + } + if (ids && ids.length > 0) { + this.$confirm({ + content: _this.$t('confirmSupplementarySubmission'), + onOk() { + let query = { + ids: ids.join(','), + 'flowStatus': 'Results to be submitted' + } + postAction('/project/projectCertificationInventoryEO/updateStatusBatch', query).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + _this.selectedRowKeys = [] + _this.selectedRowKeysList = [] + if (notConditions && notConditions.length > 0) { + _this.failedMessage(data) + } + } else { + _this.$message.warning(_this.$t('operationFailed')) + } + }) + } + }) + } else { + this.failedMessage(data) + } + } else { + this.$message.warning(this.$t('selectLeastOne')) + } } } } @@ -2493,7 +2561,10 @@ background: #dbf6e2; color: #26BD4B; } - + .componentColor{ + background: #EDFCEF; + color: #6FD682; + } .nonConformityColor { background: #f3dddd; color: #E83030; diff --git a/jero-web/src/views/projectManagement/components/certificationProgressEchart.vue b/jero-web/src/views/projectManagement/components/certificationProgressEchart.vue deleted file mode 100644 index fc704f2a0..000000000 --- a/jero-web/src/views/projectManagement/components/certificationProgressEchart.vue +++ /dev/null @@ -1,248 +0,0 @@ - - - - - \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/complianceCertificationForm.vue b/jero-web/src/views/projectManagement/components/complianceCertificationForm.vue new file mode 100644 index 000000000..2790f90d3 --- /dev/null +++ b/jero-web/src/views/projectManagement/components/complianceCertificationForm.vue @@ -0,0 +1,298 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/currentStatusOfTheProjectEcharts.vue b/jero-web/src/views/projectManagement/components/currentStatusOfTheProjectEcharts.vue deleted file mode 100644 index 924a94325..000000000 --- a/jero-web/src/views/projectManagement/components/currentStatusOfTheProjectEcharts.vue +++ /dev/null @@ -1,249 +0,0 @@ - - - - - \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/deliverableStatusEchart.vue b/jero-web/src/views/projectManagement/components/deliverableStatusEchart.vue deleted file mode 100644 index f0498d93d..000000000 --- a/jero-web/src/views/projectManagement/components/deliverableStatusEchart.vue +++ /dev/null @@ -1,325 +0,0 @@ - - - - - \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/nonConformance.vue b/jero-web/src/views/projectManagement/components/nonConformance.vue index 9ef14c8c7..2dc2e0f90 100644 --- a/jero-web/src/views/projectManagement/components/nonConformance.vue +++ b/jero-web/src/views/projectManagement/components/nonConformance.vue @@ -8,8 +8,8 @@
{{$t('standard')}}
- +
@@ -17,8 +17,8 @@
{{$t('title')}}
- +
@@ -61,8 +61,8 @@ :data-source="dataSource" :columns="columns" > - - + + {{text}} @@ -73,29 +73,34 @@ -
- -
+ + + + + + + + + + + + + diff --git a/jero-web/src/views/projectManagement/components/ParameterCollectionEchart.vue b/jero-web/src/views/projectManagement/components/parameterCollectionProgress.vue similarity index 68% rename from jero-web/src/views/projectManagement/components/ParameterCollectionEchart.vue rename to jero-web/src/views/projectManagement/components/parameterCollectionProgress.vue index 306768776..668bb5a60 100644 --- a/jero-web/src/views/projectManagement/components/ParameterCollectionEchart.vue +++ b/jero-web/src/views/projectManagement/components/parameterCollectionProgress.vue @@ -4,19 +4,29 @@ - - - +
+
+ {{ $t('Collectlist') }} +
+ + {{ d.label }} - +
- - - + +
+
+ {{ $t('Statisticalmodels') }} +
+ {{$t('Thepercentage')}} @@ -24,9 +34,8 @@ {{$t('Quantity')}} - +
-
@@ -44,7 +53,7 @@ import * as echarts from 'echarts' import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage' import responsibilityList from './responsibilityList' - import "echarts/lib/component/dataZoom" + import 'echarts/lib/component/dataZoom' export default { name: 'DeliverableStatusEchart', @@ -59,28 +68,28 @@ }, data() { return { - queryParam:{ - value:1, - ctype:'' + queryParam: { + value: 1, + ctype: '' }, - options:[], - collecting:[], - notStart:[], - submit:[], - syncReport:[], - collectingdata:[], - notStartdata:[], - submitdata:[], - syncReportdata:[], - dutyTerritory:[], - collectingpercentage:[], - collectingquantity:[], - notStartpercentage:[], - notStartquantity:[], - submitpercentage:[], - submitquantity:[], - syncReportpercentage:[], - syncReportquantity:[], + options: [], + collecting: [], + notStart: [], + submit: [], + syncReport: [], + collectingdata: [], + notStartdata: [], + submitdata: [], + syncReportdata: [], + dutyTerritory: [], + collectingpercentage: [], + collectingquantity: [], + notStartpercentage: [], + notStartquantity: [], + submitpercentage: [], + submitquantity: [], + syncReportpercentage: [], + syncReportquantity: [], url: { getProjectDetailsStatistics: '/project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestData' } @@ -97,18 +106,18 @@ if (res.success) { if (res.result) { this.collecting = res.result.collecting ? res.result.collecting : [] - this.notStart = res.result.notStart ? res.result.notStart: [] + this.notStart = res.result.notStart ? res.result.notStart : [] this.submit = res.result.submit ? res.result.submit : [] this.syncReport = res.result.syncReport ? res.result.syncReport : [] this.dutyTerritory = res.result.dutyTerritory ? res.result.dutyTerritory : [] - this.getEcharts() + this.getEcharts() } } }) }, - getoptions(){ + getoptions() { let id = '' if (this.idList && this.idList.length > 0) { id = this.idList.join(',') @@ -116,7 +125,7 @@ id = this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id // id = this.$route.query.id } - getAction('project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestLabel', {id:id}).then((res) => { + getAction('project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestLabel', { id: id }).then((res) => { if (res.success) { this.options = res.result this.queryParam.ctype = this.options[0].value @@ -125,7 +134,7 @@ } }) }, - getonChange(value){ + getonChange(value) { this.collectingpercentage = [] this.collectingquantity = [] this.notStartpercentage = [] @@ -136,7 +145,7 @@ this.syncReportquantity = [] this.getData(value) }, - onChange(value){ + onChange(value) { this.collectingpercentage = [] this.collectingquantity = [] this.notStartpercentage = [] @@ -149,53 +158,53 @@ }, getEcharts(chart, title, color, data, num) { - this.collecting.forEach((item,index) => { + this.collecting.forEach((item, index) => { this.collectingpercentage.push(item.percentage) this.collectingquantity.push(item.quantity) }) - this.notStart.forEach((item,index) => { + this.notStart.forEach((item, index) => { this.notStartpercentage.push(item.percentage) this.notStartquantity.push(item.quantity) }) - this.submit.forEach((item,index) => { + this.submit.forEach((item, index) => { this.submitpercentage.push(item.percentage) this.submitquantity.push(item.quantity) }) - this.syncReport.forEach((item,index) => { + this.syncReport.forEach((item, index) => { this.syncReportpercentage.push(item.percentage) this.syncReportquantity.push(item.quantity) }) - if(this.queryParam.value == 1){ + if (this.queryParam.value == 1) { this.collectingdata = this.collectingpercentage this.notStartdata = this.notStartpercentage this.submitdata = this.submitpercentage this.syncReportdata = this.syncReportpercentage - }else if(this.queryParam.value == 2){ + } else if (this.queryParam.value == 2) { this.collectingdata = this.collectingquantity this.notStartdata = this.notStartquantity this.submitdata = this.submitquantity this.syncReportdata = this.syncReportquantity } - var chartDom = document.getElementById('main-left'); - var myChart = echarts.init(chartDom); - var option; - var option1; + var chartDom = document.getElementById('main-left') + var myChart = echarts.init(chartDom) + var option + var option1 - let xAxisData = []; + let xAxisData = [] // let data1 = []; // let data2 = []; // let data3 = []; // let data4 = []; xAxisData = this.dutyTerritory - // data1.push(+(Math.random() * 2).toFixed(2)); - // data2.push(+(Math.random() * 100).toFixed(2)); - // data3.push(+(Math.random() + 0.3).toFixed(2)); - // data4.push(+Math.random().toFixed(2)); + // data1.push(+(Math.random() * 2).toFixed(2)); + // data2.push(+(Math.random() * 100).toFixed(2)); + // data3.push(+(Math.random() + 0.3).toFixed(2)); + // data4.push(+Math.random().toFixed(2)); - let yAxis=[]; - let tooltip= {}; + let yAxis = [] + let tooltip = {} let _this = this - if(this.queryParam.value === 1){ + if (this.queryParam.value === 1) { yAxis = [ { type: 'value', @@ -203,20 +212,26 @@ show: true, interval: 'auto', formatter: '{value} %' - }, - }, + } + } ] - }else{ - yAxis=[ + } else { + yAxis = [ { - type: 'value', - }, - ]; + type: 'value' + } + ] } option = { + title: { + text: this.$t('parameterCollectionProgress'), + }, legend: { data: [this.$t('Notatthe'), this.$t('Inthecollection'), this.$t('Submitted'), this.$t('SynchronizedLibrary')], - left: '10%' + icon: 'circle', + bottom:'0', + itemWidth: 12, + itemHeight: 12, }, toolbox: { // feature: { @@ -227,21 +242,21 @@ // } }, tooltip: { - trigger:'axis', + trigger: 'axis', // axisPointer: { // 坐标轴指示器,坐标轴触发有效 // type: 'line'// 默认为直线,可选为:'line' | 'shadow' // }, - formatter: function (params) { - var html = params[0].name + "
"; + formatter: function(params) { + var html = params[0].name + '
' for (var i = 0; i < params.length; i++) { - html += params[i].marker + params[i].seriesName + ":" + params[i].value; + html += params[i].marker + params[i].seriesName + ':' + params[i].value if (_this.queryParam.value == 1) { - html += "%" + "
"; - }else{ - html +="
"; + html += '%' + '
' + } else { + html += '
' } } - return html; + return html } }, @@ -250,19 +265,20 @@ // name: 'X Axis', axisLabel: { interval: 0, - rotate:25, + rotate: 25 // formatter: function(value) { // return value.split("").join("\n"); // } - }, + } // axisLine: { onZero: true }, // splitLine: { show: false }, // splitArea: { show: false } }, yAxis: yAxis, grid: { - left: '10%', - bottom: '20%' + bottom: '20%', + left:50, + right:10, }, series: [ { @@ -272,7 +288,7 @@ barWidth: 40, barGap: '-100%', itemStyle: { - color: "#707486", + color: '#00B3BE' }, data: this.notStartdata }, @@ -283,7 +299,7 @@ barWidth: 40, barGap: '-100%', itemStyle: { - color: "#00B3BE", + color: '#FDA71C' }, data: this.collectingdata }, @@ -294,7 +310,7 @@ barWidth: 40, barGap: '-100%', itemStyle: { - color: "#26BD4B", + color: '#26BD4B' }, data: this.submitdata }, @@ -305,31 +321,29 @@ barWidth: 40, barGap: '-100%', itemStyle: { - color: "#E83030", + color: '#2F8DF3' }, data: this.syncReportdata } ], - dataZoom:[ - + dataZoom: [ { type: 'slider',//给x轴设置滚动条 show: true, //flase直接隐藏图形 xAxisIndex: [0], - bottom: 0, + bottom: 46, height: 20, showDetail: false, startValue: 0,//滚动条的起始位置 endValue: 9 //滚动条的截止位置(按比例分割你的柱状图x轴长度) } - - ], - }; - option && myChart.setOption(option, true); + ] + } + option && myChart.setOption(option, true) }, mainLeftEcharts(data, color) { - this.getEcharts('main-left', this.$t('Parametercollection'), color, data, 1) + this.getEcharts('main-left', this.$t('Parametercollection'), color, data, 1) }, responsibility(item) { this.$emit('currentStatus', item) @@ -347,13 +361,14 @@ .box-content-left { width: calc(100% - 12px); - height: 600px; + height: 626px; border: 2px #eff1f3 solid; + border-radius: 6px; #main-left { width: 100%; height: 100%; - padding: 24px; + padding: 24px 20px; box-sizing: border-box; } @@ -371,6 +386,7 @@ box-sizing: border-box; } } + .box-input { display: inline-block; width: calc(70% - 100px); @@ -398,4 +414,32 @@ } } } + + .box-title-text { + line-height: 1.4; + display: flex; + align-items: center; + margin-bottom: 16px; + } + + .title-text { + color: #000F16; + display: inline-block; + font-weight: 500; + font-size: 14px; + margin-right: 16px; + margin-top: 3px; + text-align: left; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .box-input { + display: inline-block; + width: calc(100% - 126px); + height: 38px; + margin-top: 2px; + line-height: 38px; + } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/projectStatus.vue b/jero-web/src/views/projectManagement/components/projectStatus.vue index b76f998bc..71866f40a 100644 --- a/jero-web/src/views/projectManagement/components/projectStatus.vue +++ b/jero-web/src/views/projectManagement/components/projectStatus.vue @@ -1,64 +1,63 @@ + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/responsibilityList.vue b/jero-web/src/views/projectManagement/components/responsibilityList.vue index 5f57dedd5..16298c695 100644 --- a/jero-web/src/views/projectManagement/components/responsibilityList.vue +++ b/jero-web/src/views/projectManagement/components/responsibilityList.vue @@ -1,37 +1,38 @@ diff --git a/jero-web/src/views/projectManagement/components/settingList.vue b/jero-web/src/views/projectManagement/components/settingList.vue index e06252266..a247439c7 100644 --- a/jero-web/src/views/projectManagement/components/settingList.vue +++ b/jero-web/src/views/projectManagement/components/settingList.vue @@ -1,172 +1,322 @@ \ No newline at end of file diff --git a/jero-web/src/views/virtualAuthenticationList/components/releaseForm.vue b/jero-web/src/views/virtualAuthenticationList/components/releaseForm.vue new file mode 100644 index 000000000..c2685d197 --- /dev/null +++ b/jero-web/src/views/virtualAuthenticationList/components/releaseForm.vue @@ -0,0 +1,201 @@ + + + + + \ No newline at end of file diff --git a/jero-web/src/views/virtualAuthenticationList/index.vue b/jero-web/src/views/virtualAuthenticationList/index.vue index b837edcc1..9ec008852 100644 --- a/jero-web/src/views/virtualAuthenticationList/index.vue +++ b/jero-web/src/views/virtualAuthenticationList/index.vue @@ -42,7 +42,7 @@ {{$t('BatchDelete')}} - +
+ +
+
+ * + {{$t('VersionNumber')}} +
+ + + +
+
@@ -144,11 +158,13 @@ {{$t('submit')}}
+