fix: 不符合项库批量关闭

This commit is contained in:
2024-06-26 09:46:19 +08:00
parent 3bb67a7cef
commit 6445cc51a7
8 changed files with 46 additions and 31 deletions
@@ -62,9 +62,9 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
@AutoLog(value = "不符合项-批量关闭") @AutoLog(value = "不符合项-批量关闭")
@ApiOperation(value="不符合项-批量关闭", notes="项目库-批量关闭") @ApiOperation(value="不符合项-批量关闭", notes="项目库-批量关闭")
@PostMapping(value = "/batchClose") @PostMapping(value = "/batchClose")
public Result<T> batchClose(@RequestBody IdsMapBody body) { public Result<T> batchClose(@RequestBody LawsEvaluationNotMetLibrary lawsEvaluationNotMet) {
String ids = body.getIds(); String ids = lawsEvaluationNotMet.getIds();
if(StringUtils.isEmpty(ids)){ if (StringUtils.isEmpty(ids)){
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA); throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
} }
List<String> idList = Arrays.asList(ids.split(",")); List<String> idList = Arrays.asList(ids.split(","));
@@ -72,7 +72,7 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
if (!this.check(idList)) { if (!this.check(idList)) {
throw new JeroBootException(ResultCommon.CANNOT_CLOSE); throw new JeroBootException(ResultCommon.CANNOT_CLOSE);
} }
lawsEvaluationNotMetLibraryService.batchClose(idList); lawsEvaluationNotMetLibraryService.batchClose(idList, lawsEvaluationNotMet);
return Result.OK(ResultCommon.OK); return Result.OK(ResultCommon.OK);
} }
@@ -81,9 +81,7 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
for (LawsEvaluationNotMetLibrary notMet : notMets) { for (LawsEvaluationNotMetLibrary notMet : notMets) {
String state = notMet.getRectifyStatus(); String state = notMet.getRectifyStatus();
//判断是否是待整改,超期,警示 //判断是否是待整改,超期,警示
if (!state.equals(AssessCommon.TO_BE_RECTIFIED) if (!state.equals(AssessCommon.TO_BE_RECTIFIED)) {
&& !state.equals(AssessCommon.WARNING)
&& !state.equals(AssessCommon.OVERDUE)) {
return false; return false;
} }
} }
@@ -231,6 +231,12 @@ public class LawsEvaluationNotMetLibrary implements Serializable {
@Excel(name = "标准编号", width = 15, orderNum = "4") @Excel(name = "标准编号", width = 15, orderNum = "4")
private String standardName; private String standardName;
/**
* 关闭用主键ids
*/
@TableField(exist = false)
@ApiModelProperty(value = "关闭用主键ids")
private String ids;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -3,10 +3,7 @@ package com.jero.modules.assessmentLibrary.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.modules.assessmentLibrary.entity.LawsEvaluationNotMetLibrary; import com.jero.modules.assessmentLibrary.entity.LawsEvaluationNotMetLibrary;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.laws.enterprise.entity.dto.ESPlanQueryDTO;
import com.jero.modules.projectLibrary.entity.LawsEvaluationNotMet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
@@ -27,7 +24,19 @@ public interface ILawsEvaluationNotMetLibraryService extends IService<LawsEvalua
*/ */
IPage<LawsEvaluationNotMetLibrary> queryPage(LawsEvaluationNotMetLibrary lawsEvaluationNotMet, Integer pageNo, Integer pageSize); IPage<LawsEvaluationNotMetLibrary> queryPage(LawsEvaluationNotMetLibrary lawsEvaluationNotMet, Integer pageNo, Integer pageSize);
void batchClose(List<String> ids); /**
* 批量关闭
* @param ids
* @param lawsEvaluationNotMet
*/
void batchClose(List<String> ids, LawsEvaluationNotMetLibrary lawsEvaluationNotMet);
/**
* 导出
* @param response
* @param lawsEvaluationNotMet
* @param fileName
* @param sheetName
*/
void export(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet, String fileName, String sheetName); void export(HttpServletResponse response, LawsEvaluationNotMetLibrary lawsEvaluationNotMet, String fileName, String sheetName);
} }
@@ -1,5 +1,6 @@
package com.jero.modules.assessmentLibrary.service.impl; package com.jero.modules.assessmentLibrary.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -60,12 +61,18 @@ public class LawsEvaluationNotMetLibraryServiceImpl extends ServiceImpl<LawsEval
} }
@Override @Override
public void batchClose(List<String> ids) { public void batchClose(List<String> ids, LawsEvaluationNotMetLibrary lawsEvaluationNotMet) {
if (ids == null || ids.isEmpty()) { if (ids == null || ids.isEmpty()) {
return; return;
} }
LambdaUpdateWrapper<LawsEvaluationNotMetLibrary> wrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<LawsEvaluationNotMetLibrary> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(LawsEvaluationNotMetLibrary::getRectifyStatus, AssessCommon.CLOSED); wrapper.set(LawsEvaluationNotMetLibrary::getRectifyStatus, AssessCommon.CLOSED);
wrapper.set(StrUtil.isNotBlank(lawsEvaluationNotMet.getPcrNo()),
LawsEvaluationNotMetLibrary::getPcrNo, lawsEvaluationNotMet.getPcrNo());
wrapper.set(null != lawsEvaluationNotMet.getRectifyCompleteDate(),
LawsEvaluationNotMetLibrary::getRectifyCompleteDate, lawsEvaluationNotMet.getRectifyCompleteDate());
wrapper.set(StrUtil.isNotBlank(lawsEvaluationNotMet.getFile()),
LawsEvaluationNotMetLibrary::getFile, lawsEvaluationNotMet.getFile());
wrapper.in(LawsEvaluationNotMetLibrary::getId, ids); wrapper.in(LawsEvaluationNotMetLibrary::getId, ids);
update(wrapper); update(wrapper);
} }
@@ -5,6 +5,16 @@ package com.jero.modules.projectLibrary.common;
* @date 2023-12-22 14:19 * @date 2023-12-22 14:19
*/ */
public class AssessCommon { public class AssessCommon {
/**
* 待整改
*/
public final static String TO_BE_RECTIFIED = "1";
/**
* 已关闭
*/
public final static String CLOSED = "2";
/** /**
* 未评估 * 未评估
*/ */
@@ -35,10 +45,7 @@ public class AssessCommon {
*/ */
public final static String NOT_INVOLVED = "4"; public final static String NOT_INVOLVED = "4";
/**
* 待整改
*/
public final static String TO_BE_RECTIFIED = "1";
/** /**
* 整改中 * 整改中
*/ */
@@ -47,14 +54,6 @@ public class AssessCommon {
* 审批中 * 审批中
*/ */
public final static String UNDER_APPROVAL = "3"; public final static String UNDER_APPROVAL = "3";
/**
* 已完成
*/
public final static String DONE = "4";
/**
* 已关闭
*/
public final static String CLOSED = "5";
/** /**
* 警示 * 警示
*/ */
@@ -63,8 +62,4 @@ public class AssessCommon {
* 超期 * 超期
*/ */
public final static String OVERDUE = "7"; public final static String OVERDUE = "7";
} }
@@ -36,7 +36,7 @@ the.job.number.cannot.be.empty.export=Line {0},job number cannot be empty
the.real.name.cannot.be.empty.export=Line {0},real name cannot be empty the.real.name.cannot.be.empty.export=Line {0},real name cannot be empty
job.number.does.not.exist.export=Line {0},job number does not exist job.number.does.not.exist.export=Line {0},job number does not exist
duplicate.job.number.export=Line {0},duplicate job number duplicate.job.number.export=Line {0},duplicate job number
cannot.close=\u4E0D\u662F\u5F85\u6574\u6539\u3001\u8B66\u793A\u6216\u8D85\u671F\u72B6\u6001\u7684\u6570\u636E\u4E0D\u80FD\u5173\u95ED cannot.close=\u4E0D\u662F\u5F85\u6574\u6539\u72B6\u6001\u7684\u6570\u636E\u4E0D\u80FD\u5173\u95ED
no.corresponding.record.found=\u672A\u627E\u5230\u5BF9\u5E94\u8BB0\u5F55 no.corresponding.record.found=\u672A\u627E\u5230\u5BF9\u5E94\u8BB0\u5F55
parameters.cannot.be.null=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A parameters.cannot.be.null=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A
@@ -38,7 +38,7 @@ the.job.number.cannot.be.empty.export=Line {0},job number cannot be empty
the.real.name.cannot.be.empty.export=Line {0},real name cannot be empty the.real.name.cannot.be.empty.export=Line {0},real name cannot be empty
job.number.does.not.exist.export=Line {0},job number does not exist job.number.does.not.exist.export=Line {0},job number does not exist
duplicate.job.number.export=Line {0},duplicate job number duplicate.job.number.export=Line {0},duplicate job number
cannot.close=Data that is not pending rectification, warning, or overdue cannot be closed cannot.close=Data that is not pending rectification cannot be closed
@@ -37,7 +37,7 @@ the.job.number.cannot.be.empty.export=\u7B2C{0}\u884C,\u5DE5\u53F7\u4E0D\u80FD\u
the.real.name.cannot.be.empty.export=\u7B2C{0}\u884C,\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A the.real.name.cannot.be.empty.export=\u7B2C{0}\u884C,\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A
job.number.does.not.exist.export=\u7B2C{0}\u884C,\u5DE5\u53F7\u4E0D\u5B58\u5728 job.number.does.not.exist.export=\u7B2C{0}\u884C,\u5DE5\u53F7\u4E0D\u5B58\u5728
duplicate.job.number.export=\u7B2C{0}\u884C,\u5DE5\u53F7\u91CD\u590D duplicate.job.number.export=\u7B2C{0}\u884C,\u5DE5\u53F7\u91CD\u590D
cannot.close=\u4E0D\u662F\u5F85\u6574\u6539\u3001\u8B66\u793A\u6216\u8D85\u671F\u72B6\u6001\u7684\u6570\u636E\u4E0D\u80FD\u5173\u95ED cannot.close=\u4E0D\u662F\u5F85\u6574\u6539\u7684\u6570\u636E\u4E0D\u80FD\u5173\u95ED