合并分支 'dev_third_stage' 到 'master'
Dev third stage 查看合并请求 laws-nio/laws-weilai!83
This commit is contained in:
@@ -359,4 +359,24 @@ ALTER TABLE `laws_weilai`.`params_report_detail`
|
||||
|
||||
ALTER TABLE `laws_weilai`.`report_cert_category_params_info`
|
||||
MODIFY COLUMN `description` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数说明' AFTER `params_name`;
|
||||
--以上SQL 2022年7月12日 已同步正式环境
|
||||
--以上SQL 2022年7月12日 已同步正式环境
|
||||
|
||||
-- 参数项清单表 添加字段 标题默认值 2022-07-13
|
||||
ALTER TABLE `laws_weilai`.`params_info`
|
||||
ADD COLUMN `title_default_value` varchar(100) NULL COMMENT '标题默认值' AFTER `params_template_id`;
|
||||
|
||||
ALTER TABLE `laws_weilai`.`params_info_publish`
|
||||
ADD COLUMN `title_default_value` varchar(100) NULL COMMENT '标题默认值' AFTER `version`;
|
||||
|
||||
ALTER TABLE `laws_weilai`.`params_collect_manifest`
|
||||
ADD COLUMN `title_default_value` varchar(100) NULL COMMENT '标题默认值' AFTER `add_flag`;
|
||||
|
||||
ALTER TABLE `laws_weilai`.`params_collect_manifest_history`
|
||||
ADD COLUMN `title_default_value` varchar(100) NULL COMMENT '标题默认值' AFTER `params_manifest_id`;
|
||||
|
||||
ALTER TABLE `laws_weilai`.`params_report_detail`
|
||||
ADD COLUMN `title_default_value` varchar(100) NULL COMMENT '标题默认值' AFTER `sync_time`;
|
||||
|
||||
-- 法规技术评估 反馈评估表中,增加符合性结果表id关联 2022-07-14
|
||||
ALTER TABLE `laws_technology_evaluation_result`
|
||||
ADD COLUMN `compliance_result_id` varchar(64) NULL COMMENT '符合性结果id' AFTER `acti_proc_inst_id`;
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.jero.common.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class FileUtils {
|
||||
/**
|
||||
* 复制文件
|
||||
* @param in
|
||||
* @param newFile
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void copyFile(InputStream in, String newFile) throws IOException {
|
||||
File file2 = new File(newFile);
|
||||
if (!file2.exists()) {
|
||||
file2.createNewFile();
|
||||
}
|
||||
try (FileOutputStream ou = new FileOutputStream(newFile);) {
|
||||
byte[] bs = new byte[1024];
|
||||
int count = 0;
|
||||
while ((count = in.read(bs, 0, bs.length)) != -1) {
|
||||
ou.write(bs, 0, count);
|
||||
}
|
||||
ou.flush();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
throw new IOException("复制文件失败!");
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
+31
-14
@@ -5,20 +5,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.PermissionData;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
|
||||
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
|
||||
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -77,19 +74,20 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
|
||||
public Result<?> queryList(ParamsCollectManifestEO paramsCollectManifestEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="100") Integer pageSize,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
if (StringUtils.isNotEmpty(paramsCollectManifestEO.getNioNumber())) {
|
||||
paramsCollectManifestEO.setNioNumber(paramsCollectManifestEO.getNioNumber().replace("%","\\%"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsCollectManifestEO.getParamsName())) {
|
||||
paramsCollectManifestEO.setParamsName(paramsCollectManifestEO.getParamsName().replace("%","\\%"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsCollectManifestEO.getDre())) {
|
||||
paramsCollectManifestEO.setDre(paramsCollectManifestEO.getDre().replace("%","\\%"));
|
||||
}
|
||||
@RequestParam(name = "cut") String cut,
|
||||
HttpServletRequest req) {
|
||||
// if (StringUtils.isNotEmpty(paramsCollectManifestEO.getNioNumber())) {
|
||||
// paramsCollectManifestEO.setNioNumber(paramsCollectManifestEO.getNioNumber().replace("%","\\%"));
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(paramsCollectManifestEO.getParamsName())) {
|
||||
// paramsCollectManifestEO.setParamsName(paramsCollectManifestEO.getParamsName().replace("%","\\%"));
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(paramsCollectManifestEO.getDre())) {
|
||||
// paramsCollectManifestEO.setDre(paramsCollectManifestEO.getDre().replace("%","\\%"));
|
||||
// }
|
||||
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
IPage list = paramsCollectManifestEOService.queryList(page, paramsCollectManifestEO, cut);
|
||||
IPage list = paramsCollectManifestEOService.queryList(page, paramsCollectManifestEO, cut, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -279,6 +277,25 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改责任领域
|
||||
*
|
||||
* @param paramsCollectManifestVO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数项收集清单-修改责任领域")
|
||||
@ApiOperation(value="参数项收集清单-修改责任领域", notes="参数项收集清单-修改责任领域")
|
||||
@PostMapping(value = "/updateDutyTerritory")
|
||||
// @RequiresPermissions("params:collectManifest:sdt")
|
||||
public Result<?> updateDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO) {
|
||||
boolean isSuccess = paramsCollectManifestEOService.updateDutyTerritory(paramsCollectManifestVO);
|
||||
if (isSuccess) {
|
||||
return Result.OK("修改责任领域成功!");
|
||||
} else {
|
||||
return Result.error("修改责任领域失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配工程接口人
|
||||
*
|
||||
|
||||
+15
-13
@@ -6,6 +6,7 @@ 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.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestHistoryEO;
|
||||
import com.jero.modules.cert.collect.entity.ParamsConfigHistoryEO;
|
||||
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
|
||||
import com.jero.modules.cert.collect.service.IParamsCollectManifestHistoryEOService;
|
||||
@@ -13,13 +14,13 @@ import com.jero.modules.cert.collect.service.IParamsConfigHistoryEOService;
|
||||
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.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 java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -66,22 +67,23 @@ public class ParamsCollectManifestHistoryEOController extends JeroController<Par
|
||||
@ApiOperation(value="历史参数项收集清单-列表查询", notes="历史参数项收集清单-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
// @RequiresPermissions("params:manifest:history")
|
||||
public Result<?> queryList(ParamsCollectManifestEO paramsCollectManifestEO,
|
||||
public Result<?> queryList(ParamsCollectManifestHistoryEO paramsCollectManifestHistoryEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="500") Integer pageSize,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
if (StringUtils.isNotEmpty(paramsCollectManifestEO.getNioNumber())) {
|
||||
paramsCollectManifestEO.setNioNumber(paramsCollectManifestEO.getNioNumber().replace("%","\\%"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsCollectManifestEO.getParamsName())) {
|
||||
paramsCollectManifestEO.setParamsName(paramsCollectManifestEO.getParamsName().replace("%","\\%"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsCollectManifestEO.getDre())) {
|
||||
paramsCollectManifestEO.setDre(paramsCollectManifestEO.getDre().replace("%","\\%"));
|
||||
}
|
||||
@RequestParam(name = "cut") String cut,
|
||||
HttpServletRequest req) {
|
||||
// if (StringUtils.isNotEmpty(paramsCollectManifestHistoryEO.getNioNumber())) {
|
||||
// paramsCollectManifestHistoryEO.setNioNumber(paramsCollectManifestHistoryEO.getNioNumber().replace("%","\\%"));
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(paramsCollectManifestHistoryEO.getParamsName())) {
|
||||
// paramsCollectManifestHistoryEO.setParamsName(paramsCollectManifestHistoryEO.getParamsName().replace("%","\\%"));
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(paramsCollectManifestHistoryEO.getDre())) {
|
||||
// paramsCollectManifestHistoryEO.setDre(paramsCollectManifestHistoryEO.getDre().replace("%","\\%"));
|
||||
// }
|
||||
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
IPage list = paramsCollectManifestHistoryEOService.queryList(page, paramsCollectManifestEO, cut);
|
||||
IPage list = paramsCollectManifestHistoryEOService.queryList(page, paramsCollectManifestHistoryEO, cut, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -137,4 +137,9 @@ public class ParamsCollectManifestBaseEO implements Serializable {
|
||||
@Excel(name = "参数清单id", width = 15)
|
||||
@ApiModelProperty(value = "参数清单id")
|
||||
private String paramsManifestId;
|
||||
|
||||
/**标题默认值*/
|
||||
@Excel(name = "默认值", width = 15)
|
||||
@ApiModelProperty(value = "标题默认值")
|
||||
private String titleDefaultValue;
|
||||
}
|
||||
|
||||
+8
-5
@@ -1,11 +1,11 @@
|
||||
package com.jero.modules.cert.collect.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 参数收集清单
|
||||
@@ -17,5 +17,8 @@ public interface ParamsCollectManifestEOMapper extends BaseMapper<ParamsCollectM
|
||||
|
||||
List<ParamsCollectManifestEO> listInfo(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
|
||||
|
||||
// 查询控件类型为 标题的 参数项
|
||||
List<ParamsCollectManifestEO> listInfoOfTitle(@Param("paramsManifestId") String paramsManifestId);
|
||||
|
||||
IPage pageInfo(@Param("page") IPage page, @Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
|
||||
}
|
||||
|
||||
+9
@@ -29,6 +29,7 @@
|
||||
<result column="change_flag" property="changeFlag" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
<result column="add_flag" property="addFlag" />
|
||||
<result column="title_default_value" property="titleDefaultValue" />
|
||||
</resultMap>
|
||||
<sql id="BaseQuerySql">
|
||||
<where>
|
||||
@@ -79,10 +80,18 @@
|
||||
order by del_flag desc, add_flag desc, change_flag desc, nio_number asc
|
||||
</select>
|
||||
|
||||
<select id="listInfoOfTitle" resultMap="ParamsCollectManifestEOResultMap">
|
||||
select *
|
||||
from params_collect_manifest
|
||||
where params_manifest_id = #{paramsManifestId} and control_type = '11'
|
||||
order by del_flag desc, add_flag desc, change_flag desc, nio_number asc
|
||||
</select>
|
||||
|
||||
<select id="pageInfo" resultMap="ParamsCollectManifestEOResultMap">
|
||||
select *
|
||||
from params_collect_manifest
|
||||
<include refid="BaseQuerySql"/>
|
||||
and control_type != '11'
|
||||
order by del_flag desc, add_flag desc, change_flag desc, nio_number asc
|
||||
</select>
|
||||
|
||||
|
||||
+2
@@ -26,6 +26,7 @@
|
||||
<result column="dre" property="dre" />
|
||||
<result column="deadline" property="deadline" />
|
||||
<result column="params_manifest_id" property="paramsManifestId" />
|
||||
<result column="title_default_value" property="titleDefaultValue" />
|
||||
</resultMap>
|
||||
<sql id="BaseQuerySql">
|
||||
<where>
|
||||
@@ -66,6 +67,7 @@
|
||||
select *
|
||||
from params_collect_manifest_history
|
||||
<include refid="BaseQuerySql"/>
|
||||
and control_type != '11'
|
||||
order by nio_number asc
|
||||
</select>
|
||||
</mapper>
|
||||
+5
-2
@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
|
||||
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -64,7 +64,7 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
|
||||
* @param cut
|
||||
* @return
|
||||
*/
|
||||
IPage queryList(IPage page, ParamsCollectManifestEO paramsCollectManifestEO, String cut);
|
||||
IPage queryList(IPage page, ParamsCollectManifestEO paramsCollectManifestEO, String cut, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表表头中英文切换
|
||||
@@ -116,6 +116,9 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
|
||||
// 批量设置截止时间
|
||||
boolean updateDeadlineBatch(ParamsCollectManifestVO paramsCollectManifestVO);
|
||||
|
||||
// 修改责任领域
|
||||
boolean updateDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO);
|
||||
|
||||
// 修改工程接口人
|
||||
boolean updateSdt(ParamsCollectManifestVO paramsCollectManifestVO);
|
||||
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@ package com.jero.modules.cert.collect.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestHistoryEO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -19,11 +19,11 @@ public interface IParamsCollectManifestHistoryEOService extends IService<ParamsC
|
||||
/**
|
||||
* 列表查询
|
||||
* @param page
|
||||
* @param paramsCollectManifestEO
|
||||
* @param paramsCollectManifestHistoryEO
|
||||
* @param cut
|
||||
* @return
|
||||
*/
|
||||
IPage queryList(IPage page, ParamsCollectManifestEO paramsCollectManifestEO, String cut);
|
||||
IPage queryList(IPage page, ParamsCollectManifestHistoryEO paramsCollectManifestHistoryEO, String cut, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表表头中英文切换
|
||||
|
||||
+86
-7
@@ -12,6 +12,7 @@ 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.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
@@ -61,6 +62,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -248,7 +250,14 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage queryList(IPage page, ParamsCollectManifestEO paramsCollectManifestEO, String cut) {
|
||||
public IPage queryList(IPage page, ParamsCollectManifestEO paramsCollectManifestEO, String cut, HttpServletRequest req) {
|
||||
QueryWrapper<ParamsCollectManifestEO> queryWrapper = QueryGenerator.initQueryWrapper(paramsCollectManifestEO, req.getParameterMap());
|
||||
queryWrapper.lambda().notIn(ParamsCollectManifestEO::getControlType, ControlTypeEnum.Title.getValue())
|
||||
.orderByDesc(ParamsCollectManifestEO::getDelFlag)
|
||||
.orderByDesc(ParamsCollectManifestEO::getAddFlag)
|
||||
.orderByDesc(ParamsCollectManifestEO::getChangeFlag)
|
||||
.orderByAsc(ParamsCollectManifestEO::getNioNumber);
|
||||
|
||||
String paramsManifestId = paramsCollectManifestEO.getParamsManifestId();
|
||||
|
||||
String userTypes = paramsCollectManifestEO.getUserTypes();
|
||||
@@ -268,16 +277,21 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
}
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
if ("sdt".equals(userTypes)) {
|
||||
paramsCollectManifestEO.setSdt(loginUser.getUsername());
|
||||
// paramsCollectManifestEO.setSdt(loginUser.getUsername());
|
||||
queryWrapper.lambda().eq(ParamsCollectManifestEO::getSdt, loginUser.getUsername())
|
||||
.in(ParamsCollectManifestEO::getState, '2','4','5','6','7','8');
|
||||
} else if ("dre".equals(userTypes)) {
|
||||
paramsCollectManifestEO.setDreForAuth(loginUser.getUsername());
|
||||
} else if ("sdt,dre".equals(userTypes)) {
|
||||
// paramsCollectManifestEO.setDreForAuth(loginUser.getUsername());
|
||||
queryWrapper.lambda().eq(ParamsCollectManifestEO::getDre, loginUser.getUsername())
|
||||
.in(ParamsCollectManifestEO::getState, '4','6','7','8');
|
||||
}/* else if ("sdt,dre".equals(userTypes)) {
|
||||
paramsCollectManifestEO.setSdt(loginUser.getUsername());
|
||||
paramsCollectManifestEO.setDreForAuth(loginUser.getUsername());
|
||||
} else if ("guest".equals(userTypes)) {
|
||||
}*/ else if ("guest".equals(userTypes)) {
|
||||
return page;
|
||||
}
|
||||
IPage pageInfo = paramsCollectManifestEOMapper.pageInfo(page, paramsCollectManifestEO); // 查询固定列
|
||||
// IPage pageInfo = paramsCollectManifestEOMapper.pageInfo(page, paramsCollectManifestEO); // 查询固定列
|
||||
IPage pageInfo = page(page, queryWrapper); // 查询固定列
|
||||
List<ParamsCollectManifestEO> list = pageInfo.getRecords(); // 查询固定列
|
||||
List<ParamsConfigEO> paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); // 查询配置列
|
||||
List<String> paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList());
|
||||
@@ -356,6 +370,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
});
|
||||
}
|
||||
|
||||
// 处理负责领域
|
||||
Map<String, Object> dutyTerritoryMap = new HashMap<>();
|
||||
dutyTerritoryMap.put("id", collectManifestEO.getId());
|
||||
dutyTerritoryMap.put("state", collectManifestEO.getState());
|
||||
dutyTerritoryMap.put("dataValue", collectManifestEO.getDutyTerritory());
|
||||
manifestMap.put("dutyTerritory", dutyTerritoryMap);
|
||||
|
||||
// 处理工程接口人
|
||||
Map<String, Object> sdtMap = new HashMap<>();
|
||||
sdtMap.put("id", collectManifestEO.getId());
|
||||
@@ -641,6 +662,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
if ("description".equals(dbFieldName)) {
|
||||
indexOfDescription = i;
|
||||
}
|
||||
if ("duty_territory".equals(dbFieldName)) {
|
||||
map.put("click1", true);
|
||||
}
|
||||
if ("sdt".equals(dbFieldName)) {
|
||||
map.put("click", true);
|
||||
}
|
||||
@@ -911,6 +935,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getLoginUserTypes(ParamsCollectManifestVO paramsCollectManifestVO, String cut) {
|
||||
if (StringUtils.isEmpty(paramsCollectManifestVO.getProjectId()) || StringUtils.isEmpty(paramsCollectManifestVO.getParamsManifestId())) {
|
||||
throw new JeroBootException("参数不能为空!");
|
||||
}
|
||||
|
||||
String projectId = paramsCollectManifestVO.getProjectId();
|
||||
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
|
||||
|
||||
@@ -1055,6 +1083,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
|
||||
LambdaQueryWrapper<ParamsCollectManifestEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ParamsCollectManifestEO::getParamsManifestId, paramsManifestId)
|
||||
.notIn(ParamsCollectManifestEO::getControlType, ControlTypeEnum.Title.getValue())
|
||||
.orderByDesc(ParamsCollectManifestEO::getUpdateTime); // 按修改时间降序
|
||||
List<ParamsCollectManifestEO> list = list(queryWrapper);
|
||||
int collectFinishNumber = (int) list.stream().filter(e->CollectManifestStateEnum.SYNC_REPORT.getValue().equals(e.getState())).count();
|
||||
@@ -1173,6 +1202,37 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
return updateBatchById(updateEOList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO) {
|
||||
if (StringUtils.isEmpty(paramsCollectManifestVO.getIds())
|
||||
|| StringUtils.isEmpty(paramsCollectManifestVO.getParamsManifestId())
|
||||
|| StringUtils.isEmpty(paramsCollectManifestVO.getDutyTerritory())) {
|
||||
throw new JeroBootException("参数不能为空!");
|
||||
}
|
||||
String paramsCollectManifestId = paramsCollectManifestVO.getIds();
|
||||
String dutyTerritory = paramsCollectManifestVO.getDutyTerritory();
|
||||
ParamsManifestEO paramsManifestEO = paramsManifestEOService.getById(paramsCollectManifestVO.getParamsManifestId());
|
||||
String projectId = paramsManifestEO.getProjectId();
|
||||
|
||||
ParamsCollectManifestEO updateEO = new ParamsCollectManifestEO();
|
||||
updateEO.setId(paramsCollectManifestId);
|
||||
updateEO.setDutyTerritory(dutyTerritory);
|
||||
|
||||
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
|
||||
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectId, dutyTerritory);
|
||||
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
|
||||
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
|
||||
if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
|
||||
SysUser sysUser = sysUserService.getById(sdtId);
|
||||
if (ObjectUtil.isNotEmpty(sysUser)) {
|
||||
updateEO.setSdt(sysUser.getUsername()); // 设置工程接口人
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return updateById(updateEO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateSdt(ParamsCollectManifestVO paramsCollectManifestVO) {
|
||||
if (StringUtils.isEmpty(paramsCollectManifestVO.getIds()) || StringUtils.isEmpty(paramsCollectManifestVO.getSdt())) {
|
||||
@@ -1545,8 +1605,27 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
}
|
||||
}
|
||||
|
||||
// 复制认证类别参数
|
||||
List<String> nioNumberList = paramsCollectManifestEOList.stream().map(ParamsCollectManifestEO::getNioNumber).collect(Collectors.toList());
|
||||
// 单独添加 控件类型为标题的参数项
|
||||
if (!isSync) { // 未上报
|
||||
List<ParamsCollectManifestEO> paramsCollectManifestEOListOfTitle = paramsCollectManifestEOMapper.listInfoOfTitle(paramsManifestId);
|
||||
if(CollectionUtil.isNotEmpty(paramsCollectManifestEOListOfTitle)) {
|
||||
for(ParamsCollectManifestEO item : paramsCollectManifestEOListOfTitle) {
|
||||
ParamsReportDetailEO addReportDetailEO = new ParamsReportDetailEO();
|
||||
BeanUtils.copyProperties(item, addReportDetailEO);
|
||||
String reportDetailId = UUID.randomUUID().toString().replace("-","");
|
||||
addReportDetailEO.setId(reportDetailId);
|
||||
addReportDetailEO.setParamsManifestId(reportId);
|
||||
addReportDetailEO.setSyncTime(syncTime);
|
||||
addReportDetailEOList.add(addReportDetailEO);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> nioNumberListOfTitle = paramsCollectManifestEOListOfTitle.stream().map(ParamsCollectManifestEO::getNioNumber).collect(Collectors.toList());
|
||||
nioNumberList.addAll(nioNumberListOfTitle);
|
||||
}
|
||||
|
||||
// 复制认证类别参数
|
||||
List<CertCategoryParamsInfoPublishEO> certCategoryParamsInfoPublishEOS = certCategoryParamsInfoPublishEOService.queryListByVersionAndNio(paramsManifestEO.getParamsTemplateId(), paramsManifestEO.getParamsTemplatePublishVersion(), nioNumberList);
|
||||
for (CertCategoryParamsInfoPublishEO ccpi : certCategoryParamsInfoPublishEOS) {
|
||||
ReportCertCategoryParamsInfoEO addCcpi = new ReportCertCategoryParamsInfoEO();
|
||||
|
||||
+11
-3
@@ -2,11 +2,13 @@ package com.jero.modules.cert.collect.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.cert.collect.entity.*;
|
||||
@@ -27,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
@@ -74,10 +77,15 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage queryList(IPage page, ParamsCollectManifestEO paramsCollectManifestEO, String cut) {
|
||||
String paramsManifestId = paramsCollectManifestEO.getParamsManifestId();
|
||||
public IPage queryList(IPage page, ParamsCollectManifestHistoryEO paramsCollectManifestHistoryEO, String cut, HttpServletRequest req) {
|
||||
QueryWrapper<ParamsCollectManifestHistoryEO> queryWrapper = QueryGenerator.initQueryWrapper(paramsCollectManifestHistoryEO, req.getParameterMap());
|
||||
queryWrapper.lambda().notIn(ParamsCollectManifestHistoryEO::getControlType, ControlTypeEnum.Title.getValue())
|
||||
.orderByAsc(ParamsCollectManifestHistoryEO::getNioNumber);
|
||||
|
||||
IPage pageInfo = paramsCollectManifestHistoryEOMapper.pageInfo(page, paramsCollectManifestEO); // 查询固定列
|
||||
String paramsManifestId = paramsCollectManifestHistoryEO.getParamsManifestId();
|
||||
|
||||
IPage pageInfo = page(page, queryWrapper); // 查询固定列
|
||||
// IPage pageInfo = paramsCollectManifestHistoryEOMapper.pageInfo(page, paramsCollectManifestEO); // 查询固定列
|
||||
List<ParamsCollectManifestHistoryEO> list = pageInfo.getRecords(); // 查询固定列
|
||||
List<ParamsConfigHistoryEO> paramsConfigEOList = paramsConfigHistoryEOService.queryList(paramsManifestId); // 查询配置列
|
||||
List<String> paramsConfigIdList = paramsConfigEOList.stream().map(ParamsConfigEO::getId).collect(Collectors.toList());
|
||||
|
||||
+11
-8
@@ -23,6 +23,7 @@ import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO;
|
||||
import com.jero.modules.cert.report.service.IParamsReportEOService;
|
||||
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
|
||||
import com.jero.modules.cert.template.entity.ParamsTemplateEO;
|
||||
import com.jero.modules.cert.template.enums.ControlTypeEnum;
|
||||
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
|
||||
import com.jero.modules.cert.template.service.IParamsTemplateEOService;
|
||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||
@@ -126,14 +127,16 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
|
||||
target.setChangeFlag(CollectManifestChangeFlagEnum.CHANGE_BEFORE.getValue()); // 设置变更标识
|
||||
|
||||
|
||||
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
|
||||
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectId(), source.getDutyTerritory());
|
||||
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
|
||||
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
|
||||
if (StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
|
||||
SysUser sysUser = sysUserService.getById(sdtId);
|
||||
if (ObjectUtil.isNotEmpty(sysUser)) {
|
||||
target.setSdt(sysUser.getUsername());
|
||||
if (!ControlTypeEnum.Title.getValue().equals(source.getControlType())) {
|
||||
// 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段
|
||||
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsManifestEO.getProjectId(), source.getDutyTerritory());
|
||||
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
|
||||
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
|
||||
if (StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段
|
||||
SysUser sysUser = sysUserService.getById(sdtId);
|
||||
if (ObjectUtil.isNotEmpty(sysUser)) {
|
||||
target.setSdt(sysUser.getUsername());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -27,6 +27,7 @@
|
||||
<result column="deadline" property="deadline" />
|
||||
<result column="params_manifest_id" property="paramsManifestId" />
|
||||
<result column="sync_time" property="syncTime" />
|
||||
<result column="title_default_value" property="titleDefaultValue" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="BaseQuerySql">
|
||||
@@ -104,6 +105,7 @@
|
||||
prd.nio_number as nio_number,
|
||||
prd.params_name as params_name,
|
||||
prd.control_type as control_type,
|
||||
prd.title_default_value as title_default_value,
|
||||
rccpi.params_number as cert_number,
|
||||
rccpi.params_name as cert_params_name
|
||||
from params_report_detail prd
|
||||
|
||||
+70
-49
@@ -411,6 +411,17 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
}
|
||||
paramsConfigDataVOList.add(fileConfigDataVO);
|
||||
|
||||
} else if (ControlTypeEnum.Title.getValue().equals(controlType)) {
|
||||
|
||||
ParamsConfigDataVO configDataVO = new ParamsConfigDataVO();
|
||||
configDataVO.setType(ConfigDataTypeEnum.TEXT.getValue());
|
||||
configDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
|
||||
configDataVO.setIsLock(paramsConfigEO.getIsLock());
|
||||
if (StringUtils.isNotEmpty(paramsCollectManifestEO.getTitleDefaultValue())) {
|
||||
configDataVO.setDataValue(paramsCollectManifestEO.getTitleDefaultValue());
|
||||
}
|
||||
paramsConfigDataVOList.add(configDataVO);
|
||||
|
||||
}
|
||||
return paramsConfigDataVOList;
|
||||
}
|
||||
@@ -824,6 +835,8 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
for (Map<String, Object> record1 : dataList) {
|
||||
|
||||
String paramsCollectManifestId = (String) record1.get("id");
|
||||
String controlType = (String) record1.get("control_type");
|
||||
String titleDefaultValue = (String) record1.get("title_default_value");
|
||||
|
||||
if (CollectionUtil.isNotEmpty(paramsConfigEOList)) {
|
||||
List<OSSFile> fileList = new ArrayList<>();
|
||||
@@ -832,70 +845,78 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
paramsConfigEOList = paramsConfigEOList.stream().filter(e->configIdList.contains(e.getId())).collect(Collectors.toList()); // 过滤出要导出的配置列
|
||||
paramsConfigEOList.forEach(paramsConfigEO -> { // 参数配置
|
||||
|
||||
String paramsConfigId = paramsConfigEO.getId();
|
||||
ParamsReportConfigDataEO paramsConfigDataEO = paramsReportConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId); // 参数配置数据
|
||||
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
|
||||
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
|
||||
configDataBuilder.append(paramsConfigDataEO.getTextData()).append("&");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
|
||||
configDataBuilder.append(paramsConfigDataEO.getPullData()).append("&");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
|
||||
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
|
||||
if (CollectionUtil.isNotEmpty(ossFileList)) {
|
||||
configDataBuilder.append(ossFileList.get(0).getFileName()).append("&");
|
||||
|
||||
fileList.addAll(ossFileList);
|
||||
if (ControlTypeEnum.Title.getValue().equals(controlType)) {
|
||||
record1.put(paramsConfigEO.getId(), titleDefaultValue);
|
||||
} else {
|
||||
String paramsConfigId = paramsConfigEO.getId();
|
||||
ParamsReportConfigDataEO paramsConfigDataEO = paramsReportConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigId, paramsCollectManifestId); // 参数配置数据
|
||||
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
|
||||
if (StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
|
||||
configDataBuilder.append(paramsConfigDataEO.getTextData()).append("&");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
|
||||
configDataBuilder.append(paramsConfigDataEO.getPullData()).append("&");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
|
||||
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsConfigDataEO.getFileConnectId());
|
||||
if (CollectionUtil.isNotEmpty(ossFileList)) {
|
||||
configDataBuilder.append(ossFileList.get(0).getFileName()).append("&");
|
||||
|
||||
String configData = configDataBuilder.toString();
|
||||
if (configData.contains("&")) {
|
||||
configData = configData.substring(0, configData.lastIndexOf("&"));
|
||||
}
|
||||
fileList.addAll(ossFileList);
|
||||
}
|
||||
}
|
||||
|
||||
record1.put(paramsConfigEO.getId(), configData);
|
||||
String configData = configDataBuilder.toString();
|
||||
if (configData.contains("&")) {
|
||||
configData = configData.substring(0, configData.lastIndexOf("&"));
|
||||
}
|
||||
|
||||
record1.put(paramsConfigEO.getId(), configData);
|
||||
}
|
||||
});
|
||||
|
||||
} else if ("2".equals(paramsReportDetailVO.getCombineFlag())) { // 合并
|
||||
String configData = "";
|
||||
List<ParamsReportConfigDataEO> paramsReportConfigDataEOS = paramsReportConfigDataEOService.queryByConfigIdListAndCollectManifestId(configIdList, paramsCollectManifestId);
|
||||
if (ControlTypeEnum.Title.getValue().equals(controlType)) {
|
||||
record1.put("params_value", titleDefaultValue);
|
||||
} else {
|
||||
List<ParamsReportConfigDataEO> paramsReportConfigDataEOS = paramsReportConfigDataEOService.queryByConfigIdListAndCollectManifestId(configIdList, paramsCollectManifestId);
|
||||
|
||||
String textDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getTextData()))
|
||||
.map(ParamsReportConfigDataEO::getTextData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
|
||||
String textDatas = paramsReportConfigDataEOS.stream().filter(e -> StringUtils.isNotEmpty(e.getTextData()))
|
||||
.map(ParamsReportConfigDataEO::getTextData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
|
||||
|
||||
String pullDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getPullData()))
|
||||
.map(ParamsReportConfigDataEO::getPullData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
|
||||
String pullDatas = paramsReportConfigDataEOS.stream().filter(e -> StringUtils.isNotEmpty(e.getPullData()))
|
||||
.map(ParamsReportConfigDataEO::getPullData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
|
||||
|
||||
List<String> fileNameList = new ArrayList<>();
|
||||
paramsReportConfigDataEOS.forEach(paramsReportConfigDataEO -> {
|
||||
if (StringUtils.isNotEmpty(paramsReportConfigDataEO.getFileConnectId())) {
|
||||
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsReportConfigDataEO.getFileConnectId());
|
||||
if (CollectionUtil.isNotEmpty(ossFileList)) {
|
||||
fileNameList.add(ossFileList.get(0).getFileName());
|
||||
List<String> fileNameList = new ArrayList<>();
|
||||
paramsReportConfigDataEOS.forEach(paramsReportConfigDataEO -> {
|
||||
if (StringUtils.isNotEmpty(paramsReportConfigDataEO.getFileConnectId())) {
|
||||
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsReportConfigDataEO.getFileConnectId());
|
||||
if (CollectionUtil.isNotEmpty(ossFileList)) {
|
||||
fileNameList.add(ossFileList.get(0).getFileName());
|
||||
|
||||
fileList.addAll(ossFileList);
|
||||
fileList.addAll(ossFileList);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
|
||||
if (StringUtils.isNotEmpty(textDatas)) {
|
||||
configDataBuilder.append(textDatas).append("&");
|
||||
}
|
||||
});
|
||||
if (StringUtils.isNotEmpty(pullDatas)) {
|
||||
configDataBuilder.append(pullDatas).append("&");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(fileNameList)) {
|
||||
configDataBuilder.append(StringUtils.join(fileNameList, paramsReportDetailVO.getSeparator())).append("&");
|
||||
}
|
||||
configData = configDataBuilder.toString();
|
||||
if (configData.contains("&")) {
|
||||
configData = configData.substring(0, configData.lastIndexOf("&"));
|
||||
}
|
||||
record1.put("params_value", configData);
|
||||
|
||||
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
|
||||
if (StringUtils.isNotEmpty(textDatas)) {
|
||||
configDataBuilder.append(textDatas).append("&");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pullDatas)) {
|
||||
configDataBuilder.append(pullDatas).append("&");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(fileNameList)) {
|
||||
configDataBuilder.append(StringUtils.join(fileNameList, ",")).append("&");
|
||||
}
|
||||
configData = configDataBuilder.toString();
|
||||
if (configData.contains("&")) {
|
||||
configData = configData.substring(0, configData.lastIndexOf("&"));
|
||||
}
|
||||
record1.put("params_value", configData);
|
||||
|
||||
}
|
||||
record1.put("fileList", fileList);
|
||||
}
|
||||
|
||||
+7
-2
@@ -106,7 +106,7 @@ public class ParamsInfoEO implements Serializable {
|
||||
private String certCategory;
|
||||
|
||||
/**控件类型*/
|
||||
@Excel(name = "*控件类型", width = 15, replace = {"文本_1","下拉单选_2","下拉多选_3","附件_4","文本+下拉单选_5","文本+下拉多选_6","文本+附件_7","下拉单选+附件_8","下拉多选+附件_9","文本+下拉单选+附件_10"})
|
||||
@Excel(name = "*控件类型", width = 15, replace = {"文本_1","下拉单选_2","下拉多选_3","附件_4","文本+下拉单选_5","文本+下拉多选_6","文本+附件_7","下拉单选+附件_8","下拉多选+附件_9","文本+下拉单选+附件_10","标题_11"})
|
||||
@ApiModelProperty(value = "控件类型")
|
||||
private String controlType;
|
||||
|
||||
@@ -120,7 +120,12 @@ public class ParamsInfoEO implements Serializable {
|
||||
@ApiModelProperty(value = "控件备选值")
|
||||
private String controlValues;
|
||||
|
||||
/**附件模板*/
|
||||
/**标题默认值*/
|
||||
@Excel(name = "默认值", width = 15)
|
||||
@ApiModelProperty(value = "标题默认值")
|
||||
private String titleDefaultValue;
|
||||
|
||||
/**附件模板*/
|
||||
@ApiModelProperty(value = "附件模板")
|
||||
private String fileTemplateConnectId;
|
||||
|
||||
|
||||
+2
-1
@@ -20,7 +20,8 @@ public enum ControlTypeEnum {
|
||||
TEXT_FILE("文本+附件","Text+File","7"),
|
||||
PULL_SINGLE_FILE("下拉单选+附件","Pull single+File","8"),
|
||||
PULL_MORE_FILE("下拉多选+附件","Pull more+File","9"),
|
||||
TEXT_PULL_SINGLE_FILE("文本+下拉单选+附件","Text+Pull single+File","10");
|
||||
TEXT_PULL_SINGLE_FILE("文本+下拉单选+附件","Text+Pull single+File","10"),
|
||||
Title("标题","Title","11");
|
||||
|
||||
String name;
|
||||
String enName;
|
||||
|
||||
+4
@@ -21,6 +21,7 @@
|
||||
<result column="control_verify" property="controlVerify" />
|
||||
<result column="file_template_connect_id" property="fileTemplateConnectId" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="title_default_value" property="titleDefaultValue" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ParamsInfoEOResultMapWithCert" type="com.jero.modules.cert.template.entity.ParamsInfoEO">
|
||||
@@ -43,6 +44,7 @@
|
||||
<result column="control_verify" property="controlVerify" />
|
||||
<result column="file_template_connect_id" property="fileTemplateConnectId" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="title_default_value" property="titleDefaultValue" />
|
||||
<collection property="certCategoryParamsInfoEOList" javaType="java.util.List" ofType="com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO">
|
||||
<id column="ccpi_id" property="id" />
|
||||
<result column="ccpi_params_number" property="paramsNumber" />
|
||||
@@ -74,6 +76,7 @@
|
||||
<result column="control_verify" property="controlVerify" />
|
||||
<result column="file_template_connect_id" property="fileTemplateConnectId" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="title_default_value" property="titleDefaultValue" />
|
||||
<collection property="certCategoryParamsInfoEnExportList" javaType="java.util.List" ofType="com.jero.modules.cert.template.vo.CertCategoryParamsInfoEnExport">
|
||||
<id column="ccpi_id" property="id" />
|
||||
<result column="ccpi_params_number" property="paramsNumber" />
|
||||
@@ -105,6 +108,7 @@
|
||||
pi.control_verify as control_verify,
|
||||
pi.file_template_connect_id as file_template_connect_id,
|
||||
pi.params_template_id as params_template_id,
|
||||
pi.title_default_value as title_default_value,
|
||||
ccpi.id as ccpi_id,
|
||||
ccpi.params_number as ccpi_params_number,
|
||||
ccpi.params_name as ccpi_params_name,
|
||||
|
||||
+1
@@ -22,6 +22,7 @@
|
||||
<result column="file_template_connect_id" property="fileTemplateConnectId" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="version" property="version" />
|
||||
<result column="title_default_value" property="titleDefaultValue" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getNewestVersion" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
|
||||
+54
-22
@@ -840,7 +840,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if (numSheet == 0) { // 企业参数表
|
||||
if (CutEnum.EN.getValue().equals(cut)) {
|
||||
String fields[] ={ "*NIO Number", "*Is Must", "*Params Name","*Params Batch","*Duty Territory",
|
||||
"Description", "*Control Type", "Control Verify", "Control Values", "File Template"};
|
||||
"Description", "*Control Type", "Control Verify", "Control Values", "Default Value", "File Template"};
|
||||
params.setImportFields(fields);
|
||||
|
||||
ExcelImportResult<ParamsInfoEnImport> resultEn = ExcelImportUtil.importExcelMore(excelfile,ParamsInfoEnImport.class, params);
|
||||
@@ -848,7 +848,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
copyParamsInfoList(paramsInfoEOListEn, paramsInfoEOList);
|
||||
} else {
|
||||
String fields[] ={ "*NIO编号", "*是否必填", "*参数名称","*参数批次","*责任领域",
|
||||
"参数说明", "*控件类型", "控件校验", "控件备选值", "附件模板"};
|
||||
"参数说明", "*控件类型", "控件校验", "控件备选值", "默认值", "附件模板"};
|
||||
params.setImportFields(fields);
|
||||
|
||||
ExcelImportResult<ParamsInfoCnImport> result = ExcelImportUtil.importExcelMore(excelfile, ParamsInfoCnImport.class, params);
|
||||
@@ -1255,6 +1255,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Control Values", IsMustEnum.YES.getValue(), "500", false, cut);
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Control Values", IsMustEnum.NO.getValue(), "500", false, cut);
|
||||
dto.setControlValues(null);
|
||||
}
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
@@ -1267,51 +1268,81 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|| ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Control Verify", IsMustEnum.YES.getValue(), "50", false, cut);
|
||||
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Control Verify", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
controlVerify = (String)resultMap.get("value");
|
||||
dto.setControlVerify(controlVerify);
|
||||
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlVerify, "控件校验", "Control Verify", IsMustEnum.NO.getValue(), "50", false, cut);
|
||||
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Control Verify", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
|
||||
dto.setControlVerify(null);
|
||||
}
|
||||
|
||||
|
||||
// 标题默认值
|
||||
String titleDefaultValue = dto.getTitleDefaultValue();
|
||||
if (ControlTypeEnum.Title.getValue().equals(controlType)) {
|
||||
resultMap = validateMustAndLength(titleDefaultValue,"默认值", "Default Value", IsMustEnum.YES.getValue(),"100",false, cut);
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlVerify, "默认值", "Default Value", IsMustEnum.NO.getValue(), "100", false, cut);
|
||||
dto.setTitleDefaultValue(null);
|
||||
}
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
resultMap = getCodeByName(controlVerify,"控件校验", "Control Verify", "enum",controlVerifyEnumMap,null,null,cut);
|
||||
errorMsg += (String)resultMap.get("errorMsg");
|
||||
countError += (int)resultMap.get("countError");
|
||||
controlVerify = (String)resultMap.get("value");
|
||||
dto.setControlVerify(controlVerify);
|
||||
|
||||
// 附件模板
|
||||
String fileTemplateName = dto.getFileTemplateName();
|
||||
if (StringUtils.isNotBlank(fileTemplateName)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
fileTemplateName = fileTemplateName.replace(",",",");
|
||||
fileTemplateName = fileTemplateName.replace(",", ",");
|
||||
if (fileTemplateName.contains(",")) {
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "附件模板只能上传一个文件;";
|
||||
} else {
|
||||
errorMsg += "File template only can upload one;";
|
||||
}
|
||||
}
|
||||
for (String fileName : fileTemplateName.split(",")) {
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName,null,null,null,null,null);
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName, null, null, null, null, null);
|
||||
// List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName);
|
||||
if (nowFileList.size() == 0) {
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "附件模板压缩包中没有" + fileName + "文件; ";
|
||||
} else {
|
||||
errorMsg += "File template " + fileName + "isn't present in the cabinet;";
|
||||
}
|
||||
countError++;
|
||||
} else {
|
||||
try {
|
||||
FileInputStream input = new FileInputStream(nowFileList.get(0));
|
||||
MultipartFile multipartFile =
|
||||
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
|
||||
//文件存入文件表
|
||||
OSSFile ossFile = ossFileService.uploadLocalOfCos(multipartFile, "", null,null);
|
||||
if (ObjectUtils.isNotEmpty(ossFile)) {
|
||||
sb.append(ossFile.getId() + ",");
|
||||
if (ControlTypeEnum.FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.PULL_MORE_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.PULL_SINGLE_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_FILE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
try {
|
||||
FileInputStream input = new FileInputStream(nowFileList.get(0));
|
||||
MultipartFile multipartFile =
|
||||
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
|
||||
//文件存入文件表
|
||||
OSSFile ossFile = ossFileService.uploadLocalOfCos(multipartFile, "", null, null);
|
||||
if (ObjectUtils.isNotEmpty(ossFile)) {
|
||||
sb.append(ossFile.getId() + ",");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} else {
|
||||
dto.setFileTemplateName(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1321,6 +1352,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
dto.setFileTemplateName(fileTemplateId);
|
||||
}
|
||||
}
|
||||
|
||||
if (countError > 0) {
|
||||
stringMessage.add(errorMsg);
|
||||
}
|
||||
@@ -1513,7 +1545,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldNameCn + "不能超过" + dbLength + "个字符;";
|
||||
} else {
|
||||
errorMsg += fieldNameEn + " can not be more than" + dbLength + "char;";
|
||||
errorMsg += fieldNameEn + " can not be more than " + dbLength + " char;";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
|
||||
+5
@@ -67,6 +67,11 @@ public class ParamsInfoCnImport {
|
||||
@ApiModelProperty(value = "控件备选值")
|
||||
private String controlValues;
|
||||
|
||||
/**标题默认值*/
|
||||
@Excel(name = "默认值", width = 15)
|
||||
@ApiModelProperty(value = "标题默认值")
|
||||
private String titleDefaultValue;
|
||||
|
||||
/**附件模板*/
|
||||
@ApiModelProperty(value = "附件模板")
|
||||
private String fileTemplateConnectId;
|
||||
|
||||
+6
-1
@@ -89,7 +89,7 @@ public class ParamsInfoEnExport {
|
||||
private String certCategory;
|
||||
|
||||
/**控件类型*/
|
||||
@Excel(name = "*Control Type", width = 15, replace = {"Text_1","Pull single_2","Pull more_3","File_4","Text+Pull single_5","Text+Pull more_6","Text+File_7","Pull single+File_8","Pull more+File_9","Text+Pull single+File_10"})
|
||||
@Excel(name = "*Control Type", width = 15, replace = {"Text_1","Pull single_2","Pull more_3","File_4","Text+Pull single_5","Text+Pull more_6","Text+File_7","Pull single+File_8","Pull more+File_9","Text+Pull single+File_10","Title_11"})
|
||||
@ApiModelProperty(value = "控件类型")
|
||||
private String controlType;
|
||||
|
||||
@@ -103,6 +103,11 @@ public class ParamsInfoEnExport {
|
||||
@ApiModelProperty(value = "控件备选值")
|
||||
private String controlValues;
|
||||
|
||||
/**标题默认值*/
|
||||
@Excel(name = "Default Value", width = 15)
|
||||
@ApiModelProperty(value = "标题默认值")
|
||||
private String titleDefaultValue;
|
||||
|
||||
/**附件模板*/
|
||||
@ApiModelProperty(value = "附件模板")
|
||||
private String fileTemplateConnectId;
|
||||
|
||||
+5
@@ -67,6 +67,11 @@ public class ParamsInfoEnImport {
|
||||
@ApiModelProperty(value = "控件备选值")
|
||||
private String controlValues;
|
||||
|
||||
/**标题默认值*/
|
||||
@Excel(name = "Default Value", width = 15)
|
||||
@ApiModelProperty(value = "标题默认值")
|
||||
private String titleDefaultValue;
|
||||
|
||||
/**附件模板*/
|
||||
@ApiModelProperty(value = "附件模板")
|
||||
private String fileTemplateConnectId;
|
||||
|
||||
+7
-2
@@ -11,10 +11,12 @@ import com.jero.modules.lawsOpinionGather.enums.LawsOpinionGatherNodeEnum;
|
||||
import com.jero.modules.lawsOpinionGather.enums.OperatorRoleCodeEnum;
|
||||
import com.jero.modules.lawsOpinionGather.mapper.LawsProcessHistoryEOMapper;
|
||||
import com.jero.modules.lawsOpinionGather.service.ILawsProcessHistoryEOService;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.job.LawsTechnologyEvaluationNodeEnum;
|
||||
import com.jero.modules.project.enums.OperatorTypeEnum;
|
||||
import com.jero.modules.project.enums.RequestSourceEnum;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -120,9 +122,12 @@ public class LawsProcessHistoryEOServiceImpl extends ServiceImpl<LawsProcessHist
|
||||
if(StringUtils.isNotEmpty(data.getOperatorRoleCode())){
|
||||
data.setOperatorRoleName(OperatorRoleCodeEnum.getTextByValue(data.getOperatorRoleCode(),cut));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(data.getTaskDefinitionKey())){
|
||||
data.setTaskDefinitionKeyName(LawsOpinionGatherNodeEnum.getTextByValue(data.getTaskDefinitionKey(),cut));
|
||||
if(StringUtils.equals(data.getFlowType(), FlowTypeEnum.FGYJSJLC.getValue())){
|
||||
data.setTaskDefinitionKeyName(LawsOpinionGatherNodeEnum.getTextByValue(data.getTaskDefinitionKey(),cut));
|
||||
}else if(StringUtils.equals(data.getFlowType(),FlowTypeEnum.FGJSPG.getValue())){
|
||||
data.setTaskDefinitionKeyName(LawsTechnologyEvaluationNodeEnum.getTextByValue(data.getTaskDefinitionKey(),cut));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+21
-3
@@ -2,11 +2,13 @@ package com.jero.modules.lawsTechnologyEvaluation.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationComplianceResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationComplianceResultEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -35,7 +37,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
public class LawsTechnologyEvaluationComplianceResultEOController extends JeroController<LawsTechnologyEvaluationComplianceResultEO, ILawsTechnologyEvaluationComplianceResultEOService> {
|
||||
@Autowired
|
||||
private ILawsTechnologyEvaluationComplianceResultEOService lawsTechnologyEvaluationComplianceResultEOService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@@ -66,8 +68,10 @@ public class LawsTechnologyEvaluationComplianceResultEOController extends JeroCo
|
||||
@AutoLog(value = "法规技术评估-评估人反馈-符合性结果表-列表查询")
|
||||
@ApiOperation(value="法规技术评估-评估人反馈-符合性结果表-列表查询", notes="法规技术评估-评估人反馈-符合性结果表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsTechnologyEvaluationComplianceResultEO>> queryList() {
|
||||
List<LawsTechnologyEvaluationComplianceResultEO> list = lawsTechnologyEvaluationComplianceResultEOService.queryList();
|
||||
public Result<List<LawsTechnologyEvaluationComplianceResultEO>> queryList(LawsTechnologyEvaluationComplianceResultEO lawsTechnologyEvaluationComplianceResultEO,
|
||||
HttpServletRequest req,
|
||||
@RequestParam(name="cut", defaultValue="cn") String cut) {
|
||||
List<LawsTechnologyEvaluationComplianceResultEO> list = lawsTechnologyEvaluationComplianceResultEOService.queryList(lawsTechnologyEvaluationComplianceResultEO,req,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -155,6 +159,20 @@ public class LawsTechnologyEvaluationComplianceResultEOController extends JeroCo
|
||||
return super.exportXls(request, lawsTechnologyEvaluationComplianceResultEO, LawsTechnologyEvaluationComplianceResultEO.class, "法规技术评估-评估人反馈-符合性结果表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出zip压缩包,带文件。
|
||||
* @param response
|
||||
* @param request
|
||||
* @param lawsTechnologyEvaluationComplianceResultEO
|
||||
* @param params
|
||||
*/
|
||||
@RequestMapping(value = "/exportZip")
|
||||
public void exportZip(HttpServletResponse response,HttpServletRequest request,
|
||||
LawsTechnologyEvaluationComplianceResultEO lawsTechnologyEvaluationComplianceResultEO,
|
||||
@RequestParam Map<String,Object> params) {
|
||||
this.lawsTechnologyEvaluationComplianceResultEOService.exportZip(response,request, lawsTechnologyEvaluationComplianceResultEO,params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
|
||||
+27
@@ -2,6 +2,7 @@ package com.jero.modules.lawsTechnologyEvaluation.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -15,9 +16,11 @@ 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.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -183,4 +186,28 @@ public class LawsTechnologyEvaluationEOController extends JeroController<LawsTec
|
||||
return this.lawsTechnologyEvaluationEOService.processCall(jsonObject);
|
||||
}
|
||||
|
||||
@ApiOperation(value="法规意见收集表中添加选择条款调用文档库数据--分页", notes="法规意见收集表中选择条款调用文档库数据--分页")
|
||||
@PostMapping(value = "/queryPageDummy")
|
||||
@ResponseBody
|
||||
public net.sf.json.JSONObject queryPageDummy(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = this.lawsTechnologyEvaluationEOService.getPageDummy(parameter);
|
||||
Result<IPage> ok = Result.OK(infoPage);
|
||||
net.sf.json.JSONObject jsonResult = net.sf.json.JSONObject.fromObject(ok);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
@AutoLog(value = "条款导入模板下载")
|
||||
@ApiOperation(value = "条款导入模板下载")
|
||||
@GetMapping(value = "/exportItemTemplate")
|
||||
public void exportItemTemplate(@RequestParam(name = "cut") String cut, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
this.lawsTechnologyEvaluationEOService.exportItemTemplate(cut,response,request);
|
||||
}
|
||||
|
||||
@AutoLog(value = "条款导入")
|
||||
@ApiOperation(value = "条款导入")
|
||||
@PostMapping(value = "/importItemExcel")
|
||||
public Result<?> importItemExcel(MultipartFile file, @RequestParam(name = "cut") String cut, HttpServletRequest request) throws Exception {
|
||||
List<Map<String,Object>> result = this.lawsTechnologyEvaluationEOService.importItemExcel(file,cut,request);
|
||||
return Result.OK(result);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -53,10 +53,12 @@ public class LawsTechnologyEvaluationFlowDetailEOController extends JeroControll
|
||||
public Result<?> queryPageList(LawsTechnologyEvaluationFlowDetailEO lawsTechnologyEvaluationFlowDetailEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name="cut", defaultValue="cn") String cut,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsTechnologyEvaluationFlowDetailEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationFlowDetailEO, req.getParameterMap());
|
||||
Page<LawsTechnologyEvaluationFlowDetailEO> page = new Page<LawsTechnologyEvaluationFlowDetailEO>(pageNo, pageSize);
|
||||
IPage<LawsTechnologyEvaluationFlowDetailEO> pageList = lawsTechnologyEvaluationFlowDetailEOService.page(page, queryWrapper);
|
||||
this.lawsTechnologyEvaluationFlowDetailEOService.disposeData(pageList.getRecords(),cut);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
+20
-2
@@ -2,6 +2,7 @@ package com.jero.modules.lawsTechnologyEvaluation.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -68,8 +69,11 @@ public class LawsTechnologyEvaluationItemResultEOController extends JeroControll
|
||||
@AutoLog(value = "法规技术评估-条款信息评估结果表-列表查询")
|
||||
@ApiOperation(value="法规技术评估-条款信息评估结果表-列表查询", notes="法规技术评估-条款信息评估结果表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsTechnologyEvaluationItemResultEO>> queryList() {
|
||||
List<LawsTechnologyEvaluationItemResultEO> list = lawsTechnologyEvaluationItemResultEOService.queryList();
|
||||
public Result<List<LawsTechnologyEvaluationItemResultEO>> queryList(LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO,
|
||||
HttpServletRequest req,
|
||||
String cut) {
|
||||
List<LawsTechnologyEvaluationItemResultEO> list = lawsTechnologyEvaluationItemResultEOService.queryList(lawsTechnologyEvaluationItemResultEO,req,cut);
|
||||
this.lawsTechnologyEvaluationItemResultEOService.disposeData(list,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -157,6 +161,20 @@ public class LawsTechnologyEvaluationItemResultEOController extends JeroControll
|
||||
return super.exportXls(request, lawsTechnologyEvaluationItemResultEO, LawsTechnologyEvaluationItemResultEO.class, "法规技术评估-条款信息评估结果表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出zip压缩包,带文件。
|
||||
* @param response
|
||||
* @param request
|
||||
* @param lawsTechnologyEvaluationItemResultEO
|
||||
* @param params
|
||||
*/
|
||||
@RequestMapping(value = "/exportZip")
|
||||
public void exportZip(HttpServletResponse response,HttpServletRequest request,
|
||||
LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO,
|
||||
@RequestParam Map<String,Object> params) {
|
||||
this.lawsTechnologyEvaluationItemResultEOService.exportZip(response,request, lawsTechnologyEvaluationItemResultEO,params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
|
||||
+18
-2
@@ -68,8 +68,9 @@ public class LawsTechnologyEvaluationResultEOController extends JeroController<L
|
||||
@AutoLog(value = "法规技术评估-评估结果表-列表查询")
|
||||
@ApiOperation(value="法规技术评估-评估结果表-列表查询", notes="法规技术评估-评估结果表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<LawsTechnologyEvaluationResultEO>> queryList() {
|
||||
List<LawsTechnologyEvaluationResultEO> list = lawsTechnologyEvaluationResultEOService.queryList();
|
||||
public Result<List<LawsTechnologyEvaluationResultEO>> queryList(LawsTechnologyEvaluationResultEO lawsTechnologyEvaluationResultEO,
|
||||
HttpServletRequest req) {
|
||||
List<LawsTechnologyEvaluationResultEO> list = lawsTechnologyEvaluationResultEOService.queryList(lawsTechnologyEvaluationResultEO,req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -183,4 +184,19 @@ public class LawsTechnologyEvaluationResultEOController extends JeroController<L
|
||||
lawsTechnologyEvaluationResultEOService.evaluatorSaveResult(json);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据流程实例id、法规技术评估id 查询评估结果与符合性结果接口
|
||||
* @param lawsTechnologyEvaluationResultEO
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "法规技术评估流程-查询评估结果与符合性结果接口")
|
||||
@ApiOperation(value="法规技术评估流程-查询评估结果与符合性结果接口", notes="法规技术评估流程-查询评估结果与符合性结果接口")
|
||||
@GetMapping(value = "/queryEvaluationResultAndComplianceResult")
|
||||
public Result<?> queryEvaluationResultAndComplianceResult(LawsTechnologyEvaluationResultEO lawsTechnologyEvaluationResultEO,
|
||||
HttpServletRequest req) {
|
||||
JSONObject json = lawsTechnologyEvaluationResultEOService.queryEvaluationResultAndComplianceResult(lawsTechnologyEvaluationResultEO,req);
|
||||
return Result.OK(json);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-4
@@ -1,21 +1,19 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,6 +34,8 @@ public class LawsTechnologyEvaluationComplianceResultEO implements Serializable
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String ids;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
@@ -70,10 +70,14 @@ public class LawsTechnologyEvaluationComplianceResultEO implements Serializable
|
||||
@Excel(name = "符合性结果", width = 15)
|
||||
@ApiModelProperty(value = "符合性结果")
|
||||
private java.lang.String complianceResult;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String complianceResultName;
|
||||
|
||||
/**流程实例id*/
|
||||
@Excel(name = "流程实例id", width = 15)
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
private java.lang.String actiProcInstId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<LawsTechnologyEvaluationResultEO> lawsTechnologyEvaluationResultEOList;
|
||||
}
|
||||
|
||||
+4
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -86,4 +87,7 @@ public class LawsTechnologyEvaluationFlowDetailEO implements Serializable {
|
||||
@ApiModelProperty(value = "评估人id")
|
||||
private java.lang.String evaluatorId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String evaluatorName;
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -85,6 +86,8 @@ public class LawsTechnologyEvaluationItemResultEO implements Serializable {
|
||||
@Excel(name = "评估方式", width = 15)
|
||||
@ApiModelProperty(value = "评估方式")
|
||||
private java.lang.String evaluationMethods;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String evaluationMethodsName;
|
||||
|
||||
/**技术文件名称*/
|
||||
@Excel(name = "技术文件名称", width = 15)
|
||||
@@ -105,11 +108,15 @@ public class LawsTechnologyEvaluationItemResultEO implements Serializable {
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
private java.lang.String accessoryFile;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String accessoryFileName;
|
||||
|
||||
/**符合性结果*/
|
||||
@Excel(name = "符合性结果", width = 15)
|
||||
@ApiModelProperty(value = "符合性结果")
|
||||
private java.lang.String complianceResult;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String complianceResultName;
|
||||
|
||||
/**评估人id*/
|
||||
@Excel(name = "评估人id", width = 15)
|
||||
|
||||
+6
-5
@@ -1,22 +1,18 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估-评估结果表
|
||||
@@ -85,6 +81,8 @@ public class LawsTechnologyEvaluationResultEO implements Serializable {
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
private java.lang.String accessoryFile;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String accessoryFileName;
|
||||
|
||||
/**提出时间*/
|
||||
@Excel(name = "提出时间", width = 15, format = "yyyy-MM-dd")
|
||||
@@ -98,4 +96,7 @@ public class LawsTechnologyEvaluationResultEO implements Serializable {
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
private java.lang.String actiProcInstId;
|
||||
|
||||
@ApiModelProperty(value = "符合性结果id")
|
||||
private java.lang.String complianceResultId;
|
||||
|
||||
}
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.enums;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
|
||||
/**
|
||||
* 符合性结果枚举类
|
||||
*/
|
||||
public enum ComplianceResultEnum {
|
||||
CONFORMITY("符合","Compliance","Compliance"),
|
||||
INCONFORMITY("不符合","Non-Compliance","Non-Compliance"),
|
||||
;
|
||||
|
||||
String name;
|
||||
String enName;
|
||||
String value;
|
||||
|
||||
private ComplianceResultEnum(String name,String enName, String value) {
|
||||
this.name = name;
|
||||
this.enName = enName;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value, String cut) {
|
||||
ComplianceResultEnum[] values = values();
|
||||
for (ComplianceResultEnum complianceResultEnum : values) {
|
||||
if (complianceResultEnum.value.equals(value)) {
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
return complianceResultEnum.name;
|
||||
}else {
|
||||
return complianceResultEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationFlowDetailEOService;
|
||||
import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.jeecg.modules.jmreport.common.constant.CommonConstant;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 法规技术评估 - 定时器
|
||||
* 作用:当前日期大于等于截止日志的时候,把该数据的流程状态,更新为已完成,同时把当前这条数据的所有待办任务提交
|
||||
*/
|
||||
@Slf4j
|
||||
public class LawsTechnologyEvaluationJob implements Job {
|
||||
|
||||
@Autowired
|
||||
private ILawsTechnologyEvaluationEOService lawsTechnologyEvaluationEOService;
|
||||
@Autowired
|
||||
private ILawsTechnologyEvaluationFlowDetailEOService lawsTechnologyEvaluationFlowDetailEOService;
|
||||
@Autowired
|
||||
private WorkFlowFeignClient workFlowFeignClient;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("法规技术评估流程,定时任务开启 =====================================================");
|
||||
|
||||
QueryWrapper<LawsTechnologyEvaluationEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getFlowStatus, GatherResultEnum.UNDERWAY.getValue());
|
||||
List<LawsTechnologyEvaluationEO> lawsTechnologyEvaluationEOList = this.lawsTechnologyEvaluationEOService.list(queryWrapper);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(lawsTechnologyEvaluationEOList)) {
|
||||
Date currentDate = new Date();
|
||||
//过滤截止日期小于当前日期的法规技术评估数据
|
||||
List<LawsTechnologyEvaluationEO> updateLawsTechnologyEvaluationEOList = lawsTechnologyEvaluationEOList.stream().filter(e -> {
|
||||
boolean flag = false;
|
||||
if(currentDate.after(e.getEndTime())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(updateLawsTechnologyEvaluationEOList)){
|
||||
List<String> lawsTechnologyEvaluationIdList = updateLawsTechnologyEvaluationEOList.stream().map(LawsTechnologyEvaluationEO::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
//获取这些法规技术评估数据的下级流程明细数据。
|
||||
QueryWrapper<LawsTechnologyEvaluationFlowDetailEO> flowDetailEOQueryWrapper = new QueryWrapper<>();
|
||||
flowDetailEOQueryWrapper.lambda().in(LawsTechnologyEvaluationFlowDetailEO::getLawsTechnologyEvaluationId,lawsTechnologyEvaluationIdList);
|
||||
List<LawsTechnologyEvaluationFlowDetailEO> lawsTechnologyEvaluationFlowDetailEOList = lawsTechnologyEvaluationFlowDetailEOService.list(flowDetailEOQueryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(lawsTechnologyEvaluationFlowDetailEOList)){
|
||||
String actiProcInstIds = lawsTechnologyEvaluationFlowDetailEOList.stream().map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(","));
|
||||
Result<String> result = this.workFlowFeignClient.completeTaskByPids(actiProcInstIds);
|
||||
if(result.getCode().equals(CommonConstant.SC_OK_200)){
|
||||
updateLawsTechnologyEvaluationEOList.forEach(lawsTechnologyEvaluationEO -> {
|
||||
lawsTechnologyEvaluationEO.setFlowStatus(GatherResultEnum.COMPLETED.getValue());
|
||||
});
|
||||
this.lawsTechnologyEvaluationEOService.updateBatchById(updateLawsTechnologyEvaluationEOList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
log.info("法规技术评估流程,定时任务结束 =====================================================");
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.job;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
|
||||
/**
|
||||
* 法规技术评估 节点枚举类
|
||||
*/
|
||||
public enum LawsTechnologyEvaluationNodeEnum {
|
||||
|
||||
ENGINEER_INITIATED("fggcsfq","法规工程师发起","Engineer initiated"),
|
||||
APPRAISERS_EVALUATION("pgrqr","评估人评估","Appraiser's evaluation"),
|
||||
SPONSOR_REVIEW("fqrsc","发起人审查","Sponsor review"),
|
||||
;
|
||||
|
||||
String key;
|
||||
String cnName;
|
||||
String enName;
|
||||
|
||||
private LawsTechnologyEvaluationNodeEnum(String key, String cnName, String enName) {
|
||||
this.key = key;
|
||||
this.cnName = cnName;
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getCnName() {
|
||||
return cnName;
|
||||
}
|
||||
|
||||
public void setCnName(String cnName) {
|
||||
this.cnName = cnName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String key,String cut) {
|
||||
LawsTechnologyEvaluationNodeEnum[] values = values();
|
||||
for (LawsTechnologyEvaluationNodeEnum lawsOpinionGatherNodeEnum : values) {
|
||||
if (lawsOpinionGatherNodeEnum.key.equals(key)) {
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
return lawsOpinionGatherNodeEnum.cnName;
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
return lawsOpinionGatherNodeEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+12
-1
@@ -2,7 +2,12 @@ package com.jero.modules.lawsTechnologyEvaluation.service;
|
||||
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationComplianceResultEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationResultEO;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估-评估人反馈-符合性结果表
|
||||
@@ -57,5 +62,11 @@ public interface ILawsTechnologyEvaluationComplianceResultEOService extends ISer
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<LawsTechnologyEvaluationComplianceResultEO> queryList();
|
||||
List<LawsTechnologyEvaluationComplianceResultEO> queryList(LawsTechnologyEvaluationComplianceResultEO lawsTechnologyEvaluationComplianceResultEO,
|
||||
HttpServletRequest req,
|
||||
String cut);
|
||||
|
||||
void exportZip(HttpServletResponse response, HttpServletRequest request,
|
||||
LawsTechnologyEvaluationComplianceResultEO lawsTechnologyEvaluationComplianceResultEO,
|
||||
Map<String, Object> params);
|
||||
}
|
||||
|
||||
+12
@@ -1,10 +1,16 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估
|
||||
@@ -74,4 +80,10 @@ public interface ILawsTechnologyEvaluationEOService extends IService<LawsTechnol
|
||||
* @param cut
|
||||
*/
|
||||
void disposeData(List<LawsTechnologyEvaluationEO> records, String cut);
|
||||
|
||||
IPage getPageDummy(Map<String, Object> parameter);
|
||||
|
||||
void exportItemTemplate(String cut, HttpServletResponse response, HttpServletRequest request);
|
||||
|
||||
List<Map<String,Object>> importItemExcel(MultipartFile file, String cut, HttpServletRequest request)throws Exception;
|
||||
}
|
||||
|
||||
+7
@@ -67,4 +67,11 @@ public interface ILawsTechnologyEvaluationFlowDetailEOService extends IService<L
|
||||
* @return
|
||||
*/
|
||||
Result<?> processCall(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
* @param datas
|
||||
* @param cut
|
||||
*/
|
||||
void disposeData(List<LawsTechnologyEvaluationFlowDetailEO> datas, String cut);
|
||||
}
|
||||
|
||||
+13
-1
@@ -4,7 +4,11 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationItemResultEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估-条款信息评估结果表
|
||||
@@ -59,7 +63,9 @@ public interface ILawsTechnologyEvaluationItemResultEOService extends IService<L
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<LawsTechnologyEvaluationItemResultEO> queryList();
|
||||
List<LawsTechnologyEvaluationItemResultEO> queryList(LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO,
|
||||
HttpServletRequest req,
|
||||
String cut);
|
||||
|
||||
/**
|
||||
* 流程调用
|
||||
@@ -73,4 +79,10 @@ public interface ILawsTechnologyEvaluationItemResultEOService extends IService<L
|
||||
* @param jsonObject
|
||||
*/
|
||||
void batchUpdate(JSONObject jsonObject);
|
||||
|
||||
void disposeData(List<LawsTechnologyEvaluationItemResultEO> datas, String cut);
|
||||
|
||||
void exportZip(HttpServletResponse response, HttpServletRequest request, LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO, Map<String, Object> params);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+14
-1
@@ -3,6 +3,8 @@ package com.jero.modules.lawsTechnologyEvaluation.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationResultEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -58,11 +60,22 @@ public interface ILawsTechnologyEvaluationResultEOService extends IService<LawsT
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<LawsTechnologyEvaluationResultEO> queryList();
|
||||
List<LawsTechnologyEvaluationResultEO> queryList(LawsTechnologyEvaluationResultEO lawsTechnologyEvaluationResultEO,
|
||||
HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 评估人保存/提交
|
||||
* @param json
|
||||
*/
|
||||
void evaluatorSaveResult(JSONObject json);
|
||||
|
||||
/**
|
||||
* 根据流程实例id、法规技术评估id 查询评估结果与符合性结果接口
|
||||
* @param lawsTechnologyEvaluationResultEO
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
JSONObject queryEvaluationResultAndComplianceResult(LawsTechnologyEvaluationResultEO lawsTechnologyEvaluationResultEO, HttpServletRequest req);
|
||||
|
||||
void disposeData(List<LawsTechnologyEvaluationResultEO> datas, String cut);
|
||||
}
|
||||
|
||||
+247
-2
@@ -1,12 +1,49 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
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.LoginUser;
|
||||
import com.jero.common.util.FileUtils;
|
||||
import com.jero.common.util.oss.CosBootUtil;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationComplianceResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationItemResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.enums.ComplianceResultEnum;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationComplianceResultEOMapper;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationComplianceResultEOService;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationResultEOService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.system.util.PDFUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
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.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估-评估人反馈-符合性结果表
|
||||
@@ -15,7 +52,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationComplianceResultEOMapper, LawsTechnologyEvaluationComplianceResultEO> implements ILawsTechnologyEvaluationComplianceResultEOService {
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
@Autowired
|
||||
private ILawsTechnologyEvaluationResultEOService evaluationResultEOService;
|
||||
@Autowired
|
||||
private IOSSFileService iOSSFileService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -83,7 +127,208 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsTechnologyEvaluationComplianceResultEO> queryList() {
|
||||
return list();
|
||||
public List<LawsTechnologyEvaluationComplianceResultEO> queryList(LawsTechnologyEvaluationComplianceResultEO lawsTechnologyEvaluationComplianceResultEO,
|
||||
HttpServletRequest req,
|
||||
String cut) {
|
||||
QueryWrapper<LawsTechnologyEvaluationComplianceResultEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationComplianceResultEO, req.getParameterMap());
|
||||
if(org.apache.commons.lang3.StringUtils.isNotEmpty(lawsTechnologyEvaluationComplianceResultEO.getIds())){
|
||||
queryWrapper.lambda().in(LawsTechnologyEvaluationComplianceResultEO::getId,lawsTechnologyEvaluationComplianceResultEO.getIds().split(","));
|
||||
}
|
||||
List<LawsTechnologyEvaluationComplianceResultEO> complianceResultEOList = this.baseMapper.selectList(queryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(complianceResultEOList)){
|
||||
|
||||
List<String> complianceResultIdList = complianceResultEOList.stream().map(LawsTechnologyEvaluationComplianceResultEO::getId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<LawsTechnologyEvaluationResultEO> evaluationResultEOQueryWrapper = new QueryWrapper<>();
|
||||
evaluationResultEOQueryWrapper.lambda().in(LawsTechnologyEvaluationResultEO::getComplianceResultId,complianceResultIdList);
|
||||
List<LawsTechnologyEvaluationResultEO> evaluationResultEOList = this.evaluationResultEOService.list(evaluationResultEOQueryWrapper);
|
||||
this.evaluationResultEOService.disposeData(evaluationResultEOList,cut);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(evaluationResultEOList)){
|
||||
for (LawsTechnologyEvaluationComplianceResultEO complianceResultEO : complianceResultEOList) {
|
||||
List<LawsTechnologyEvaluationResultEO> lawsTechnologyEvaluationResultEOList = evaluationResultEOList.stream().filter(evaluationResultEO ->{
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(complianceResultEO.getId(),evaluationResultEO.getComplianceResultId())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
complianceResultEO.setLawsTechnologyEvaluationResultEOList(lawsTechnologyEvaluationResultEOList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return complianceResultEOList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void exportZip(HttpServletResponse response, HttpServletRequest request,
|
||||
LawsTechnologyEvaluationComplianceResultEO lawsTechnologyEvaluationComplianceResultEO,
|
||||
Map<String, Object> params) {
|
||||
String ids = (String)params.get("ids");
|
||||
String cut = (String)params.get("cut");
|
||||
|
||||
if(!StringUtils.isEmpty(ids)){
|
||||
lawsTechnologyEvaluationComplianceResultEO.setIds(ids);
|
||||
}
|
||||
List<LawsTechnologyEvaluationComplianceResultEO> exportData = this.queryList(lawsTechnologyEvaluationComplianceResultEO, request, cut);
|
||||
this.disposeData(exportData,cut);
|
||||
|
||||
String title = "";
|
||||
String bottomTitle = "";
|
||||
String fileName = "";
|
||||
if(org.apache.commons.lang3.StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
title = "相关章节,问题说明,附件";
|
||||
bottomTitle = "符合性结果:";
|
||||
fileName = "评估结果 " + ".xlsx";
|
||||
}else if(org.apache.commons.lang3.StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
title = "Related section,Problem description,Accessory";
|
||||
bottomTitle = "Compliance results:";
|
||||
fileName = "Evaluation results " + ".xlsx";
|
||||
}
|
||||
|
||||
OutputStream os = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
|
||||
String path = uploadpath + "/tempZip/itemEvaluationResults/" + System.currentTimeMillis();
|
||||
|
||||
try {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + fileName);
|
||||
response.setContentType("application/force-download");
|
||||
|
||||
//设置导出数据
|
||||
if(CollectionUtils.isNotEmpty(exportData)) {
|
||||
int size = exportData.size();
|
||||
for (int i = 0; i < exportData.size(); i++){
|
||||
//使用评估人的名字命名sheet页
|
||||
HSSFSheet sheet = workbook.createSheet(exportData.get(i).getCreateBy());
|
||||
|
||||
CellStyle titleCellStyle = workbook.createCellStyle();
|
||||
titleCellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
|
||||
titleCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
|
||||
titleCellStyle.setWrapText(true);//自动换行
|
||||
|
||||
Row firstRow = sheet.createRow(0);
|
||||
|
||||
//创建表头
|
||||
String[] titleArr = title.split(",");
|
||||
for (int j=0; j<=3; j++){
|
||||
sheet.setColumnWidth(j,4000);
|
||||
Cell cell = firstRow.createCell(j);
|
||||
cell.setCellStyle(titleCellStyle);
|
||||
cell.setCellValue(titleArr[j]);
|
||||
}
|
||||
|
||||
//获取这个评估人填写的评估结果
|
||||
List<LawsTechnologyEvaluationResultEO> lawsTechnologyEvaluationResultEOList = exportData.get(i).getLawsTechnologyEvaluationResultEOList();
|
||||
int evaluationResultListSize = lawsTechnologyEvaluationResultEOList.size();
|
||||
if(CollectionUtils.isNotEmpty(lawsTechnologyEvaluationResultEOList)){
|
||||
for (int dataIndex = 0; dataIndex < lawsTechnologyEvaluationResultEOList.size(); dataIndex++) {
|
||||
Row dataRow = sheet.createRow(dataIndex + 1);
|
||||
dataRow.createCell(0).setCellValue(lawsTechnologyEvaluationResultEOList.get(dataIndex).getRelatedSection());
|
||||
dataRow.createCell(1).setCellValue(lawsTechnologyEvaluationResultEOList.get(dataIndex).getIssueOrSuggest());
|
||||
dataRow.createCell(2).setCellValue(lawsTechnologyEvaluationResultEOList.get(dataIndex).getAccessoryFileName());
|
||||
}
|
||||
}
|
||||
|
||||
//把符合性结果设置进excel表格中。
|
||||
Row bottomRow = sheet.createRow(evaluationResultListSize + 1);
|
||||
Cell bottomRowFirstCell = bottomRow.getCell(0);
|
||||
bottomRowFirstCell.setCellStyle(titleCellStyle);
|
||||
bottomRowFirstCell.setCellValue(bottomTitle);
|
||||
|
||||
Cell bottomRowSecondCell = bottomRow.getCell(1);
|
||||
bottomRowSecondCell.setCellValue(exportData.get(i).getComplianceResultName());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
File fileTemp = new File(path);
|
||||
if (fileTemp.exists()) {
|
||||
fileTemp.delete();
|
||||
}
|
||||
fileTemp.mkdirs();
|
||||
//excel
|
||||
OutputStream excelOS = new FileOutputStream(path + File.separator + fileName);
|
||||
workbook.write(excelOS);
|
||||
excelOS.flush();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
for (LawsTechnologyEvaluationComplianceResultEO data : exportData) {
|
||||
List<LawsTechnologyEvaluationResultEO> evaluationResultEOList = data.getLawsTechnologyEvaluationResultEOList();
|
||||
if(CollectionUtils.isNotEmpty(evaluationResultEOList)){
|
||||
for (LawsTechnologyEvaluationResultEO lawsTechnologyEvaluationResultEO : evaluationResultEOList) {
|
||||
String accessoryFile = lawsTechnologyEvaluationResultEO.getAccessoryFile();
|
||||
|
||||
List<OSSFile> fileInfosList = iOSSFileService.getFileInfos(accessoryFile);
|
||||
if (fileInfosList.size() != 0) {
|
||||
for (OSSFile ossFile : fileInfosList) {
|
||||
String url = ossFile.getUrl();
|
||||
//判断文件是否存在
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(url)){
|
||||
//判断文件是否存在
|
||||
boolean b = CosBootUtil.doesObjectExist(url);
|
||||
if(b){
|
||||
InputStream download = CosBootUtil.download(url);
|
||||
if(url.endsWith(".pdf") || url.endsWith(".PDF")){
|
||||
String currentTime = sdf.format(new Date());
|
||||
String waterContent = loginUser.getUsername() + " " + currentTime;
|
||||
File newFile = PDFUtils.PDFWatermark(download,uploadpath,ossFile.getFileName(),waterContent);
|
||||
download = new FileInputStream(newFile.getPath());
|
||||
}
|
||||
//复制文件
|
||||
FileUtils.copyFile(download, path + File.separator + ossFile.getFileName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
ZipUtil.zip(path, path + ".zip");
|
||||
//文件
|
||||
FileInputStream fis = new FileInputStream(path + ".zip");
|
||||
os = response.getOutputStream();
|
||||
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
os.write(len);
|
||||
}
|
||||
os.flush();
|
||||
fis.close();
|
||||
excelOS.close();
|
||||
|
||||
}catch (IOException ex){
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
throw new JeroBootException("下载文件失败");
|
||||
}else{
|
||||
throw new JeroBootException("Failed to download file");
|
||||
}
|
||||
}finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
File file = new File(path);
|
||||
FileUtil.deleteContents(file);
|
||||
File fileTemp = new File(path + ".zip");
|
||||
FileUtil.deleteContents(fileTemp);
|
||||
}
|
||||
}
|
||||
|
||||
public void disposeData(List<LawsTechnologyEvaluationComplianceResultEO> datas,String cut){
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
for (LawsTechnologyEvaluationComplianceResultEO data : datas) {
|
||||
if(!StringUtils.isEmpty(data.getComplianceResult())){
|
||||
data.setComplianceResultName(ComplianceResultEnum.getTextByValue(data.getComplianceResult(),cut));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+262
-4
@@ -1,29 +1,55 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
|
||||
import com.jero.modules.project.enums.OperatorTypeEnum;
|
||||
import com.jero.modules.project.enums.RequestSourceEnum;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估
|
||||
@@ -32,10 +58,23 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationEOMapper, LawsTechnologyEvaluationEO> implements ILawsTechnologyEvaluationEOService {
|
||||
|
||||
@Autowired
|
||||
private SysCategoryServiceImpl sysCategoryService;
|
||||
@Autowired
|
||||
private OnlCgformFieldServiceImpl onlCgformFieldService;
|
||||
@Autowired
|
||||
private BussDocumentLibraryEOServiceImpl bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private BussDocumentLibraryEOMapper bussDocumentLibraryEOMapper;
|
||||
@Autowired
|
||||
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||
@Autowired
|
||||
private ISarFileSplitInfoService sarFileSplitInfoService;
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -154,6 +193,225 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage getPageDummy(Map<String, Object> parameter) {
|
||||
String cut = (String) parameter.get("cut");//中英文切换标识
|
||||
//文档库字段
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
|
||||
|
||||
//需要查询的字段
|
||||
List<String> fieldListQuery = new ArrayList<>();
|
||||
fieldListQuery.add("serial_number");
|
||||
fieldListQuery.add("title");
|
||||
fieldListQuery.add("title_en");
|
||||
fieldListQuery.add("state");
|
||||
fieldListQuery.add("region");
|
||||
fieldListQuery.add("technology_territory");
|
||||
fieldListQuery.add("xin1_che1_xing2_shi2_shi1_ri4_qi1");
|
||||
fieldListQuery.add("implement_time");
|
||||
fieldListQuery.add("corresponding_standard");
|
||||
|
||||
List<String> fieldListNew = new ArrayList<>();
|
||||
fieldListNew.add("id");
|
||||
|
||||
//过滤出文件字段
|
||||
List<OnlCgformField> fileFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
for (OnlCgformField onlCgformField : fileFieldList) {
|
||||
fieldListQuery.add(onlCgformField.getDbFieldName());
|
||||
}
|
||||
|
||||
//转时间格式
|
||||
for (String field : fieldListQuery) {
|
||||
String fieldTemp = null;
|
||||
if ("xin1_che1_xing2_shi2_shi1_ri4_qi1".equals(field) || "implement_time".equals(field)) {
|
||||
String fieldNew = "date_format(" + field + ", '%Y-%m-%d')";
|
||||
fieldTemp = "case when " + fieldNew + " is null then \"\" else " + fieldNew + " end " + field;
|
||||
fieldListNew.add(fieldTemp);
|
||||
} else {
|
||||
fieldTemp = "case when " + field + " is null then \"\" else " + field + " end " + field;
|
||||
fieldListNew.add(fieldTemp);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> fileFieldStrList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).map(OnlCgformField::getDbFieldName)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//封装查询条件
|
||||
String condition = this.bussDocumentLibraryEOService.getConditionStr(parameter);
|
||||
int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
|
||||
int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
|
||||
IPage infoPage = this.bussDocumentLibraryEOMapper.getInfoPage(page, " " + com.jero.modules.system.util.StringUtils.join(fieldListNew, ","), condition);
|
||||
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = this.sysCategoryService.list();
|
||||
//过滤出树形字段
|
||||
List<OnlCgformField> treeFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
List<Map> records = infoPage.getRecords();
|
||||
//数据字典
|
||||
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.selectItemsAll();
|
||||
//下拉选处理数据字典
|
||||
for (Map record : records) {
|
||||
Map<String, Object> record1 = (Map) record;
|
||||
String technology_territory = (String)record1.get("technology_territory");
|
||||
|
||||
List<String> connectIdList = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<String, Object> entry : record1.entrySet()) {
|
||||
//下拉选处理数据字典
|
||||
this.bussDocumentLibraryEOService.dictItem(sysDictItems, entry, cut, fieldList,null);
|
||||
this.bussDocumentLibraryEOService.treeDictItem(categoryList, entry, treeFieldList, cut,null);
|
||||
if(fileFieldStrList.contains(entry.getKey())){
|
||||
if(entry.getValue()!=null){
|
||||
connectIdList.add(entry.getValue().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
record1.put("technology_territory_id",technology_territory);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(connectIdList)){
|
||||
//根据id查询当前文档库数据是否有拆分数据。
|
||||
QueryWrapper<SarFileSplitInfoEO> splitInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
splitInfoEOQueryWrapper.lambda().in(SarFileSplitInfoEO::getConnectId,connectIdList);
|
||||
List<SarFileSplitInfoEO> sarFileSplitInfoList = new ArrayList<>();
|
||||
|
||||
List<SarFileSplitInfoEO> sarFileSplitInfoListTemp = sarFileSplitInfoService.list(splitInfoEOQueryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(sarFileSplitInfoListTemp)){
|
||||
sarFileSplitInfoListTemp.forEach(splitInfo -> {
|
||||
//查询出已回传的数据
|
||||
String flag = ""; // 1 已回传 0未回传。
|
||||
if(StringUtils.isNotEmpty(splitInfo.getFileId())){
|
||||
flag = "1";
|
||||
sarFileSplitInfoList.add(splitInfo);
|
||||
}else {
|
||||
flag = "0";
|
||||
}
|
||||
splitInfo.setFlag(flag);
|
||||
});
|
||||
record1.put("sarFileSplitInfoList",sarFileSplitInfoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return infoPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportItemTemplate(String cut, HttpServletResponse response, HttpServletRequest request) {
|
||||
OutputStream os = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
String fileOriName = "";
|
||||
String filePath = uploadpath + File.separator + fileOriName;
|
||||
try {
|
||||
String title = "";
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
title = "条款号,条款名称,条款内容";
|
||||
fileOriName = "条款信息导入模板.xls";
|
||||
} else {
|
||||
title = "Item num,Item name,Item Contents";
|
||||
fileOriName = "Item information is imported into the template.xls";
|
||||
}
|
||||
|
||||
//创建临时文件夹
|
||||
File nowFile = new File(filePath);
|
||||
if (nowFile.exists()) {
|
||||
nowFile.delete();
|
||||
}
|
||||
nowFile.mkdirs();
|
||||
|
||||
HSSFSheet sheet = workbook.createSheet("sheet1");
|
||||
sheet.setDefaultColumnWidth(16);//列宽
|
||||
HSSFCellStyle cellStyle = workbook.createCellStyle();
|
||||
cellStyle.setWrapText(true);//自动换行
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
|
||||
|
||||
HSSFCellStyle cellStyleTemp = workbook.createCellStyle();
|
||||
cellStyleTemp.setWrapText(true);//自动换行
|
||||
|
||||
String explainInfo = null;
|
||||
|
||||
HSSFRichTextString explain = new HSSFRichTextString(explainInfo);
|
||||
|
||||
//表头
|
||||
Row row = sheet.createRow(0);//开始创建标题行
|
||||
String[] headerArr = title.split(",");
|
||||
for (int m = 0; m < headerArr.length; m++) {
|
||||
row.createCell(m).setCellValue(headerArr[m]);
|
||||
}
|
||||
|
||||
/*Row rowExplain = sheet.createRow(1);
|
||||
short height = (short) (7 * 200);
|
||||
rowExplain.setHeight((short) height);
|
||||
Cell cell = rowExplain.createCell(0);
|
||||
cell.setCellValue(explain);
|
||||
cell.setCellStyle(cellStyleTemp);*/
|
||||
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=\"" + fileOriName + ".xls");
|
||||
response.setContentType("application/force-download");
|
||||
response.flushBuffer();
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String,Object>> importItemExcel(MultipartFile file, String cut, HttpServletRequest request)throws Exception {
|
||||
//校验文件格式
|
||||
int pos = file.getOriginalFilename().lastIndexOf(".");
|
||||
String fileSuffixStr = file.getOriginalFilename().substring(pos+1).toLowerCase();
|
||||
if(!StringUtils.equals(fileSuffixStr,"xls")){
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
throw new JeroBootException("请上传xls文件");
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
throw new JeroBootException("Please upload a xls file");
|
||||
}
|
||||
}
|
||||
String fileName = file.getOriginalFilename();
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
|
||||
File excelFile = File.createTempFile(fileName, fileSuffixStr);
|
||||
file.transferTo(excelFile);
|
||||
Workbook workbook = WorkbookFactory.create(excelFile);
|
||||
if (workbook != null) {
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
if (sheet != null) {
|
||||
int rowNos = sheet.getPhysicalNumberOfRows();// 得到excel的总记录条数
|
||||
for (int i = 0; i < rowNos ; i++) {
|
||||
Row row = sheet.getRow(i + 1);
|
||||
if(row != null){
|
||||
String itemNum = row.getCell(0, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
|
||||
String itemName = row.getCell(1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
|
||||
String itemContents = row.getCell(2, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK).toString();
|
||||
Map<String,Object> itemInfoMap = new HashMap<>();
|
||||
String itemId = UUID.randomUUID().toString().replace("-", "");
|
||||
itemInfoMap.put("itemId",itemId);
|
||||
itemInfoMap.put("itemNum",itemNum);
|
||||
itemInfoMap.put("itemName",itemName);
|
||||
itemInfoMap.put("itemContent",itemContents);
|
||||
result.add(itemInfoMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getTreeName(String cut, List<SysCategory> categoryList, List<String> technologyTerritoryList) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String technologyTerritory : technologyTerritoryList) {
|
||||
|
||||
+55
@@ -2,6 +2,7 @@ package com.jero.modules.lawsTechnologyEvaluation.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
|
||||
@@ -9,14 +10,21 @@ import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluation
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationFlowDetailEOService;
|
||||
import com.jero.modules.project.enums.OperatorTypeEnum;
|
||||
import com.jero.modules.project.enums.RequestSourceEnum;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
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.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估表-流程明细
|
||||
@@ -25,8 +33,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class LawsTechnologyEvaluationFlowDetailEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationFlowDetailEOMapper, LawsTechnologyEvaluationFlowDetailEO> implements ILawsTechnologyEvaluationFlowDetailEOService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -122,8 +134,51 @@ public class LawsTechnologyEvaluationFlowDetailEOServiceImpl extends ServiceImpl
|
||||
if(CollectionUtils.isNotEmpty(detailList)){
|
||||
this.saveBatch(detailList);
|
||||
}
|
||||
}else if(StringUtils.equals(operatorType, OperatorTypeEnum.QUERY.getValue())){
|
||||
String lawsTechnologyEvaluationId = jsonObject.getString("lawsTechnologyEvaluationId");
|
||||
QueryWrapper<LawsTechnologyEvaluationFlowDetailEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(LawsTechnologyEvaluationFlowDetailEO::getLawsTechnologyEvaluationId,lawsTechnologyEvaluationId);
|
||||
List<LawsTechnologyEvaluationFlowDetailEO> lawsTechnologyEvaluationFlowDetailEOS = this.baseMapper.selectList(queryWrapper);
|
||||
Result<List<LawsTechnologyEvaluationFlowDetailEO>> objectResult = new Result<>();
|
||||
objectResult.setResult(lawsTechnologyEvaluationFlowDetailEOS);
|
||||
objectResult.setSuccess(true);
|
||||
return objectResult;
|
||||
}
|
||||
|
||||
return new Result<>().success("调用成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeData(List<LawsTechnologyEvaluationFlowDetailEO> datas, String cut) {
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
for (LawsTechnologyEvaluationFlowDetailEO data : datas) {
|
||||
String evaluatorId = data.getEvaluatorId();
|
||||
if(StringUtils.isNotEmpty(evaluatorId)){
|
||||
userIdList.add(evaluatorId);
|
||||
}
|
||||
}
|
||||
List<SysUser> sysUserList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(userIdList)){
|
||||
sysUserList = sysUserService.querySysUserListByIdList(userIdList);
|
||||
}
|
||||
|
||||
for (LawsTechnologyEvaluationFlowDetailEO data : datas) {
|
||||
if(CollectionUtils.isNotEmpty(sysUserList)){
|
||||
String evaluatorId = data.getEvaluatorId();
|
||||
if(StringUtils.isNotEmpty(evaluatorId)){
|
||||
String evaluatorName = sysUserList.stream().filter(sysUser -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(sysUser.getId(), data.getEvaluatorId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(SysUser::getUsername).distinct().collect(Collectors.joining(","));
|
||||
data.setEvaluatorName(evaluatorName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+236
-6
@@ -1,23 +1,50 @@
|
||||
package com.jero.modules.lawsTechnologyEvaluation.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.FileUtils;
|
||||
import com.jero.common.util.oss.CosBootUtil;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationItemResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.enums.ComplianceResultEnum;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationItemResultEOMapper;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationItemResultEOService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.project.enums.OperatorTypeEnum;
|
||||
import com.jero.modules.project.enums.RequestSourceEnum;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.util.PDFUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
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.shiro.SecurityUtils;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.io.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估-条款信息评估结果表
|
||||
@@ -26,8 +53,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationItemResultEOMapper, LawsTechnologyEvaluationItemResultEO> implements ILawsTechnologyEvaluationItemResultEOService {
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
@Autowired
|
||||
private SysCategoryServiceImpl sysCategoryService;
|
||||
@Autowired
|
||||
private IOSSFileService iOSSFileService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -94,8 +129,12 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsTechnologyEvaluationItemResultEO> queryList() {
|
||||
return list();
|
||||
public List<LawsTechnologyEvaluationItemResultEO> queryList(LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO,
|
||||
HttpServletRequest req,
|
||||
String cut) {
|
||||
QueryWrapper<LawsTechnologyEvaluationItemResultEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationItemResultEO, req.getParameterMap());
|
||||
List<LawsTechnologyEvaluationItemResultEO> itemResultEOList = this.baseMapper.selectList(queryWrapper);
|
||||
return itemResultEOList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,4 +186,195 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
|
||||
this.updateBatchById(itemResultEOList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeData(List<LawsTechnologyEvaluationItemResultEO> datas, String cut) {
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
for (LawsTechnologyEvaluationItemResultEO data : datas) {
|
||||
String evaluationMethods = data.getEvaluationMethods();
|
||||
List<String> evaluationMethodsList = Arrays.asList(evaluationMethods.split(","));
|
||||
String name = getTreeName(cut, categoryList, evaluationMethodsList);
|
||||
data.setEvaluationMethodsName(name);
|
||||
if(StringUtils.isNotEmpty(data.getComplianceResult())){
|
||||
data.setComplianceResultName(ComplianceResultEnum.getTextByValue(data.getComplianceResult(),cut));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(data.getAccessoryFile())){
|
||||
List<OSSFile> accessoryFileList = iOSSFileService.getFileInfos(data.getAccessoryFile());
|
||||
String accessoryFileName = accessoryFileList.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
|
||||
data.setAccessoryFileName(accessoryFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportZip(HttpServletResponse response, HttpServletRequest request, LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO, Map<String, Object> params) {
|
||||
String ids = (String)params.get("ids");
|
||||
String cut = (String)params.get("cut");
|
||||
QueryWrapper<LawsTechnologyEvaluationItemResultEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationItemResultEO, request.getParameterMap());
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
queryWrapper.lambda().in(LawsTechnologyEvaluationItemResultEO::getId,idList);
|
||||
}
|
||||
List<LawsTechnologyEvaluationItemResultEO> exportData = this.baseMapper.selectList(queryWrapper);
|
||||
this.disposeData(exportData,cut);
|
||||
|
||||
String title = "";
|
||||
String fileName = "";
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
title = "条款号,条款名称,条款内容,评估人,评估方式,技术文件名称,章节,符合性结果,意见,附件,反馈时间";
|
||||
fileName = "条款评估结果 " + ".xlsx";
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
title = "Item num,Item name,Item Contents,Evaluator,Evaluation methods,Name of technical document,Section,Compliance results,Opinion,Accessory,Feedback time ";
|
||||
fileName = "Item Evaluation results " + ".xlsx";
|
||||
}
|
||||
|
||||
OutputStream os = null;
|
||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||
|
||||
String path = uploadpath + "/tempZip/itemEvaluationResults/" + System.currentTimeMillis();
|
||||
|
||||
try {
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + fileName);
|
||||
response.setContentType("application/force-download");
|
||||
|
||||
HSSFSheet sheet = workbook.createSheet("sheet1");
|
||||
|
||||
CellStyle titleCellStyle = workbook.createCellStyle();
|
||||
titleCellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
|
||||
titleCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
|
||||
titleCellStyle.setWrapText(true);//自动换行
|
||||
|
||||
Row firstRow = sheet.createRow(0);
|
||||
|
||||
//创建表头
|
||||
String[] titleArr = title.split(",");
|
||||
for (int i=0; i<=5; i++){
|
||||
sheet.setColumnWidth(i,4000);
|
||||
Cell cell = firstRow.createCell(i);
|
||||
cell.setCellStyle(titleCellStyle);
|
||||
cell.setCellValue(titleArr[i]);
|
||||
}
|
||||
|
||||
//设置导出数据
|
||||
if(CollectionUtils.isNotEmpty(exportData)) {
|
||||
for (int dataIndex = 0; dataIndex < exportData.size(); dataIndex++) {
|
||||
Row dataRow = sheet.createRow(dataIndex + 1);
|
||||
dataRow.createCell(0).setCellValue(exportData.get(dataIndex).getItemNum());
|
||||
dataRow.createCell(1).setCellValue(exportData.get(dataIndex).getItemName());
|
||||
dataRow.createCell(2).setCellValue(exportData.get(dataIndex).getItemContent());
|
||||
dataRow.createCell(3).setCellValue(exportData.get(dataIndex).getCreateBy());
|
||||
dataRow.createCell(4).setCellValue(exportData.get(dataIndex).getEvaluationMethodsName());
|
||||
dataRow.createCell(5).setCellValue(exportData.get(dataIndex).getTechnicalFileName());
|
||||
dataRow.createCell(6).setCellValue(exportData.get(dataIndex).getSection());
|
||||
dataRow.createCell(7).setCellValue(exportData.get(dataIndex).getComplianceResultName());
|
||||
dataRow.createCell(8).setCellValue(exportData.get(dataIndex).getOpinion());
|
||||
dataRow.createCell(9).setCellValue(exportData.get(dataIndex).getAccessoryFileName());
|
||||
String feedBackTimeStr = disposeDate(exportData.get(dataIndex).getCreateTime());
|
||||
dataRow.createCell(10).setCellValue(feedBackTimeStr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File fileTemp = new File(path);
|
||||
if (fileTemp.exists()) {
|
||||
fileTemp.delete();
|
||||
}
|
||||
fileTemp.mkdirs();
|
||||
//excel
|
||||
OutputStream excelOS = new FileOutputStream(path + File.separator + fileName);
|
||||
workbook.write(excelOS);
|
||||
excelOS.flush();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
for (LawsTechnologyEvaluationItemResultEO data : exportData) {
|
||||
String accessoryFile = data.getAccessoryFile();
|
||||
|
||||
List<OSSFile> fileInfosList = iOSSFileService.getFileInfos(accessoryFile);
|
||||
if (fileInfosList.size() != 0) {
|
||||
for (OSSFile ossFile : fileInfosList) {
|
||||
String url = ossFile.getUrl();
|
||||
//判断文件是否存在
|
||||
if(StringUtils.isNotBlank(url)){
|
||||
//判断文件是否存在
|
||||
boolean b = CosBootUtil.doesObjectExist(url);
|
||||
if(b){
|
||||
InputStream download = CosBootUtil.download(url);
|
||||
if(url.endsWith(".pdf") || url.endsWith(".PDF")){
|
||||
String currentTime = sdf.format(new Date());
|
||||
String waterContent = loginUser.getUsername() + " " + currentTime;
|
||||
File newFile = PDFUtils.PDFWatermark(download,uploadpath,ossFile.getFileName(),waterContent);
|
||||
download = new FileInputStream(newFile.getPath());
|
||||
}
|
||||
FileUtils.copyFile(download, path + File.separator + ossFile.getFileName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ZipUtil.zip(path, path + ".zip");
|
||||
//文件
|
||||
FileInputStream fis = new FileInputStream(path + ".zip");
|
||||
os = response.getOutputStream();
|
||||
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
os.write(len);
|
||||
}
|
||||
os.flush();
|
||||
fis.close();
|
||||
excelOS.close();
|
||||
|
||||
}catch (IOException ex){
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
throw new JeroBootException("下载文件失败");
|
||||
}else{
|
||||
throw new JeroBootException("Failed to download file");
|
||||
}
|
||||
}finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
File file = new File(path);
|
||||
FileUtil.deleteContents(file);
|
||||
File fileTemp = new File(path + ".zip");
|
||||
FileUtil.deleteContents(fileTemp);
|
||||
}
|
||||
}
|
||||
|
||||
public String disposeDate(Date date){
|
||||
String result = "";
|
||||
try {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if(date != null){
|
||||
result = sdf.format(date);
|
||||
}
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("处理日期失败:" +ex.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getTreeName(String cut, List<SysCategory> categoryList, List<String> evaluationMethodsList) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String evaluationMethods : evaluationMethodsList) {
|
||||
List<SysCategory> collect = categoryList.stream().filter(e -> evaluationMethods.equals(e.getId())).collect(Collectors.toList());
|
||||
if(collect.size() != 0){
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
sb.append(collect.get(0).getName() + ",");
|
||||
} else {
|
||||
sb.append(collect.get(0).getEnName()+ ",");
|
||||
}
|
||||
}
|
||||
}
|
||||
String evaluationMethodsName = "";
|
||||
if (StringUtils.isNotBlank(sb)) {
|
||||
evaluationMethodsName = sb.substring(0, sb.length() - 1);
|
||||
}
|
||||
return evaluationMethodsName;
|
||||
}
|
||||
}
|
||||
|
||||
+54
-2
@@ -3,11 +3,15 @@ package com.jero.modules.lawsTechnologyEvaluation.service.impl;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationComplianceResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationResultEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationResultEOMapper;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationComplianceResultEOService;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationResultEOService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import me.zhyd.oauth.utils.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -15,7 +19,14 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description: 法规技术评估-评估结果表
|
||||
@@ -24,10 +35,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class LawsTechnologyEvaluationResultEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationResultEOMapper, LawsTechnologyEvaluationResultEO> implements ILawsTechnologyEvaluationResultEOService {
|
||||
|
||||
@Autowired
|
||||
private ILawsTechnologyEvaluationComplianceResultEOService complianceResultEOService;
|
||||
@Autowired
|
||||
private IOSSFileService iOSSFileService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -95,8 +109,11 @@ public class LawsTechnologyEvaluationResultEOServiceImpl extends ServiceImpl<Law
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsTechnologyEvaluationResultEO> queryList() {
|
||||
return list();
|
||||
public List<LawsTechnologyEvaluationResultEO> queryList(LawsTechnologyEvaluationResultEO lawsTechnologyEvaluationResultEO,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsTechnologyEvaluationResultEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationResultEO, req.getParameterMap());
|
||||
List<LawsTechnologyEvaluationResultEO> evaluationResultEOList = this.baseMapper.selectList(queryWrapper);
|
||||
return evaluationResultEOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,6 +130,8 @@ public class LawsTechnologyEvaluationResultEOServiceImpl extends ServiceImpl<Law
|
||||
complianceResultEOService.remove(removeComplianceResultWrapper);
|
||||
|
||||
LawsTechnologyEvaluationComplianceResultEO complianceResultEO = new LawsTechnologyEvaluationComplianceResultEO();
|
||||
String complianceResultId = UUID.randomUUID().toString().replace("-", "");
|
||||
complianceResultEO.setId(complianceResultId);
|
||||
complianceResultEO.setActiProcInstId(actiProcInstId);
|
||||
complianceResultEO.setLawsTechnologyEvaluationId(lawsTechnologyEvaluationId);
|
||||
complianceResultEO.setComplianceResult(complianceResult);
|
||||
@@ -129,10 +148,43 @@ public class LawsTechnologyEvaluationResultEOServiceImpl extends ServiceImpl<Law
|
||||
LawsTechnologyEvaluationResultEO evaluationResultEO = null;
|
||||
for (Object evaluationResult : evaluationResultList) {
|
||||
evaluationResultEO = JSONObject.parseObject(JSONObject.toJSONString(evaluationResult),LawsTechnologyEvaluationResultEO.class);
|
||||
evaluationResultEO.setActiProcInstId(actiProcInstId);
|
||||
evaluationResultEO.setLawsTechnologyEvaluationId(lawsTechnologyEvaluationId);
|
||||
evaluationResultEO.setSubmitTime(new Date());
|
||||
evaluationResultEO.setComplianceResultId(complianceResultId);
|
||||
evaluationResultEOList.add(evaluationResultEO);
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(evaluationResultEOList)){
|
||||
this.saveBatch(evaluationResultEOList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject queryEvaluationResultAndComplianceResult(LawsTechnologyEvaluationResultEO lawsTechnologyEvaluationResultEO, HttpServletRequest req) {
|
||||
JSONObject result = new JSONObject();
|
||||
List<LawsTechnologyEvaluationResultEO> evaluationResultEOList = this.queryList(lawsTechnologyEvaluationResultEO, req);
|
||||
result.put("evaluationResultEOList",evaluationResultEOList);
|
||||
|
||||
QueryWrapper<LawsTechnologyEvaluationComplianceResultEO> complianceResultEOQueryWrapper = new QueryWrapper<>();
|
||||
complianceResultEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationComplianceResultEO::getActiProcInstId,lawsTechnologyEvaluationResultEO.getActiProcInstId());
|
||||
complianceResultEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationComplianceResultEO::getLawsTechnologyEvaluationId,lawsTechnologyEvaluationResultEO.getLawsTechnologyEvaluationId());
|
||||
List<LawsTechnologyEvaluationComplianceResultEO> complianceResultEOList = complianceResultEOService.list(complianceResultEOQueryWrapper);
|
||||
if(CollectionUtils.isNotEmpty(complianceResultEOList)){
|
||||
result.put("complianceResult",complianceResultEOList.get(0));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeData(List<LawsTechnologyEvaluationResultEO> datas, String cut) {
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
for (LawsTechnologyEvaluationResultEO data : datas) {
|
||||
if(StringUtils.isNotEmpty(data.getAccessoryFile())){
|
||||
List<OSSFile> accessoryFileList = iOSSFileService.getFileInfos(data.getAccessoryFile());
|
||||
String accessoryFileName = accessoryFileList.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
|
||||
data.setAccessoryFileName(accessoryFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ public class FileUnZip {
|
||||
File[] filesTemp = fi.listFiles();
|
||||
for (File fileTemp : filesTemp) {
|
||||
// 对文件进行过滤
|
||||
if (fileTemp.getName().equals(filenameTwo) && fileTemp.getPath().contains(filenameOne) && StringUtils.isNotBlank(filenameOne)) {
|
||||
if (fileTemp.getName().equals(filenameTwo) && fi.getName().equals(filenameOne) && StringUtils.isNotBlank(filenameOne)) {
|
||||
resultlist.add(fileTemp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user