合并分支 'feature_dev_20221125_YW' 到 'master'
Feature dev 20221125 yw 查看合并请求 laws-nio/laws-weilai!259
This commit is contained in:
+16
-9
@@ -581,12 +581,7 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
|
||||
@RequestParam(value = "paramsReportId") String paramsReportId,
|
||||
@RequestParam(value = "paramsReportConfigId") String paramsReportConfigId,
|
||||
@RequestParam(value = "paramsReportConfigName") String paramsReportConfigName) {
|
||||
boolean isSuccess = paramsCollectManifestEOService.addReferencesCol(paramsManifestId, paramsReportId, paramsReportConfigId, paramsReportConfigName);
|
||||
if (isSuccess) {
|
||||
return Result.OK("引用参考列成功!");
|
||||
} else {
|
||||
return Result.error("引用参考列失败!");
|
||||
}
|
||||
return this.paramsCollectManifestEOService.addReferencesCol(paramsManifestId, paramsReportId, paramsReportConfigId, paramsReportConfigName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -653,15 +648,27 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回
|
||||
* 认证工程师-强制撤回
|
||||
*
|
||||
* @param paramsCollectManifestVO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数项收集清单-强制撤回")
|
||||
@ApiOperation(value="参数项收集清单-强制撤回", notes="参数项收集清单-强制撤回")
|
||||
@AutoLog(value = "参数项收集清单-认证工程师-强制撤回")
|
||||
@ApiOperation(value="参数项收集清单-认证工程师-强制撤回", notes="参数项收集清单-认证工程师-强制撤回")
|
||||
@PostMapping(value = "/mandatoryWithdraw")
|
||||
public Result<?> mandatoryWithdraw(ParamsCollectManifestVO paramsCollectManifestVO) {
|
||||
return this.paramsCollectManifestEOService.mandatoryWithdraw(paramsCollectManifestVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 认证工程师-分配填写人
|
||||
* @param paramsCollectManifestVO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数项收集清单-认证工程师-分配填写人")
|
||||
@ApiOperation(value="参数项收集清单-认证工程师-分配填写人", notes="参数项收集清单-认证工程师-分配填写人")
|
||||
@PostMapping(value = "/certifiedEngineerUpdateDreBatch")
|
||||
public Result<?> certifiedEngineerUpdateDreBatch(ParamsCollectManifestVO paramsCollectManifestVO) {
|
||||
return this.paramsCollectManifestEOService.certifiedEngineerUpdateDreBatch(paramsCollectManifestVO);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -183,11 +183,14 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
|
||||
void checkDeadline();
|
||||
|
||||
// 认证工程师-引用参考列
|
||||
boolean addReferencesCol(String paramsManifestId, String paramsReportId, String paramsReportConfigId, String paramsReportConfigName);
|
||||
Result<?> addReferencesCol(String paramsManifestId, String paramsReportId, String paramsReportConfigId, String paramsReportConfigName);
|
||||
|
||||
// 认证工程师-更新参考列
|
||||
boolean updateReferencesCol(List<Map<String, Object>> configDataList, String paramsManifestId);
|
||||
|
||||
// 认证工程师-强制撤回
|
||||
Result<?> mandatoryWithdraw(ParamsCollectManifestVO paramsCollectManifestVO);
|
||||
|
||||
// 认证工程师-批量修改填写人
|
||||
Result<?> certifiedEngineerUpdateDreBatch(ParamsCollectManifestVO paramsCollectManifestVO);
|
||||
}
|
||||
|
||||
+198
-2
@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -4975,7 +4976,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addReferencesCol(String paramsManifestId, String paramsReportId, String paramsReportConfigId, String paramsReportConfigName) {
|
||||
public Result<?> addReferencesCol(String paramsManifestId, String paramsReportId, String paramsReportConfigId, String paramsReportConfigName) {
|
||||
// 获取清单参数项
|
||||
ParamsCollectManifestEO queryEO = new ParamsCollectManifestEO();
|
||||
queryEO.setParamsManifestId(paramsManifestId);
|
||||
@@ -5027,7 +5028,15 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
paramsManifestEOService.updateById(paramsManifestEO);
|
||||
|
||||
// 修改参数项 参考列
|
||||
return updateBatchById(updateEOList);
|
||||
try {
|
||||
updateBatchById(updateEOList);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("修改参数项,参考列失败: " + ex.getMessage());
|
||||
throw new JeroBootException("引用参考列失败!");
|
||||
}
|
||||
|
||||
return Result.OK("引用参考列成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -5210,6 +5219,193 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
return Result.OK("强制撤回成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> certifiedEngineerUpdateDreBatch(ParamsCollectManifestVO paramsCollectManifestVO) {
|
||||
if (StringUtils.isEmpty(paramsCollectManifestVO.getIds())
|
||||
|| StringUtils.isEmpty(paramsCollectManifestVO.getDre())
|
||||
|| StringUtils.isEmpty(paramsCollectManifestVO.getProjectId()) || StringUtils.isEmpty(paramsCollectManifestVO.getParamsManifestId())) {
|
||||
throw new JeroBootException("参数不能为空!");
|
||||
}
|
||||
String paramsCollectManifestIds = paramsCollectManifestVO.getIds();
|
||||
String dre = paramsCollectManifestVO.getDre();
|
||||
String projectId = paramsCollectManifestVO.getProjectId();
|
||||
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
|
||||
|
||||
ParamsManifestEO paramsManifestEO = paramsManifestEOService.queryById(paramsManifestId); // 获取清单信息
|
||||
ParamsManifestVO projectInfo = paramsManifestEOService.getProjectById(projectId, paramsManifestEO.getProjectVersion()); // 获取项目信息
|
||||
paramsManifestEO.setProjectName(projectInfo.getProjectName());
|
||||
|
||||
String[] paramsCollectManifestIdArr = paramsCollectManifestIds.split(",");
|
||||
List<ParamsCollectManifestEO> updateEOList = new ArrayList<>();
|
||||
|
||||
LambdaQueryWrapper<ParamsCollectManifestEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(ParamsCollectManifestEO::getId, Arrays.asList(paramsCollectManifestIdArr))
|
||||
.orderByAsc(ParamsCollectManifestEO::getDeadline).orderByAsc(ParamsCollectManifestEO::getNioNumber);
|
||||
List<ParamsCollectManifestEO> paramsCollectManifestEOList = this.list(queryWrapper);
|
||||
Date deadline = paramsCollectManifestEOList.get(0).getDeadline();
|
||||
|
||||
// 存放数据的前后填写与工程接口人信息
|
||||
List<Map<String,Object>> paramsCollectManifestMapList = new ArrayList<>();
|
||||
for (ParamsCollectManifestEO paramsCollectManifestEO : paramsCollectManifestEOList) {
|
||||
// 如果新分发的填写人和原填写人一致,直接跳过。
|
||||
if(StringUtils.equals(dre,paramsCollectManifestEO.getDre())){
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<String,Object> paramsCollectManifestMap = new HashMap<>();
|
||||
paramsCollectManifestMap.put("paramsCollectManifestId",paramsCollectManifestEO.getId());
|
||||
paramsCollectManifestMap.put("dreUpdateFront",paramsCollectManifestEO.getDre());
|
||||
paramsCollectManifestMap.put("dreUpdateAfter",dre);
|
||||
paramsCollectManifestMap.put("sdt",paramsCollectManifestEO.getSdt());
|
||||
paramsCollectManifestMap.put("paramsCollectManifestEO",paramsCollectManifestEO);
|
||||
paramsCollectManifestMapList.add(paramsCollectManifestMap);
|
||||
|
||||
ParamsCollectManifestEO updateEO = new ParamsCollectManifestEO();
|
||||
updateEO.setId(paramsCollectManifestEO.getId());
|
||||
updateEO.setDre(dre); // 设置填写人
|
||||
updateEO.setState(CollectManifestStateEnum.WAIT_FILL.getValue()); // 设置状态为:待填写
|
||||
updateEOList.add(updateEO);
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(updateEOList)){
|
||||
this.updateBatchById(updateEOList);
|
||||
// 发送变更消息
|
||||
this.sendChangeMessage(paramsCollectManifestMapList,paramsManifestEO,projectInfo,dre,deadline);
|
||||
}
|
||||
return Result.OK("分配填写人成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送变更消息
|
||||
* @param paramsCollectManifestMapList
|
||||
* @param paramsManifestEO 清单信息
|
||||
* @param projectInfo
|
||||
* @param dre
|
||||
* @param deadline
|
||||
*/
|
||||
public void sendChangeMessage(List<Map<String,Object>> paramsCollectManifestMapList,ParamsManifestEO paramsManifestEO,ParamsManifestVO projectInfo,String dre,Date deadline){
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(CollectionUtils.isNotEmpty(paramsCollectManifestMapList)){
|
||||
// 工程接口人
|
||||
Map<String, List<Map<String,Object>>> sdtGroupMap = paramsCollectManifestMapList.stream().collect(Collectors.groupingBy((m -> (m.get("sdt").toString()))));
|
||||
for (Map.Entry<String, List<Map<String, Object>>> sdtMap : sdtGroupMap.entrySet()) {
|
||||
String sdtUserName = sdtMap.getKey();
|
||||
|
||||
String nioNumbers = "";
|
||||
List<Map<String, Object>> value = sdtMap.getValue();
|
||||
for (Map<String, Object> map : value) {
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = JSONObject.parseObject(JSONObject.toJSONString(map.get("paramsCollectManifestEO")), ParamsCollectManifestEO.class);
|
||||
String nioNumber = paramsCollectManifestEO.getNioNumber();
|
||||
nioNumbers += nioNumber + ",";
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(nioNumbers)){
|
||||
nioNumbers = nioNumbers.substring(0,nioNumbers.length()-1);
|
||||
}
|
||||
|
||||
String cnContentUpper = "您参与填写的参数 " + nioNumbers + ",已被 " + currentUser.getUsername() + " 重新分发给 " + dre + "请及时查看。";
|
||||
String enContentUpper = "The parameter " + nioNumbers + " you distributed have been re-assigned to " + currentUser.getUsername() + " by " + dre;
|
||||
|
||||
// 消息内容
|
||||
SysUser sysUser = this.sysUserService.getUserByName(sdtUserName);
|
||||
String[] thirdIds = new String[1];
|
||||
thirdIds[0] = sysUser.getThirdId();
|
||||
String urlParamsStr = parseUrlParams(paramsManifestEO);
|
||||
String hrefFeishu = this.backUrl + "/ParameterItemCollection" + urlParamsStr;
|
||||
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.HOMO_PARAMETER_COLLECTION.getCn() + "/" + MessageType2Enum.HOMO_PARAMETER_COLLECTION.getEn());
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectInfo.getProjectName() +
|
||||
"\n发起人: " + currentUser.getUsername());
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectInfo.getProjectName() +
|
||||
"\nInitiator: " + currentUser.getUsername());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue());
|
||||
try {
|
||||
this.feishuService.sendCard(thirdIds, feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
// 修改前填写人
|
||||
Map<String, List<Map<String,Object>>> dreUpdateFrontGroupMap = paramsCollectManifestMapList.stream().collect(Collectors.groupingBy((m -> (m.get("dreUpdateFront").toString()))));
|
||||
for (Map.Entry<String, List<Map<String, Object>>> dreUpdateFrontMap : dreUpdateFrontGroupMap.entrySet()) {
|
||||
String dreUpdateFront = dreUpdateFrontMap.getKey();
|
||||
|
||||
String nioNumbers = "";
|
||||
List<Map<String, Object>> value = dreUpdateFrontMap.getValue();
|
||||
for (Map<String, Object> map : value) {
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = JSONObject.parseObject(JSONObject.toJSONString(map.get("paramsCollectManifestEO")), ParamsCollectManifestEO.class);
|
||||
String nioNumber = paramsCollectManifestEO.getNioNumber();
|
||||
nioNumbers += nioNumber + ",";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(nioNumbers)){
|
||||
nioNumbers = nioNumbers.substring(0,nioNumbers.length()-1);
|
||||
}
|
||||
|
||||
String cnContentUpper = "您参与填写的参数 " + nioNumbers + " 已被 "+ currentUser.getUsername() +" 撤回。";
|
||||
String enContentUpper = "The parameter " + nioNumbers + " you filled in have been withdrawn by "+ currentUser.getUsername();
|
||||
|
||||
// 消息内容
|
||||
SysUser sysUser = sysUserService.getUserByName(dreUpdateFront);
|
||||
String[] thirdIds = new String[1];
|
||||
thirdIds[0] = sysUser.getThirdId();
|
||||
String urlParamsStr = parseUrlParams(paramsManifestEO);
|
||||
String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr;
|
||||
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.HOMO_PARAMETER_COLLECTION.getCn() + "/" + MessageType2Enum.HOMO_PARAMETER_COLLECTION.getEn());
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectInfo.getProjectName() +
|
||||
"\n发起人: " + currentUser.getUsername());
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectInfo.getProjectName() +
|
||||
"\nInitiator: " + currentUser.getUsername());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue());
|
||||
try {
|
||||
this.feishuService.sendCard(thirdIds, feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// 修改后填写人
|
||||
Map<String, List<Map<String,Object>>> dreUpdateAfterGroupMap = paramsCollectManifestMapList.stream().collect(Collectors.groupingBy((m -> (m.get("dreUpdateAfter").toString()))));
|
||||
for (Map.Entry<String, List<Map<String, Object>>> dreUpdateAfterMap : dreUpdateAfterGroupMap.entrySet()) {
|
||||
String dreUpdateAfter = dreUpdateAfterMap.getKey();
|
||||
|
||||
// 消息内容
|
||||
SysUser sysUser = sysUserService.getUserByName(dreUpdateAfter);
|
||||
String[] thirdIds = new String[1];
|
||||
thirdIds[0] = sysUser.getThirdId();
|
||||
String urlParamsStr = parseUrlParams(paramsManifestEO);
|
||||
String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr;
|
||||
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.HOMO_PARAMETER_COLLECTION.getCn() + "/" + MessageType2Enum.HOMO_PARAMETER_COLLECTION.getEn());
|
||||
feishuMsgVo.setCnContentUpper("您好,"+ currentUser.getUsername() +"向您分发了认证参数填写任务,请及时处理。");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectInfo.getProjectName() +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(deadline));
|
||||
feishuMsgVo.setEnContentUpper("Hello! "+ currentUser.getUsername() +" has assigned the task of filling in Homo Parameter to you. Please address it in a timely manner.");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectInfo.getProjectName() +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(deadline));
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue());
|
||||
try {
|
||||
this.feishuService.sendCard(thirdIds, feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void deadlineDateMap(Map<String, List<String>> today, ParamsCollectManifestEO collectManifestEO, String thirdId) {
|
||||
List<String> stringList = today.get(thirdId);
|
||||
if (ObjectUtils.isEmpty(stringList)) {
|
||||
|
||||
+4
@@ -85,4 +85,8 @@ public class ParamsReportDetailLogEO implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String logContent;
|
||||
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String remarks;
|
||||
}
|
||||
|
||||
+3
-2
@@ -13,6 +13,7 @@
|
||||
<result column="params_report_id" property="paramsReportId" />
|
||||
<result column="params_report_detail_id" property="paramsReportDetailId" />
|
||||
<result column="log_Content" property="logContent" />
|
||||
<result column="remarks" property="remarks" />
|
||||
</resultMap>
|
||||
|
||||
<select id="listByReportIdOrReportDetailId" resultMap="ParamsReportDetailLogEOResultMap">
|
||||
@@ -29,7 +30,7 @@
|
||||
</select>
|
||||
|
||||
<select id="pageInfo" resultMap="ParamsReportDetailLogEOResultMap">
|
||||
select id, create_time, create_by, params_report_id, params_report_detail_id,
|
||||
select id, create_time, create_by, params_report_id, params_report_detail_id,remarks,
|
||||
<if test="cut == 'cn'">
|
||||
log_cn_content as log_Content
|
||||
</if>
|
||||
@@ -40,4 +41,4 @@
|
||||
where params_report_detail_id = #{paramsReportDetailId}
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
+5
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.cert.report.entity.ParamsReportConfigDataEO;
|
||||
import com.jero.modules.cert.report.entity.ParamsReportDetailEO;
|
||||
import com.jero.modules.cert.report.vo.ParamsReportDetailVO;
|
||||
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -68,4 +70,7 @@ public interface IParamsReportDetailEOService extends IService<ParamsReportDetai
|
||||
|
||||
// 引用参考列时的查询
|
||||
List<ParamsReportConfigDataEO> listInfoForReferencesCol(String paramsReportId, String paramsReportConfigId);
|
||||
|
||||
// 导出参数项历史Log信息
|
||||
void exportParamsReportDetailLog(String cut, XSSFWorkbook workbook, String sheetHistoryName, List<Map<String, Object>> allParamsInfoList, XSSFCellStyle headerCellStyle,XSSFCellStyle bodyCellStyle);
|
||||
}
|
||||
|
||||
+89
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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;
|
||||
@@ -38,6 +39,7 @@ import com.jero.modules.split.common.ReadExcel;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
@@ -137,6 +139,10 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
|
||||
List<Map<String, Object>> listMap = new ArrayList<>();
|
||||
list.forEach(collectManifestEO -> { // 参数收集清单
|
||||
|
||||
// 2022-12-12 上报库 参数项查看列表 备注设置为空。
|
||||
collectManifestEO.setRemarks(null);
|
||||
|
||||
// 处理数据字典字段 中英文切换 认证类型,责任领域
|
||||
List<String> certCategory = Arrays.asList(collectManifestEO.getCertCategory().split(","));
|
||||
List<String> dutyTerritory = Arrays.asList(collectManifestEO.getDutyTerritory().split(","));
|
||||
@@ -596,8 +602,10 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
String fileName = fileOriName + ".xlsx";
|
||||
// 设置表格相关属性
|
||||
String sheetName = "参数项信息";
|
||||
String sheetHistoryName = "历史记录";
|
||||
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
|
||||
sheetName = "Params data";
|
||||
sheetHistoryName = "historical Record";
|
||||
}
|
||||
XSSFSheet sheetItems = workbook.createSheet(sheetName);
|
||||
String[] titles = getWorkbookTitleForExport(paramsReportDetailVO); // 获取表头
|
||||
@@ -666,6 +674,8 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
|
||||
}
|
||||
|
||||
// 导出参数明细历史
|
||||
this.exportParamsReportDetailLog(paramsReportDetailVO.getCut(), workbook, sheetHistoryName, allParamsInfoList,cellStyle1,cellStyle);
|
||||
//下载关联文件内容
|
||||
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
|
||||
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
|
||||
@@ -710,6 +720,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
os.close(); // 后开先关
|
||||
fis.close(); // 先开后关
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage(), e);
|
||||
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
|
||||
throw new JeroBootException("Failed to download file, please try again");
|
||||
@@ -725,6 +736,79 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportParamsReportDetailLog(String cut, XSSFWorkbook workbook, String sheetHistoryName, List<Map<String, Object>> allParamsInfoList,XSSFCellStyle headerCellStyle,XSSFCellStyle bodyCellStyle) {
|
||||
// 处理历史log sheet里面的数据
|
||||
XSSFSheet sheetHistory = workbook.createSheet(sheetHistoryName);
|
||||
String[] historyHeaderArr = new String[]{"NIO编号","操作详情","备注","操作时间"};
|
||||
if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
|
||||
historyHeaderArr = new String[]{"NIO Number", "Operation Details", "Comments", "Operation Time"};
|
||||
}
|
||||
XSSFRow historyRowFirst = sheetHistory.createRow(0);
|
||||
for (int i = 0; i < historyHeaderArr.length; i++) {
|
||||
XSSFCell cell = historyRowFirst.createCell(i);
|
||||
XSSFRichTextString text = new XSSFRichTextString(historyHeaderArr[i]);
|
||||
cell.setCellValue(text);
|
||||
cell.setCellStyle(headerCellStyle);
|
||||
|
||||
// 设置单元格宽度
|
||||
String[] ParamsValueArr = new String[]{"操作详情","备注"};
|
||||
if (CutEnum.EN.getValue().equals(cut)) {
|
||||
ParamsValueArr = new String[]{"Operation Details","Comments"};
|
||||
}
|
||||
|
||||
String historyHeaderStr = historyHeaderArr[i];
|
||||
boolean widthFlag = false;
|
||||
for (int i1 = 0; i1 < ParamsValueArr.length; i1++) {
|
||||
if(StringUtils.equals(historyHeaderStr,ParamsValueArr[i1])){
|
||||
widthFlag = true;
|
||||
}
|
||||
}
|
||||
if(widthFlag){
|
||||
sheetHistory.setColumnWidth(i, 80 * 256);
|
||||
}else {
|
||||
sheetHistory.setColumnWidth(i, 20 * 256);
|
||||
}
|
||||
}
|
||||
// 查询历史log信息
|
||||
List<String> detailIdList = allParamsInfoList.stream().map(e -> e.get("id").toString()).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<ParamsReportDetailLogEO> detailLogQueryWrap = new QueryWrapper<>();
|
||||
detailLogQueryWrap.lambda().in(ParamsReportDetailLogEO::getParamsReportDetailId,detailIdList);
|
||||
detailLogQueryWrap.orderByDesc("params_report_detail_id");
|
||||
List<ParamsReportDetailLogEO> detailLogList = this.paramsReportDetailLogEOService.list(detailLogQueryWrap);
|
||||
if (CollectionUtils.isNotEmpty(detailLogList)) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
int historyRowNumber = 1;
|
||||
for (int i = 0; i < detailLogList.size(); i++) {
|
||||
String paramsReportDetailId = detailLogList.get(i).getParamsReportDetailId();
|
||||
|
||||
String nioNumber = allParamsInfoList.stream().filter(paramsInfo -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(paramsInfo.get("id").toString(),paramsReportDetailId)){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(e -> e.get("nio_number").toString()).distinct().collect(Collectors.toList()).get(0);
|
||||
String operatorDetails = detailLogList.get(i).getLogCnContent();
|
||||
String operatorTime = sdf.format(detailLogList.get(i).getCreateTime());
|
||||
if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
operatorDetails = detailLogList.get(i).getLogEnContent();
|
||||
}
|
||||
|
||||
XSSFRow row1 = sheetHistory.createRow(historyRowNumber);
|
||||
row1.createCell(0).setCellValue(nioNumber);
|
||||
row1.createCell(1).setCellValue(operatorDetails);
|
||||
row1.createCell(2).setCellValue(detailLogList.get(i).getRemarks());
|
||||
row1.createCell(3).setCellValue(operatorTime);
|
||||
for (int j = 0; j < 4; j++) {
|
||||
row1.getCell(j).setCellStyle(bodyCellStyle);
|
||||
}
|
||||
historyRowNumber ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getConfigLabelList(ParamsReportDetailVO paramsReportDetailVO) {
|
||||
String paramsManifestId = paramsReportDetailVO.getParamsManifestId();
|
||||
@@ -1730,10 +1814,15 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
}
|
||||
ParamsReportDetailLogEO insertLogEO = new ParamsReportDetailLogEO();
|
||||
if (logCnContent.toString().endsWith(",")) {
|
||||
String ramarks = "";
|
||||
if(map.get("remarks") != null){
|
||||
ramarks = map.get("remarks").toString();
|
||||
}
|
||||
insertLogEO.setLogCnContent(logCnContent.toString().substring(0, logCnContent.lastIndexOf(",")));
|
||||
insertLogEO.setLogEnContent(logEnContent.toString().substring(0, logEnContent.lastIndexOf(",")));
|
||||
insertLogEO.setParamsReportId(paramsManifestId);
|
||||
insertLogEO.setParamsReportDetailId(paramsCollectManifestId);
|
||||
insertLogEO.setRemarks(ramarks);
|
||||
insertLogEOList.add(insertLogEO);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user