Merge remote-tracking branch 'origin/dev_2nd_LCYH' into dev_2nd_LCYH

This commit is contained in:
wangzhijiang
2023-03-29 21:02:38 +08:00
28 changed files with 639 additions and 778 deletions
@@ -153,4 +153,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
List<SysUser> getPPEmployeeList(@Param("thirdType") String thirdType);
void updateByIdPP (SysUser sysUser);
List<SysUser> getListUserName();
}
@@ -222,4 +222,8 @@
id = #{id}
</update>
<select id="getListUserName" resultType="com.jero.modules.system.entity.SysUser">
select * from sys_user
</select>
</mapper>
@@ -86,6 +86,12 @@ public class OtaBaCxListController extends JeroController<OtaBaCxList, IOtaBaCxL
cpmc = cpmc.replace("%", "\\%");
queryWrapper.like(OtaBaCxList::getCpmc, cpmc);
}
String cpxh = req.getParameter("cpmc");
if (StringUtils.isNotBlank(cpxh)) {
cpxh = cpxh.replace("%", "\\%");
queryWrapper.like(OtaBaCxList::getCpxh, cpxh);
}
queryWrapper.orderByDesc(OtaBaCxList::getCreateTime);
IPage<OtaBaCxList> pageList = otaBaCxListService.page(page, queryWrapper);
return Result.OK(pageList);
@@ -1,6 +1,7 @@
package com.jero.modules.ota.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -8,11 +9,13 @@ import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.ota.entity.OtaBaCxList;
import com.jero.modules.ota.entity.OtaBaSjList;
import com.jero.modules.ota.service.IOtaBaSjListService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -55,9 +58,37 @@ public class OtaBaSjListController extends JeroController<OtaBaSjList, IOtaBaSjL
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<OtaBaSjList> queryWrapper = QueryGenerator.initQueryWrapper(otaBaSjList, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<OtaBaSjList> page = new Page<OtaBaSjList>(pageNo, pageSize);
LambdaQueryWrapper<OtaBaSjList> queryWrapper = new LambdaQueryWrapper<>();
String cpdjbh = req.getParameter("cpdjbh");
if (StringUtils.isNotBlank(cpdjbh)) {
cpdjbh = cpdjbh.replace("%", "\\%");
queryWrapper.like(OtaBaSjList::getCpdjbh, cpdjbh);
}
String ggpc = req.getParameter("ggpc");
if (StringUtils.isNotBlank(ggpc)) {
ggpc = ggpc.replace("%", "\\%");
queryWrapper.like(OtaBaSjList::getGgpc, ggpc);
}
String cpsb = req.getParameter("cpsb");
if (StringUtils.isNotBlank(cpsb)) {
cpsb = cpsb.replace("%", "\\%");
queryWrapper.like(OtaBaSjList::getCpsb, cpsb);
}
String cpmc = req.getParameter("cpmc");
if (StringUtils.isNotBlank(cpmc)) {
cpmc = cpmc.replace("%", "\\%");
queryWrapper.like(OtaBaSjList::getCpmc, cpmc);
}
String cpxh = req.getParameter("cpmc");
if (StringUtils.isNotBlank(cpxh)) {
cpxh = cpxh.replace("%", "\\%");
queryWrapper.like(OtaBaSjList::getCpxh, cpxh);
}
IPage<OtaBaSjList> pageList = otaBaSjListService.page(page, queryWrapper);
return Result.OK(pageList);
}
@@ -3,6 +3,7 @@ package com.jero.modules.ota.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
@@ -99,6 +100,6 @@ public class OtaBaCxAqcs implements Serializable {
private java.lang.String zmcl;
@TableField(exist = false)
private List<AttachmentEO> zmclList;
private List<AttachmentEO> zmclList = new ArrayList<>();
}
@@ -3,6 +3,7 @@ package com.jero.modules.ota.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
@@ -125,6 +126,6 @@ public class OtaBaCxZxsjyq implements Serializable {
private java.lang.String zmcl;
@TableField(exist = false)
private List<AttachmentEO> zmclList;
private List<AttachmentEO> zmclList = new ArrayList<>();
}
@@ -22,45 +22,44 @@ public enum OtaTitleEnum {
TXZD("txzd", "通信终端", "communication_terminal"),
CDOTASJ("cdotasj", "车端OTA升级管理系统", "0"),
BHSJB("bhsjb", "保护升级包", "2"),
BHCLBB("bhclbb", "保护车辆版本", "2"),
CLGXNL("clgxnl", "车辆更新能力", "2"),
CLSJTJ("clsjtj", "车辆升级条件", "2"),
CLSJDL("clsjdl", "车辆升级所需电量", "2"),
SJBHAQ("sjbhaq", "升级保护车辆安全", "2"),
SJANTJ("sjantj", "升级所满足的安全条件", "2"),
SJSBAQ("sjsbaq", "升级失败安全状态", "2"),
SJGG("sjgg", "升级公告", "2"),
SJZT("sjzt", "升级结果状态", "2"),
ZMCL("zmcl", "证明材料", "0"),
BHSJB("bhsjb", "激光雷达-应保护升级包的真实性和完整性,以合理地防止其受到损害,并合理地防止无效升级\t", "2"),
BHCLBB("bhclbb", "激光雷达-应保护车辆上的软件版本(集),防止未经授权的修改", "2"),
CLGXNL("clgxnl", "升级功能要求-车辆应具备更新软件版本(集)的能力,应通过使用电子通信接口,至少用过标准接口(如OBD端口),以标准化的方式易于读取", "2"),
CLSJTJ("clsjtj", "升级功能要求-应确保车辆在执行软件升级之前满足先决条件", "2"),
CLSJDL("clsjdl", "升级功能要求-应确保只有当车辆有充足电量完成升级过程时,才能执行软件升级(包括可能恢复到以前版本或使车辆进入安全状态所需的电量)", "2"),
SJBHAQ("sjbhaq", "升级功能要求-当执行升级可能影响车辆安全时,应在升级执行过程中通过技术手段确保车辆安全", "2"),
SJANTJ("sjantj", "升级功能要求-若升级的执行影响驾驶安全,至少应满足: (a)确保升级执行期间无法驾驶车辆; (b)确保驾驶员不能使用任何可能影响车辆安全或成功执行升级的车辆功能", "2"),
SJSBAQ("sjsbaq", "升级功能要求-车辆能够恢复到以前的可用版本,或确保车辆处于安全状态。", "2"),
SJGG("sjgg", "用户告知要求-在升级执行前,应告知车辆用户升级信息,告知的信息应包括: (a)升级目的; (b)车辆功能升级所实施的任何变更; (c)完成升级执行的预计时间; (d)升级执行期间可能不可用的任何车辆功能; (e)可能帮助车辆用户安全执行升级的任何指导信息。", "2"),
SJZT("sjzt", "用户告知要求-在执行升级后,车辆应: (a)告知车辆用户车辆升级的结果(成功或失败); (b)若升级成功,告知车辆用户已实施的变更,用户手册(如果适用)的任何相关更新。", "2"),
BHJZ("bhjz", "保护机制", "protection_mechanism"),
FSXJZ("fsxjz", "防失效机制", "fail_safe_mechanism"),
SJSBCS("sjsbcs", "升级失败措施", "upgrade_failure"),
BHJZ("bhjz", "真实性、完整性保护机制", "protection_mechanism"),
FSXJZ("fsxjz", "防失效保护机制", "fail_safe_mechanism"),
SJSBCS("sjsbcs", "升级失败后车辆安全措施", "upgrade_failure"),
XXAQJZ("xxaqjz", "信息安全机制", "Information_security_mechanism"),
XTLB("xtlb", "系统类别", "0"),
SFKSJ("sfksj", "是否可升级", "2"),
SJBGCS("sjbgcs", "升级变更技术参数", "0"),
TPT("tpt", "系统电子控制器架构拓扑图", "0"),
SJBGCS("sjbgcs", "升级可能变更的《公告》技术参数", "0"),
//TPT("tpt", "系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", "0"),
KZQMC("kzqmc", "电子控制器名称", "0"),
AQWZXDJ("aqwzxdj", "安全完整性等级", "0"),
AQWZXDJ("aqwzxdj", "电子控制器汽车安全完整性等级(ASIL)", "0"),
KZQSCQY("kzqscqy", "电子控制器生产企业", "0"),
KZQXH("kzqxh", "电子控制器型号", "0"),
YJBBXX("yjbbxx", "硬件版本信息", "0"),
CSRJBBH("csrjbbh", "初始软件版本号", "0"),
CSRJBWZSJ("csrjbwzsj", "初始软件包完整数据", "0"),
SJSFYX("sjsfyx", "升级是否影响整车安全、节能、环保、防盗等", "0"),
CSRJBWZSJ("csrjbwzsj", "初始软件包的完整性验证数据", "0"),
SJSFYX("sjsfyx", "升级是否影响整车安全、节能、环保、防盗等性能", "0"),
CZXTLX("czxtlx", "操作系统类型", "0"),
CZXTSCQY("czxtscqy", "操作系统生产企业", "0"),
CZXTBBH("czxtbbh", "操作系统版本号", "0"),
CZXTBBH("czxtbbh", "软件版本号", "0"),
GNMC("gnmc", "功能名称", "0"),
PZQK("pzqk", "配置情况", "2"),
JSZDHJB("jszdhjb", "驾驶自动化级别", "driving_automation_level"),
SJGGCS("sjggcs", "升级可能变更的《公告》技术参数", "0"),
GNMS("gnms", "功能描述", "0"),
SYTJ("sytj", "适用条件", "0"),
SYTJ("sytj", "适用条件(边界条件)", "0"),
RJKFQY("rjkfqy", "软件开发企业", "0"),
CSYZSJ("csyzsj", "初始软件包的完整性验证数据", "0"),
FJ("fj", "附件", "0"),
@@ -121,19 +120,19 @@ public enum OtaTitleEnum {
CZTX_BBH("cztxBbh", "车载通信系统-版本号", "0"),
CZTX_KFQY("cztxKfqy", "车载通信系统-软件开发企业", "0"),
JSFZCZJ_PZ("jsfzczjPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-配置", "2"),
JSFZCZJ_MC("jsfzczjMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-名称", "0"),
JSFZCZJ_MC("jsfzczjMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-操纵件名称", "0"),
JSFZCZJ_YJXH("jsfzczjYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-硬件规格型号", "0"),
JSFZCZJ_SCQY("jsfzczjScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能操纵件-生产企业", "0"),
JSFZZSQ_PZ("jsfzzsqPz", "驾驶辅助系统操纵件、指示器及信号装置- 驾驶辅助功能指示器/信号装置-配置", "2"),
JSFZZSQ_MC("jsfzzsqMc", "驾驶辅助系统操纵件、指示器及信号装置- 驾驶辅助功能指示器/信号装置-名称", "0"),
JSFZZSQ_YJXH("jsfzzsqYjxh", "驾驶辅助系统操纵件、指示器及信号装置- 驾驶辅助功能指示器/信号装置-硬件规格型号", "0"),
JSFZZSQ_SCQY("jsfzzsqScqy", "驾驶辅助系统操纵件、指示器及信号装置- 驾驶辅助功能指示器/信号装置-生产企业", "0"),
JSFZZSQ_PZ("jsfzzsqPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-配置", "2"),
JSFZZSQ_MC("jsfzzsqMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-指示器/信号装置名称", "0"),
JSFZZSQ_YJXH("jsfzzsqYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-硬件规格型号", "0"),
JSFZZSQ_SCQY("jsfzzsqScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶辅助功能指示器/信号装置-生产企业", "0"),
FXPTSTS_PZ("fxptstsPz", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-配置", "2"),
FXPTSTS_MC("fxptstsMc", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-名称", "0"),
FXPTSTS_MC("fxptstsMc", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-指示器/信号装置名称", "0"),
FXPTSTS_YJXH("fxptstsYjxh", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-硬件规格型号", "0"),
FXPTSTS_SCQY("fxptstsScqy", "驾驶辅助系统操纵件、指示器及信号装置-方向盘脱手提示器/信号装置-生产企业", "0"),
JSYZYLTS_PZ("jsyzyltsPz", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-配置", "2"),
JSYZYLTS_MC("jsyzyltsMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-名称", "0"),
JSYZYLTS_MC("jsyzyltsMc", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-指示器/信号装置名称", "0"),
JSYZYLTS_YJXH("jsyzyltsYjxh", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-硬件规格型号", "0"),
JSYZYLTS_SCQY("jsyzyltsScqy", "驾驶辅助系统操纵件、指示器及信号装置-驾驶员注意力提醒指示器/信号装置-生产企业", "0"),
DSSAD_PZ("dssadPz", "自动驾驶数据记录系统(DSSAD)-系统配置", "2"),
@@ -170,8 +169,8 @@ public enum OtaTitleEnum {
YHQR("yhqr", "升级活动是否提供用户确认选项", "0"),
SJBCS("sjbcs", "升级包测试", "package_test"),
AQKKX("aqkkx", "是杏已验证确认在线升级活动的安全性和可靠性", "0"),
BGFJ("bgfj", "提供变更或扩展后的《公告》批次及证明材料", "0"),
CLFJ("clfj", "提供证明材料", "0"),
// BGFJ("bgfj", "提供变更或扩展后的《公告》批次及证明材料", "0"),
// CLFJ("clfj", "提供证明材料", "0"),
XTMC("xtmc", "系统名称", "0"),
SJQBGCS("sjqbgcs", "升级前已变更《公告》参数的对应调整", "0"),
SJHBGCS("sjhbgcs", "升级后已变更《公告》参数的对应调整", "0"),
@@ -198,7 +197,7 @@ public enum OtaTitleEnum {
GZBG("gzbg", "告知实施的变更", "0"),
GZSCNR("gzscnr", "告知了对用户手册的全部更新内容", "0"),
GZYHFS("gzyhfs", "告知用户方式(可多选)", "0"),
XGWJ("xgwj", "用户告知相关文件", "0"),
// XGWJ("xgwj", "用户告知相关文件", "0"),
RWMC("rwmc", "任务名称", "0"),
SJFBSJ("sjfbsj", "升级发布时间", "0"),
SJJZSJ("sjjzsj", "升级计划截止时间", "0");
@@ -28,6 +28,8 @@ import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Date;
import java.util.Map;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.web.multipart.MultipartFile;
@@ -76,6 +78,7 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
otaBaCxAqcs.setCreateTime(now);
}
otaBaCxAqcs.setUpdateTime(now);
otaBaCxAqcs.setZmcl("");
if (null != otaBaCxAqcs.getZmclList() && otaBaCxAqcs.getZmclList().size() > 0) {
JSONArray obj = new JSONArray();
for (AttachmentEO aeo : otaBaCxAqcs.getZmclList()) {
@@ -83,12 +86,29 @@ public class OtaBaCxAqcsServiceImpl extends ServiceImpl<OtaBaCxAqcsMapper, OtaBa
}
otaBaCxAqcs.setZmcl(obj.toString());
}
if (ObjectUtils.isNotEmpty(otaBaCxAqcsOld) && StringUtils.isNotEmpty(otaBaCxAqcsOld.getZmcl())) {
List<AttachmentEO> aeoList = JSONArray.parseArray(otaBaCxAqcsOld.getZmcl(), AttachmentEO.class);
otaBaCxAqcsOld.setZmclList(aeoList);
}
saveOrUpdate(otaBaCxAqcs);
ComparisonUtil cu = new ComparisonUtil();
if (ObjectUtils.isEmpty(otaBaCxAqcsOld)) {
otaBaCxAqcsOld = new OtaBaCxAqcs();
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxAqcs.getOtaId(), OtaModuleEnum.CX_AQCS, otaBaCxAqcsOld, otaBaCxAqcs, sysDictService);
Map<String, String> newAttMap = otaBaCxAqcs.getZmclList().stream().collect(Collectors.toMap(AttachmentEO::getId, AttachmentEO::getFileName));
Map<String, String> oldAttMap = otaBaCxAqcsOld.getZmclList().stream().collect(Collectors.toMap(AttachmentEO::getId, AttachmentEO::getFileName));
for (String nId : newAttMap.keySet()) {
if (!oldAttMap.containsKey(nId)) {
reList.add(cu.addAttRecord(otaBaCxAqcs.getOtaId(), OtaModuleEnum.CX_AQCS, "证明材料", newAttMap.get(nId)));
}
}
for (String oId : oldAttMap.keySet()) {
if (!newAttMap.containsKey(oId)) {
reList.add(cu.delAttRecord(otaBaCxAqcs.getOtaId(), OtaModuleEnum.CX_AQCS, "证明材料", oldAttMap.get(oId)));
}
}
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -18,7 +18,7 @@ import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.utils.ComparisonUtil;
import com.jero.modules.ota.utils.ImportFileUtil;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
@@ -111,15 +111,13 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KZXSJDJSFZGNMCYCS, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
saveOrUpdateBatch(newList);
otaBaCxTxjlService.saveBatch(reList);
String fj = (String) json.get("fj");
if (StringUtils.isNotEmpty(fj)) {
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
otaBaCxList.setZxsjjsfj(fj);
otaBaCxListService.editById(otaBaCxList);
}
}
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
String oldFjStr = otaBaCxList.getZxsjjsfj();
otaBaCxList.setZxsjjsfj(fj);
otaBaCxListService.editById(otaBaCxList);
reList.addAll(cu.comparisonRecord(otaId, fj, oldFjStr, OtaModuleEnum.CX_KZXSJDJSFZGNMCYCS, "附件", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -195,7 +193,7 @@ public class OtaBaCxKsjjsmccsServiceImpl extends ServiceImpl<OtaBaCxKsjjsmccsMap
}
private List<OtaBaCxKsjjsmccs> getByOtaId(String otaId) {
if(org.apache.commons.lang3.StringUtils.isEmpty(otaId)){
if (StringUtils.isEmpty(otaId)) {
return null;
}
LambdaQueryWrapper<OtaBaCxKsjjsmccs> queryWrapper = new LambdaQueryWrapper<>();
@@ -18,7 +18,7 @@ import com.jero.modules.ota.service.IOtaBaCxTxjlService;
import com.jero.modules.ota.utils.ComparisonUtil;
import com.jero.modules.ota.utils.ImportFileUtil;
import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
@@ -32,6 +32,8 @@ import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.web.multipart.MultipartFile;
@@ -107,18 +109,84 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, OtaTitleEnum.XTLB.getName(), oldList, newList, sysDictService);
saveOrUpdateBatch(newList);
otaBaCxTxjlService.saveBatch(reList);
String fj = (String) json.get("fj");
if (StringUtils.isNotEmpty(fj)) {
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaCxList)) {
otaBaCxList.setZxsjxtfj(fj);
otaBaCxListService.editById(otaBaCxList);
Map<String, OtaBaCxKsjxtmccs> newMap = newList.stream().collect(Collectors.toMap(OtaBaCxKsjxtmccs::getId, Function.identity()));
Map<String, OtaBaCxKsjxtmccs> oldMap = oldList.stream().collect(Collectors.toMap(OtaBaCxKsjxtmccs::getId, Function.identity()));
for (String nId : newMap.keySet()) {
if (oldMap.containsKey(nId)) {
String newTptStr = newMap.get(nId).getTpt();
if (StringUtils.isNotEmpty(newTptStr)) {
String[] newTpts = newTptStr.split(",");
String oldTptStr = oldMap.get(nId).getTpt();
for (String nt : newTpts) {
if (StringUtils.isEmpty(oldTptStr) || !oldTptStr.contains(nt)) {
List<OSSFile> fileList = ossFileService.getFileInfos(nt);
if (ObjectUtils.isNotEmpty(fileList)) {
for (OSSFile f : fileList) {
reList.add(cu.addAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, newMap.get(nId).getXtlb() + "-系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", f.getFileName()));
}
}
}
}
}
}
}
for (String oId : oldMap.keySet()) {
if (newMap.containsKey(oId)) {
String oldTptStr = oldMap.get(oId).getTpt();
if (StringUtils.isNotEmpty(oldTptStr)) {
String[] oldTpts = oldTptStr.split(",");
String newTptStr = newMap.get(oId).getTpt();
for (String ot : oldTpts) {
if (StringUtils.isEmpty(newTptStr) || !newTptStr.contains(ot)) {
List<OSSFile> fileList = ossFileService.getFileInfos(ot);
if (ObjectUtils.isNotEmpty(fileList)) {
for (OSSFile f : fileList) {
reList.add(cu.delAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, oldMap.get(oId).getXtlb() + "-系统-电子控制器架构拓扑图(附件需含拓扑图介绍)", f.getFileName()));
}
}
}
}
}
}
}
String fj = (String) json.get("fj");
OtaBaCxList otaBaCxList = otaBaCxListService.queryById(otaId);
String oldFjStr = otaBaCxList.getZxsjxtfj();
otaBaCxList.setZxsjxtfj(fj);
otaBaCxListService.editById(otaBaCxList);
String[] newFjList = {};
if (StringUtils.isNotEmpty(fj)) {
newFjList = fj.split(",");
}
for (String nf : newFjList) {
if (StringUtils.isEmpty(oldFjStr) || !oldFjStr.contains(nf)) {
List<OSSFile> fileList = ossFileService.getFileInfos(nf);
if (ObjectUtils.isNotEmpty(fileList)) {
for (OSSFile f : fileList) {
reList.add(cu.addAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, "附件", f.getFileName()));
}
}
}
}
String[] oldFjList = {};
if (StringUtils.isNotEmpty(oldFjStr)) {
oldFjList = oldFjStr.split(",");
}
for (String of : oldFjList) {
if (StringUtils.isEmpty(fj) || !fj.contains(of)) {
List<OSSFile> fileList = ossFileService.getFileInfos(of);
if (ObjectUtils.isNotEmpty(fileList)) {
for (OSSFile f : fileList) {
reList.add(cu.delAttRecord(otaId, OtaModuleEnum.CX_KSJDXTMCYCS, "附件", f.getFileName()));
}
}
}
}
otaBaCxTxjlService.saveBatch(reList);
}
}
/**
@@ -193,7 +261,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
}
private List<OtaBaCxKsjxtmccs> getByOtaId(String otaId) {
if(org.apache.commons.lang3.StringUtils.isEmpty(otaId)){
if (org.apache.commons.lang3.StringUtils.isEmpty(otaId)) {
return null;
}
LambdaQueryWrapper<OtaBaCxKsjxtmccs> queryWrapper = new LambdaQueryWrapper<>();
@@ -371,7 +439,7 @@ public class OtaBaCxKsjxtmccsServiceImpl extends ServiceImpl<OtaBaCxKsjxtmccsMap
startRow++;
}
Row row = s.getRow(startRow);
if(null == row){
if (null == row) {
row = s.createRow(startRow);
}
Cell cell = row.createCell(0);
@@ -17,8 +17,6 @@ import com.jero.modules.ota.service.IOtaBaCxZxsjyqService;
import com.jero.modules.ota.utils.ComparisonUtil;
import com.jero.modules.ota.utils.ImportFileUtil;
import com.jero.modules.system.service.ISysDictService;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Cell;
@@ -36,6 +34,8 @@ import java.io.File;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description: 车型备案-在线升级要求
@@ -81,6 +81,7 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
}
}
otaBaCxZxsjyq.setUpdateTime(now);
otaBaCxZxsjyq.setZmcl("");
if (null != otaBaCxZxsjyq.getZmclList() && otaBaCxZxsjyq.getZmclList().size() > 0) {
JSONArray obj = new JSONArray();
for (AttachmentEO aeo : otaBaCxZxsjyq.getZmclList()) {
@@ -88,12 +89,31 @@ public class OtaBaCxZxsjyqServiceImpl extends ServiceImpl<OtaBaCxZxsjyqMapper, O
}
otaBaCxZxsjyq.setZmcl(obj.toString());
}
if (ObjectUtils.isNotEmpty(otaBaCxZxsjyqOld) && StringUtils.isNotEmpty(otaBaCxZxsjyqOld.getZmcl())) {
List<AttachmentEO> aeoList = JSONArray.parseArray(otaBaCxZxsjyqOld.getZmcl(), AttachmentEO.class);
otaBaCxZxsjyqOld.setZmclList(aeoList);
}
saveOrUpdate(otaBaCxZxsjyq);
ComparisonUtil cu = new ComparisonUtil();
if (ObjectUtils.isEmpty(otaBaCxZxsjyqOld)) {
otaBaCxZxsjyqOld = new OtaBaCxZxsjyq();
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaCxZxsjyq.getOtaId(), OtaModuleEnum.CX_ZXSJYQ, otaBaCxZxsjyqOld, otaBaCxZxsjyq, sysDictService);
Map<String, String> newAttMap = otaBaCxZxsjyq.getZmclList().stream().collect(Collectors.toMap(AttachmentEO::getId, AttachmentEO::getFileName));
Map<String, String> oldAttMap = otaBaCxZxsjyqOld.getZmclList().stream().collect(Collectors.toMap(AttachmentEO::getId, AttachmentEO::getFileName));
for (String nId : newAttMap.keySet()) {
if (!oldAttMap.containsKey(nId)) {
reList.add(cu.addAttRecord(otaBaCxZxsjyq.getOtaId(), OtaModuleEnum.CX_ZXSJYQ, "证明材料", newAttMap.get(nId)));
}
}
for (String oId : oldAttMap.keySet()) {
if (!newAttMap.containsKey(oId)) {
reList.add(cu.delAttRecord(otaBaCxZxsjyq.getOtaId(), OtaModuleEnum.CX_ZXSJYQ, "证明材料", oldAttMap.get(oId)));
}
}
otaBaCxTxjlService.saveBatch(reList);
}
@@ -1,10 +1,9 @@
package com.jero.modules.ota.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.ota.entity.AttachmentEO;
import com.jero.modules.ota.entity.OtaBaCxAqcs;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.ota.entity.OtaBaCxTxjl;
import com.jero.modules.ota.entity.OtaBaSjGgnrfs;
import com.jero.modules.ota.enums.OtaModuleEnum;
@@ -18,16 +17,13 @@ import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.File;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.util.Date;
import java.util.List;
/**
* @Description: 升级备案-用户告知内容及方式
@@ -50,6 +46,9 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
@Autowired
private ISysDictService sysDictService;
@Autowired
private IOSSFileService ossFileService;
/**
* 保存
*
@@ -61,8 +60,10 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
Date now = new Date();
if (null != otaBaSjGgnrfs) {
OtaBaSjGgnrfs otaBaSjGgnrfsOld = this.getByOtaId(otaBaSjGgnrfs.getOtaId());
String oldFjStr = "";
if (null != otaBaSjGgnrfsOld) {
otaBaSjGgnrfs.setId(otaBaSjGgnrfsOld.getId());
oldFjStr = otaBaSjGgnrfsOld.getXgwj();
} else {
otaBaSjGgnrfs.setCreateTime(now);
}
@@ -73,6 +74,8 @@ public class OtaBaSjGgnrfsServiceImpl extends ServiceImpl<OtaBaSjGgnrfsMapper, O
otaBaSjGgnrfsOld = new OtaBaSjGgnrfs();
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjGgnrfs.getOtaId(), OtaModuleEnum.SJ_YHGZNRFS, otaBaSjGgnrfsOld, otaBaSjGgnrfs, sysDictService);
reList.addAll(cu.comparisonRecord(otaBaSjGgnrfs.getOtaId(), otaBaSjGgnrfs.getXgwj(), oldFjStr, OtaModuleEnum.SJ_YHGZNRFS, "附件", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -107,15 +107,14 @@ public class OtaBaSjSjfzbhServiceImpl extends ServiceImpl<OtaBaSjSjfzbhMapper, O
ComparisonUtil cu = new ComparisonUtil();
List<OtaBaCxTxjl> reList = cu.comparisonListRecord(otaId, OtaModuleEnum.SJ_SJJSMCBH, OtaTitleEnum.GNMC.getName(), oldList, newList, sysDictService);
saveOrUpdateBatch(newList);
otaBaCxTxjlService.saveBatch(reList);
String fj = (String) json.get("fj");
if (StringUtils.isNotEmpty(fj)) {
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
if (ObjectUtils.isNotEmpty(otaBaSjList)) {
otaBaSjList.setSjjsfj(fj);
otaBaSjListService.editById(otaBaSjList);
}
}
OtaBaSjList otaBaSjList = otaBaSjListService.queryById(otaId);
String oldFjStr = otaBaSjList.getSjjsfj();
otaBaSjList.setSjjsfj(fj);
otaBaSjListService.editById(otaBaSjList);
reList.addAll(cu.comparisonRecord(otaId, fj, oldFjStr, OtaModuleEnum.SJ_SJJSMCBH, "附件", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -2,6 +2,8 @@ package com.jero.modules.ota.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaSjSjmbclMapper;
@@ -54,6 +56,9 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
@Autowired
private IOtaBaCxTxjlService otaBaCxTxjlService;
@Autowired
private IOSSFileService ossFileService;
/**
* 保存
*
@@ -64,19 +69,25 @@ public class OtaBaSjSjmbclServiceImpl extends ServiceImpl<OtaBaSjSjmbclMapper, O
public void add(OtaBaSjSjmbcl otaBaSjSjmbcl) {
Date now = new Date();
if (null != otaBaSjSjmbcl) {
String newFj = otaBaSjSjmbcl.getCsv();
String oldFjStr = "";
OtaBaSjSjmbcl otaBaSjSjmbclOld = this.getByOtaId(otaBaSjSjmbcl.getOtaId());
if (null != otaBaSjSjmbclOld) {
otaBaSjSjmbcl.setId(otaBaSjSjmbclOld.getId());
oldFjStr = otaBaSjSjmbclOld.getCsv();
} else {
otaBaSjSjmbcl.setCreateTime(now);
}
otaBaSjSjmbcl.setUpdateTime(now);
deleteById(otaBaSjSjmbcl.getId());
saveOrUpdate(otaBaSjSjmbcl);
ComparisonUtil cu = new ComparisonUtil();
if (ObjectUtils.isEmpty(otaBaSjSjmbclOld)) {
otaBaSjSjmbclOld = new OtaBaSjSjmbcl();
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjmbcl.getOtaId(), OtaModuleEnum.SJ_SJMBCL, otaBaSjSjmbclOld, otaBaSjSjmbcl, sysDictService);
reList.addAll(cu.comparisonRecord(otaBaSjSjmbcl.getOtaId(), newFj, oldFjStr, OtaModuleEnum.SJ_SJMBCL, "附件", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -3,6 +3,7 @@ package com.jero.modules.ota.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.mapper.OtaBaSjSjyxpgMapper;
@@ -49,6 +50,9 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
@Value(value = "${ota.uploadPath}")
private String uploadPath;
@Autowired
private IOSSFileService ossFileService;
/**
* 保存
*
@@ -59,9 +63,18 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
public void add(OtaBaSjSjyxpg otaBaSjSjyxpg) {
Date now = new Date();
if (null != otaBaSjSjyxpg) {
String newYzcl = otaBaSjSjyxpg.getBgfj();
String oldYzcl = "";
String newZmcl = otaBaSjSjyxpg.getClfj();
String oldZmcl = "";
OtaBaSjSjyxpg otaBaSjSjyxpgOld = this.getByOtaId(otaBaSjSjyxpg.getOtaId());
if (null != otaBaSjSjyxpgOld) {
otaBaSjSjyxpg.setId(otaBaSjSjyxpgOld.getId());
oldYzcl = otaBaSjSjyxpgOld.getBgfj();
oldZmcl = otaBaSjSjyxpgOld.getClfj();
} else {
otaBaSjSjyxpg.setCreateTime(now);
}
@@ -72,6 +85,8 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl<OtaBaSjSjyxpgMapper, O
otaBaSjSjyxpgOld = new OtaBaSjSjyxpg();
}
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), OtaModuleEnum.SJ_SJYXPG, otaBaSjSjyxpgOld, otaBaSjSjyxpg, sysDictService);
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newYzcl, oldYzcl, OtaModuleEnum.SJ_SJMBCL, "验证材料", ossFileService));
reList.addAll(cu.comparisonRecord(otaBaSjSjyxpg.getOtaId(), newZmcl, oldZmcl, OtaModuleEnum.SJ_SJMBCL, "证明材料", ossFileService));
otaBaCxTxjlService.saveBatch(reList);
}
}
@@ -1,5 +1,7 @@
package com.jero.modules.ota.utils;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.ota.entity.OtaBaCxTxjl;
import com.jero.modules.ota.enums.OtaModuleEnum;
import com.jero.modules.ota.enums.OtaTitleEnum;
@@ -22,6 +24,51 @@ public class ComparisonUtil<T> {
public ComparisonUtil() {
}
public List<OtaBaCxTxjl> comparisonRecord(String otaId, String newFj,String oldFjStr,OtaModuleEnum otaModuleEnum, String title, IOSSFileService ossFileService) {
List<OtaBaCxTxjl> reList = new ArrayList<>();
String[] newFjList = {};
if (StringUtils.isNotEmpty(newFj)) {
newFjList = newFj.split(",");
}
for (String nf : newFjList) {
if (StringUtils.isEmpty(oldFjStr) || !oldFjStr.contains(nf)) {
List<OSSFile> fileList = ossFileService.getFileInfos(nf);
if (ObjectUtils.isNotEmpty(fileList)) {
for (OSSFile f : fileList) {
reList.add(addAttRecord(otaId, otaModuleEnum, title, f.getFileName()));
}
}
}
}
String[] oldFjList = {};
if (StringUtils.isNotEmpty(oldFjStr)) {
oldFjList = oldFjStr.split(",");
}
for (String of : oldFjList) {
if (StringUtils.isEmpty(newFj) || !newFj.contains(of)) {
List<OSSFile> fileList = ossFileService.getFileInfos(of);
if (ObjectUtils.isNotEmpty(fileList)) {
for (OSSFile f : fileList) {
reList.add(delAttRecord(otaId, otaModuleEnum, title, f.getFileName()));
}
}
}
}
return reList;
}
public OtaBaCxTxjl addAttRecord(String otaId, OtaModuleEnum otaModuleEnum, String title, String attName) {
String content = title + "中添加了附件:'" + attName;
OtaBaCxTxjl jl = new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content);
return jl;
}
public OtaBaCxTxjl delAttRecord(String otaId, OtaModuleEnum otaModuleEnum, String title, String attName) {
String content = title + "中删除了附件:'" + attName;
OtaBaCxTxjl jl = new OtaBaCxTxjl(otaId, otaModuleEnum.getName(), content);
return jl;
}
/**
* 对比字段并添加到记录
*/
@@ -65,28 +65,28 @@ public class ProjectCertificationInventoryEO implements Serializable {
private String sysOrgCode;
/**类别*/
@Excel(name = "类别", width = 15)
@Excel(name = "类别", width = 20)
@ApiModelProperty(value = "类别")
private String category;
/**检验项目*/
@Excel(name = "检验项目", width = 15)
@Excel(name = "检验项目", width = 20)
@ApiModelProperty(value = "检验项目")
private String inspectionItem;
/**配置项*/
@Excel(name = "配置项", width = 15)
@Excel(name = "配置项", width = 20)
@ApiModelProperty(value = "配置项")
@Dict(dicCode = "ren4_zheng4_qing1_dan1_-_pei4_zhi4_xiang4")
private String configItem;
/**WVTA ID*/
@Excel(name = "WVTA ID", width = 15)
@Excel(name = "WVTA ID", width = 20)
@ApiModelProperty(value = "WVTA ID")
private String wvtaId;
/**标准编号*/
@Excel(name = "*标准编号", width = 15)
@Excel(name = "*标准编号", width = 20)
@ApiModelProperty(value = "标准编号")
private String serialNumber;
@@ -94,7 +94,7 @@ public class ProjectCertificationInventoryEO implements Serializable {
@ApiModelProperty(value = "责任领域")
private String dutyTerritory;
/**责任领域名称**/
@Excel(name = "*责任领域", width = 15)
@Excel(name = "*责任领域", width = 20)
@TableField(exist = false)
private String dutyTerritoryName;
/**责任领域名称-英文**/
@@ -105,7 +105,7 @@ public class ProjectCertificationInventoryEO implements Serializable {
@ApiModelProperty(value = "工程接口人")
private String sdt;
/**工程接口人名称**/
@Excel(name = "工程接口人", width = 15)
@Excel(name = "工程接口人", width = 20)
@TableField(exist = false)
private String sdtName;
@@ -113,7 +113,7 @@ public class ProjectCertificationInventoryEO implements Serializable {
@ApiModelProperty(value = "责任人")
private String dutyPerson;
/**责任人名称**/
@Excel(name = "责任人", width = 15)
@Excel(name = "责任人", width = 20)
@TableField(exist = false)
private String dutyPersonName;
@@ -121,7 +121,7 @@ public class ProjectCertificationInventoryEO implements Serializable {
@ApiModelProperty(value = "交付物类型")
private String deliverableType;
// 交付物类型名称
@Excel(name = "交付物类型", width = 15)
@Excel(name = "交付物类型", width = 20)
@TableField(exist = false)
private String deliverableTypeName;
// 交付物类型名称-英文
@@ -144,16 +144,16 @@ public class ProjectCertificationInventoryEO implements Serializable {
private String deliverableTemplate;
/**交付物模板名称**/
@TableField(exist = false)
@Excel(name = "交付物模板", width = 15)
@Excel(name = "交付物模板", width = 20)
private String deliverableTemplateName;
/**交付结果*/
@Excel(name = "交付结果", width = 15)
@Excel(name = "交付结果", width = 20)
@ApiModelProperty(value = "交付结果")
private String deliveryResult;
/**截止日期*/
@Excel(name = "截止日期", width = 15, format = "yyyy-MM-dd")
@Excel(name = "截止日期", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "截止日期")
@@ -162,31 +162,32 @@ public class ProjectCertificationInventoryEO implements Serializable {
@ApiModelProperty(value = "流程状态")
private String flowStatus;
// 流程状态展示名称
@Excel(name = "流程状态", width = 15)
@Excel(name = "流程状态", width = 20)
@TableField(exist = false)
private String flowStatusName;
/**报告编号*/
@Excel(name = "报告编号", width = 15)
@Excel(name = "报告编号", width = 20)
@ApiModelProperty(value = "报告编号")
private String reportNumber;
/**产品型号*/
@Excel(name = "产品型号", width = 15)
@Excel(name = "产品型号", width = 20)
@ApiModelProperty(value = "产品型号")
private String productModel;
/**生产企业名称*/
@Excel(name = "生产企业名称", width = 15)
@Excel(name = "生产企业名称", width = 20)
@ApiModelProperty(value = "生产企业名称")
private String productionEnterpriseName;
/**认证进度*/
@Excel(name = "认证进度", width = 15)
@ApiModelProperty(value = "认证进度")
private String certificationProgress;
/**认证进度展示名称**/
@Excel(name = "认证进度", width = 20)
@TableField(exist = false)
private String certificationProgress_dictText;
@@ -214,7 +215,7 @@ public class ProjectCertificationInventoryEO implements Serializable {
@TableField(exist = false)
private String excelName;
// @Excel(name = "截止日期", width = 15, format = "yyyy-MM-dd")
// @TableField(exist = false)
// private String endTimeStr;
// @Excel(name = "截止日期", width = 20, format = "yyyy-MM-dd")
@TableField(exist = false)
private String endTimeStr;
}
@@ -63,28 +63,28 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
private java.lang.String sysOrgCode;
/**类别*/
@Excel(name = "Category", width = 15)
@Excel(name = "Category", width = 20)
@ApiModelProperty(value = "类别")
private java.lang.String category;
/**检验项目*/
@Excel(name = "Inspection Items", width = 15)
@Excel(name = "Inspection Items", width = 20)
@ApiModelProperty(value = "检验项目")
private java.lang.String inspectionItem;
/**配置项*/
@Excel(name = "Configuration Item", width = 15)
@Excel(name = "Configuration Item", width = 20)
@ApiModelProperty(value = "配置项")
@Dict(dicCode = "ren4_zheng4_qing1_dan1_-_pei4_zhi4_xiang4")
private java.lang.String configItem;
/**WVTA ID*/
@Excel(name = "WVTA ID", width = 15)
@Excel(name = "WVTA ID", width = 20)
@ApiModelProperty(value = "WVTA ID")
private java.lang.String wvtaId;
/**标准编号*/
@Excel(name = "*Standard No", width = 15)
@Excel(name = "*Standard No", width = 20)
@ApiModelProperty(value = "标准编号")
private java.lang.String serialNumber;
@@ -92,7 +92,7 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
@ApiModelProperty(value = "责任领域")
private java.lang.String dutyTerritory;
/**责任领域名称**/
@Excel(name = "*Responsible Field", width = 15)
@Excel(name = "*Responsible Field", width = 20)
@TableField(exist = false)
private String dutyTerritoryName;
/**责任领域名称-英文**/
@@ -103,7 +103,7 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
@ApiModelProperty(value = "工程接口人")
private java.lang.String sdt;
/**工程接口人名称**/
@Excel(name = "Eng. Interface", width = 15)
@Excel(name = "Eng. Interface", width = 20)
@TableField(exist = false)
private String sdtName;
@@ -111,7 +111,7 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
@ApiModelProperty(value = "责任人")
private java.lang.String dutyPerson;
/**责任人名称**/
@Excel(name = "Assignee", width = 15)
@Excel(name = "Assignee", width = 20)
@TableField(exist = false)
private String dutyPersonName;
@@ -119,7 +119,7 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
@ApiModelProperty(value = "交付物类型")
private java.lang.String deliverableType;
// 交付物类型名称
@Excel(name = "Deliverable Type", width = 15)
@Excel(name = "Deliverable Type", width = 20)
@TableField(exist = false)
private String deliverableTypeName;
// 交付物类型名称-英文
@@ -142,16 +142,16 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
private java.lang.String deliverableTemplate;
/**交付物模板名称**/
@TableField(exist = false)
@Excel(name = "交付物模板", width = 15)
@Excel(name = "交付物模板", width = 20)
private String deliverableTemplateName;
/**交付结果*/
@Excel(name = "Deliverables Result", width = 15)
@Excel(name = "Deliverables Result", width = 20)
@ApiModelProperty(value = "交付结果")
private java.lang.String deliveryResult;
/**截止日期*/
@Excel(name = "Due Date", width = 15, format = "yyyy-MM-dd")
@Excel(name = "Due Date", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "截止日期")
@@ -161,32 +161,33 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
@ApiModelProperty(value = "流程状态")
private java.lang.String flowStatus;
// 流程状态展示名称
@Excel(name = "Process Status", width = 15)
@Excel(name = "Process Status", width = 20)
@TableField(exist = false)
private String flowStatusName;
/**报告编号*/
@Excel(name = "Report No", width = 15)
@Excel(name = "Report No", width = 20)
@ApiModelProperty(value = "报告编号")
private java.lang.String reportNumber;
/**产品型号*/
@Excel(name = "Product Model", width = 15)
@Excel(name = "Product Model", width = 20)
@ApiModelProperty(value = "产品型号")
private java.lang.String productModel;
/**生产企业名称*/
@Excel(name = "Name Of Manufacturer", width = 15)
@Excel(name = "Name Of Manufacturer", width = 40)
@ApiModelProperty(value = "生产企业名称")
private java.lang.String productionEnterpriseName;
/**认证进度*/
@Excel(name = "Homologation Progress", width = 15)
@ApiModelProperty(value = "认证进度")
private java.lang.String certificationProgress;
/**认证进度展示名称**/
@TableField(exist = false)
@Excel(name = "Homologation Progress", width = 40)
private String certificationProgress_dictText;
// @Excel(name = "认证进度备注", width = 15)
@@ -205,4 +206,15 @@ public class ProjectCertificationInventoryEOEn implements Serializable {
@TableField(exist = false)
private String roleCode;
/**值类型,对应SysCategoryValueTypeEnum中value**/
@TableField(exist = false)
private String valueType;
@TableField(exist = false)
private String excelName;
// @Excel(name = "截止日期", width = 20, format = "yyyy-MM-dd")
@TableField(exist = false)
private String endTimeStr;
}
@@ -21,7 +21,6 @@ public enum ProjectRoleEnum {
MANAGER("manage","11",""),
ADMIN("系统管理员","12",""),
VIEWER("Viewer","13",""),
DUTYPERSON("责任人","14","")
;
String name;
@@ -45,6 +45,7 @@ import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.enums.SysCategoryValueTypeEnum;
import com.jero.modules.system.mapper.SysCategoryMapper;
import com.jero.modules.system.mapper.SysRoleMapper;
import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysCategoryService;
import com.jero.modules.system.service.ISysDictItemService;
import com.jero.modules.system.service.ISysUserService;
@@ -155,6 +156,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
private IProjectRelatedPersonnelService iProjectRelatedPersonnelService;
@Autowired
private IOSSFileService iOSSFileService;
@Autowired
private SysUserMapper sysUserMapper;
/**
* 保存
@@ -740,6 +743,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
data.setCertificationProgress_dictText(certificationProgress_dictText);
}
// String GetEndTime = String.valueOf(data.getEndTime());
// if(StringUtils.isNotEmpty(GetEndTime)){
// Date endTime = new Date();
// if(StringUtils.equals(cut,CutEnum.CN.getValue())){
// endTime = data.getEndTime();
// }else {
// endTime = data.getEndTime();
// }
// data.setEndTimeStr(String.valueOf(endTime));
// }
}
}
}
@@ -2965,11 +2978,17 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
//工程接口人engineeringInterfacePerson
String sdt = projectCertificationInventoryEO.getSdtName();
//责任人
String dutyPerson = projectCertificationInventoryEO.getDutyPersonName();
String dutyPerson = projectCertificationInventoryEO.getDutyPersonName();;
//交付物类型
String deliverableType = projectCertificationInventoryEO.getDeliverableTypeName();
String deliverableType = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
deliverableType = projectCertificationInventoryEO.getDeliverableTypeName();
}else {
deliverableType = projectCertificationInventoryEO.getDeliverableTypeNameEn();
}
//截止时间
Date endTime = projectCertificationInventoryEO.getEndTime();
String endTime = projectCertificationInventoryEO.getEndTimeStr();
//文件
//交付物模板
@@ -3089,7 +3108,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
//工程接口人
List<Map<String, String>> mapPersonList = (List<Map<String, String>>) objectMap.get("engineeringInterfacePersonList");
//所有人
List<Map<String, String>> allPersonList = (List<Map<String, String>>) objectMap.get("allPersonList");
// List<Map<String, String>> allPersonList = (List<Map<String, String>>) objectMap.get("allPersonList");
List<SysUser> listUserName = new ArrayList<>();
listUserName = sysUserMapper.getListUserName();
listUserName = listUserName.stream().distinct().collect(Collectors.toList());
String nameCn = "";
String nameEn = "";
@@ -3113,7 +3137,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
nameCn = "责任人";
nameEn = "Assignee";
//验证人员是否存在
personnelVerify(projectCertificationInventoryEO, errorMsg, msgList, dutyPerson, allPersonList,nameCn,nameEn, com.jero.modules.project.enums.ProjectRoleEnum.DUTYPERSON.getValue());
personDutyPerson(projectCertificationInventoryEO, errorMsg, msgList, dutyPerson, listUserName,nameCn,nameEn);
}else {
String message = "";
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEOTemp.getCut())){
@@ -3146,12 +3170,19 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
projectCertificationInventoryEO.setDeliverableTemplate(value);
}
//截止时间
SimpleDateFormat sd = new SimpleDateFormat();
String endTimeStr = sd.format(endTime);
if(StringUtils.isNotBlank(endTimeStr)){
// SimpleDateFormat sd = new SimpleDateFormat();
// String endTimeStr = sd.format(endTime);
if(StringUtils.isNotBlank(endTime)){
flag = dateVerify(projectCertificationInventoryEO, errorMsg, endTime,msgList,"截止时间","Due Date");
if(flag){
projectCertificationInventoryEO.setEndTime(projectCertificationInventoryEO.getEndTime());
SimpleDateFormat sd = new SimpleDateFormat();
Date date = null;
try {
date = sd.parse(endTime);
} catch (ParseException e) {
e.printStackTrace();
}
projectCertificationInventoryEO.setEndTime(date);
}
}else{
String message = "";
@@ -3187,14 +3218,14 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
private boolean dateVerify(ProjectCertificationInventoryEO projectCertificationInventoryEO,
String errorMsg, Date field, List<String> msgList, String nameCn, String nameEn) {
String errorMsg, String field, List<String> msgList, String nameCn, String nameEn) {
//判断格式是否正确
boolean flag = true;
if(ObjectUtils.isNotEmpty(field)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String format = sdf.format(field);
if (!DateUtils.isValidDate(format)) {
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// String format = sdf.format(field);
if (!DateUtils.isValidDate(field)) {
flag = false;
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn + "格式不正确, 正确格式如:yyyy/m/d、yyyy-MM-dd、yyyy年MM月dd日";
@@ -3203,6 +3234,24 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
msgList.add(errorMsg);
}
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
long longnow = now.getTime();
try {
Date date = sdf.parse(field);
long longdate = date.getTime();
if(longnow>longdate){
flag = false;
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn + "不能导入今天之前的日期";
}else{
errorMsg += nameEn + " Cannot import dates before today ";
}
msgList.add(errorMsg);
}
} catch (ParseException e) {
e.printStackTrace();
}
}
return flag;
}
@@ -3315,7 +3364,39 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
}
return null;
}
private void personDutyPerson(ProjectCertificationInventoryEO projectCertificationInventoryEO,
String errorMsg, List<String> msgList, String regulationOwnerId,
List<SysUser> listUserName ,String nameCn, String nameEn){
//单选
if(regulationOwnerId.contains(",")){
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn + "导入只能填写一个用户名, ";
}else{
errorMsg += "Only one user name can be entered for"+ nameEn +"import, ";
}
msgList.add(errorMsg);
}
int count =0;
for(SysUser name : listUserName){
if(StringUtils.isNotEmpty(name.getUsername())){
if(name.getUsername().equals(regulationOwnerId)){
count++;
String id = name.getId();
projectCertificationInventoryEO.setDutyPerson(id);
break;
}
}
}
if(count==0){
if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
errorMsg += nameCn+regulationOwnerId+"与所有人员名单不匹配";
}else{
errorMsg += nameEn+regulationOwnerId+"does not match a person with all person list";
}
msgList.add(errorMsg);
}
}
private void personnelVerify(ProjectCertificationInventoryEO projectCertificationInventoryEO,
String errorMsg, List<String> msgList, String regulationOwnerId,
List<Map<String, String>> mapList, String nameCn, String nameEn, String fieldNumber) {
@@ -3337,8 +3418,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
count ++;
if(com.jero.modules.project.enums.ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue().equals(fieldNumber)){
projectCertificationInventoryEO.setSdt(stringStringMap.get("value"));
}else if(com.jero.modules.project.enums.ProjectRoleEnum.DUTYPERSON.getValue().equals(fieldNumber)){
projectCertificationInventoryEO.setDutyPerson(stringStringMap.get("value"));
}
break;
}
@@ -3456,12 +3535,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
List<OSSFile> fileInfos = getOssFiles(dataList);
//处理文件名称
String fileName = "";
for (int i = 0; i < dataList.size(); i++) {
if(StringUtils.isNotEmpty(dataList.get(i).getDeliveryResult())){
String fileName = ossFileService.getFileInfos(dataList.get(i).getDeliveryResult()).stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(","));
dataList.get(i).setDeliveryResult(fileName);
}
if(StringUtils.isNotEmpty(dataList.get(i).getDeliverableTemplate())){
String deliverableTemplateName = template(fileInfos, dataList.get(i).getDeliverableTemplate());
dataList.get(i).setDeliverableTemplateName(deliverableTemplateName);
@@ -3482,6 +3557,30 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
fileTemp.mkdirs();
//文件
exportFile(dataList,fileInfos);
for(int i =0 ;i<dataList.size();i++){
if(dataList.get(i).getValueType().equals(SysCategoryValueTypeEnum.FILE.getValue())){
if(StringUtils.isNotEmpty(dataList.get(i).getDeliveryResult())){
fileName = ossFileService.getFileInfos(dataList.get(i).getDeliveryResult()).stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(","));
dataList.get(i).setDeliveryResult(fileName);
}
}else if(dataList.get(i).getValueType().equals(SysCategoryValueTypeEnum.TEXT.getValue())){
if(StringUtils.isNotEmpty(dataList.get(i).getDeliveryResult())){
fileName = dataList.get(i).getDeliveryResult();
dataList.get(i).setDeliveryResult(fileName);
}
}else if(dataList.get(i).getValueType().equals(SysCategoryValueTypeEnum.NA.getValue())){
fileName = "";
dataList.get(i).setDeliveryResult(fileName);
}else if(dataList.get(i).getValueType().equals(SysCategoryValueTypeEnum.SELECT.getValue())) {
if (StringUtils.isNotEmpty(dataList.get(i).getDeliveryResult())) {
fileName = dataList.get(i).getDeliveryResult();
dataList.get(i).setDeliveryResult(fileName);
}
}
}
String excelName = projectCertificationInventoryEO.getExcelName()+".xlsx";
// String excelName = "";
// if(CutEnum.CN.getValue().equals(projectCertificationInventoryEO.getCut())){
@@ -3540,15 +3639,22 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
for(ProjectCertificationInventoryEO projectCertificationInventoryEO : dataList){
String deliverableTemplate = projectCertificationInventoryEO.getDeliverableTemplate();
String serialNumber = projectCertificationInventoryEO.getSerialNumber();
String deliveryResult = projectCertificationInventoryEO.getDeliveryResult();
if(StringUtils.isBlank(serialNumber)){
continue;
}
List<OSSFile> deliverableTemplateFileList = new ArrayList<>();
List<OSSFile> deliveryResultList = new ArrayList<>();
List<OSSFile> oSSFileList = new ArrayList<>();
if(StringUtils.isNotBlank(deliverableTemplate)){
deliverableTemplateFileList = fileInfos.stream().filter(e -> deliverableTemplate.contains(e.getId())).collect(Collectors.toList());
oSSFileList.addAll(deliverableTemplateFileList);
}
if(StringUtils.isNotBlank(deliveryResult) && projectCertificationInventoryEO.getValueType().equals(SysCategoryValueTypeEnum.FILE.getValue())){
deliveryResultList = fileInfos.stream().filter(e -> deliveryResult.contains(e.getId())).collect(Collectors.toList());
oSSFileList.addAll(deliveryResultList);
}
if(oSSFileList.size() != 0){
String fileNowPath = uploadpath + "/tempZip/" + serialNumber;
File file = new File(fileNowPath);
@@ -3594,6 +3700,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
if(StringUtils.isNotBlank(projectCertificationInventoryEO.getDeliverableTemplate())){
fileIdList.add(projectCertificationInventoryEO.getDeliverableTemplate());
}
if(StringUtils.isNotBlank(projectCertificationInventoryEO.getDeliveryResult())){
fileIdList.add(projectCertificationInventoryEO.getDeliveryResult());
}
}
//查询所有的文件
List<OSSFile> fileInfos = new ArrayList<>();
@@ -3679,8 +3788,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
case "*交付物类型": return "deliverableTypeName";
case "交付物模板": return "deliverableTemplateName";
case "交付结果": return "deliveryResult";
case "*截止日期": return "endTime";
// case "*截止日期": return "endTimeStr";
case "截止日期": return "endTime";
case "*截止日期": return "endTimeStr";
case "流程状态": return "flowStatus";
case "报告编号": return "reportNumber";
case "产品型号": return "productModel";
@@ -3697,8 +3806,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
case "*Deliverable Type": return "deliverableTypeNameEn";
case "Deliverable Template": return "deliverableTemplateName";
case "Deliverables Result": return "deliveryResult";
case "*Due Date": return "endTime";
// case "*Due Date": return "endTimeStr";
case "Due Date": return "endTime";
case "*Due Date": return "endTimeStr";
case "Process Status": return "flowStatus";
case "Report No": return "reportNumber";
case "Product Model": return "productModel";