|
@@ -81,8 +81,8 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
if (StringUtils.isNotEmpty(projectReportData.getProjectName())) {
|
|
|
queryWrapper.like("b.project_name", projectReportData.getProjectName());
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(projectReportData.getProjectMasterName())) {
|
|
|
- queryWrapper.like("e.name", projectReportData.getProjectMasterName());
|
|
|
+ if (StringUtils.isNotEmpty(projectReportData.getProjectMasterId())) {
|
|
|
+ queryWrapper.eq("d.project_master_id", projectReportData.getProjectMasterId());
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(projectReportData.getCreateBy().getId())) {
|
|
|
queryWrapper.like("a.create_by", projectReportData.getCreateBy().getId());
|
|
@@ -149,6 +149,17 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
//删除新建行下的文件信息
|
|
|
//删除work_attachment_id信息
|
|
|
attachmentMapper.deleteByAttachMnentId(report.getReportNewLineId());
|
|
|
+ //根据新建行id找到报告管理表id
|
|
|
+ CwProjectInfoData newLineInfo = infoMapper.getNewLineInfoById(report.getReportNewLineId());
|
|
|
+ if (StringUtils.isNotEmpty(newLineInfo.getReportId())){
|
|
|
+ //根据报告管理id去新建行表中查数据,当没有数据的时候,报告表该条数据逻辑删除
|
|
|
+ int count = infoMapper.getCountByReportId(newLineInfo.getReportId());
|
|
|
+ if (count == 0){
|
|
|
+ //当没有数据的时候删除报告管理信息
|
|
|
+ reportMapper.deleteById(newLineInfo.getReportId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//向存放报废报告号表中添加数据
|
|
|
CwProjectReportCancel cancel = new CwProjectReportCancel();
|
|
|
cancel.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
@@ -226,7 +237,9 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
*/
|
|
|
public IPage<ReportInfoDto> findList(Page<ReportInfoDto> page, ReportInfoDto reportInfoDto) throws Exception{
|
|
|
QueryWrapper<ReportInfoDto> queryWrapper = QueryWrapperGenerator.buildQueryCondition (reportInfoDto,ReportInfoDto.class);
|
|
|
-
|
|
|
+ //获取当前登录人信息
|
|
|
+ UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ queryWrapper.eq("a.create_by",userDTO.getId());
|
|
|
queryWrapper.eq("a.del_flag","0");
|
|
|
queryWrapper.eq("a.status","5");
|
|
|
queryWrapper.eq("b.delete_sign","0");
|
|
@@ -243,16 +256,16 @@ public class ReportCancellApplyService extends ServiceImpl<ReportCancellApplyMap
|
|
|
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());
|
|
|
- }
|
|
|
+// 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));
|