|
@@ -192,7 +192,7 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
infoMapper.deleteById(report.getReportNewLineId());
|
|
|
//删除新建行下的文件信息
|
|
|
//删除work_attachment_id信息
|
|
|
- attachmentMapper.deleteByAttachMnentId(report.getReportNewLineId());
|
|
|
+// attachmentMapper.deleteByAttachMnentId(report.getReportNewLineId());
|
|
|
//根据新建行id找到报告管理表id
|
|
|
CwProjectInfoData newLineInfo = infoMapper.getNewLineInfoById(report.getReportNewLineId());
|
|
|
if (StringUtils.isNotEmpty(newLineInfo.getReportId())){
|
|
@@ -313,21 +313,22 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
|
|
|
public ResponseEntity deleteByIds(String ids) {
|
|
|
String idArray[] =ids.split(",");
|
|
|
- //删除前先将报告文号给复原
|
|
|
+ //删除前先将报告文号以及相关信息给复原
|
|
|
ArrayList<String> strings = Lists.newArrayList(idArray);
|
|
|
-// for (int i=0;i<strings.size();i++){
|
|
|
-// //修改新建行的del_flag为0,delete_sign为0
|
|
|
-// ReportCancellApply cancellApply = applyMapper.selectById(strings.get(i));
|
|
|
-// CwProjectInfoData infoData = infoMapper.getById(cancellApply.getReportNewLineId());
|
|
|
-// infoData.setDelFlag(0);
|
|
|
-// infoData.setDeleteSign("0");
|
|
|
-// infoMapper.updateById(infoData);
|
|
|
-// ReportInfoDto reportInfoDto = applyMapper.queryById(strings.get(i));
|
|
|
-// cancelMapper.deleteByReportNo(reportInfoDto.getReportNo());
|
|
|
-// }
|
|
|
- //将报告文号报废表的对应的报告文号给删除
|
|
|
-
|
|
|
- this.removeByIds (Lists.newArrayList (idArray));
|
|
|
+ strings.stream().forEach(cancId->{
|
|
|
+ // 根据作废数据id查询作废信息
|
|
|
+ ReportCancellApply byId = this.getById(cancId);
|
|
|
+ // 根据new_line表id复原新建行new_line表的信息
|
|
|
+ infoMapper.saveById(byId.getReportNewLineId());
|
|
|
+ // 根据new_line表id找到报告管理表id
|
|
|
+ CwProjectInfoData newLineInfo = infoMapper.getNewLineInfoById(byId.getReportNewLineId());
|
|
|
+ //根据报告管理表id复原报告管理表数据
|
|
|
+ reportMapper.saveById(newLineInfo.getReportId());
|
|
|
+ //存放报废报告号表中删除复原的数据(cw_project_report_cancel)根据报告文号
|
|
|
+ cancelMapper.deleteByReportNo(newLineInfo.getReportNo());
|
|
|
+ });
|
|
|
+ // 根据id删除作废表中的数据(cw_project_report_cancell_apply)(根据id批量删除)
|
|
|
+ this.removeByIds (strings);
|
|
|
return ResponseEntity.ok ("删除成功");
|
|
|
}
|
|
|
|