未符合项

This commit is contained in:
caozhen
2023-09-21 15:32:24 +08:00
parent 0343fc5da7
commit 8bc8fececd
8 changed files with 81 additions and 21 deletions
@@ -40,6 +40,7 @@ public class ResultCommon {
public static final String THE_JOB_NUMBER_CANNOT_BE_EMPTY_EXPORT = "the.job.number.cannot.be.empty.export"; // 第{0}行,工号不能为空
public static final String JOB_NUMBER_DOES_NOT_EXIST_EXPORT = "job.number.does.not.exist.export"; // 第{0}行,工号不存在
public static final String DUPLICATE_JOB_NUMBER_EXPORT = "duplicate.job.number.export"; // 第{0}行,工号重复
public static final String CANNOT_CLOSE = "cannot.close"; // 不是待整改已过期的数据不能关闭
public static final String NO_CORRESPONDING_RECORD_FOUND = "no.corresponding.record.found"; // 没有找到对应的记录
@@ -10,6 +10,7 @@ import com.jero.modules.projectLibrary.service.ILawsEvaluationNotMetService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -19,14 +20,19 @@ import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
import org.apache.poi.ss.formula.functions.T;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Description: 评估未符合项条款
/**
* @Description: 未符合项
* @Author: jero-boot
* @Date: 2023-09-11
* @Version: V1.0
*/
@Api(tags="评估未符合项条款")
@Api(tags="未符合项")
@RestController
@RequestMapping("/projectLibrary/lawsEvaluationNotMet")
@Slf4j
@@ -37,8 +43,8 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
/**
* 分页列表查询
*/
@AutoLog(value = "评估未符合项条款-分页列表查询")
@ApiOperation(value="评估未符合项条款-分页列表查询", notes="评估未符合项条款-分页列表查询")
@AutoLog(value = "未符合项-分页列表查询")
@ApiOperation(value="未符合项-分页列表查询", notes="未符合项-分页列表查询")
@GetMapping(value = "/page")
public Result<IPage<LawsEvaluationNotMet>> queryPageList(LawsEvaluationNotMet lawsEvaluationNotMet,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@@ -51,8 +57,8 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
/**
* 添加
*/
@AutoLog(value = "评估未符合项条款-添加")
@ApiOperation(value="评估未符合项条款-添加", notes="评估未符合项条款-添加")
@AutoLog(value = "未符合项-添加")
@ApiOperation(value="未符合项-添加", notes="未符合项-添加")
@PostMapping(value = "/add")
public Result<T> add(@Validated @RequestBody LawsEvaluationNotMet lawsEvaluationNotMet) {
lawsEvaluationNotMetService.add(lawsEvaluationNotMet);
@@ -62,8 +68,8 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
/**
* 编辑
*/
@AutoLog(value = "评估未符合项条款-编辑")
@ApiOperation(value="评估未符合项条款-编辑", notes="评估未符合项条款-编辑")
@AutoLog(value = "未符合项-编辑")
@ApiOperation(value="未符合项-编辑", notes="未符合项-编辑")
@PostMapping(value = "/edit")
public Result<T> edit(@Validated @RequestBody LawsEvaluationNotMet lawsEvaluationNotMet) {
lawsEvaluationNotMetService.editById(lawsEvaluationNotMet);
@@ -75,8 +81,8 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
/**
* 通过id查询
*/
@AutoLog(value = "评估未符合项条款-通过id查询")
@ApiOperation(value="评估未符合项条款-通过id查询", notes="评估未符合项条款-通过id查询")
@AutoLog(value = "未符合项-通过id查询")
@ApiOperation(value="未符合项-通过id查询", notes="未符合项-通过id查询")
@GetMapping(value = "/queryById")
public Result<LawsEvaluationNotMet> queryById(@RequestParam(name="id",required=true) String id) {
LawsEvaluationNotMet lawsEvaluationNotMet = lawsEvaluationNotMetService.queryById(id);
@@ -86,12 +92,46 @@ public class LawsEvaluationNotMetController extends JeroController<LawsEvaluatio
return Result.OK(lawsEvaluationNotMet);
}
/**
/**
* 批量关闭
*/
@AutoLog(value = "未符合项-批量关闭")
@ApiOperation(value="未符合项-批量关闭", notes="项目库-批量关闭")
@PostMapping(value = "/batchClose")
public Result<T> batchClose(@RequestBody Map<String, String> map) {
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
}
List<String> ids = Arrays.asList(map.get("ids").split(","));
//检查所选数据是否均是待整改状态、当前时间大于预计整改完成日期
if (this.check(ids)) {
throw new JeroBootException(ResultCommon.CANNOT_CLOSE);
}
lawsEvaluationNotMetService.batchClose(ids);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
private boolean check(List<String> ids) {
Date date = new Date();
List<LawsEvaluationNotMet> notMets = lawsEvaluationNotMetService.listByIds(ids);
for (LawsEvaluationNotMet notMet : notMets) {
String state = notMet.getState();
Date expectedTime = notMet.getExpectedTime();
// 判断expectedTime是否小于今日
boolean isLessThanToday = expectedTime.before(date);
if (!state.equals("1") || !isLessThanToday){
return false;
}
}
return true;
}
/**
* 导出excel
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsEvaluationNotMet lawsEvaluationNotMet) {
return super.exportXls(request, lawsEvaluationNotMet, LawsEvaluationNotMet.class, "评估未符合项条款");
return super.exportXls(request, lawsEvaluationNotMet, LawsEvaluationNotMet.class, "未符合项");
}
}
@@ -102,8 +102,8 @@ public class LawsEvaluationNotMet implements Serializable {
/**整改状态(1-待整改、2-整改中、3-审批中、4-已完成)*/
@Dict(dicCode = "assess_rectification")
@Excel(name = "整改状态(1-待整改、2-整改中、3-审批中、4-已完成)", width = 15)
@ApiModelProperty(value = "整改状态(1-待整改、2-整改中、3-审批中、4-已完成)")
@Excel(name = "整改状态(1-待整改、2-整改中、3-审批中、4-已完成、5-已关闭)", width = 15)
@ApiModelProperty(value = "整改状态(1-待整改、2-整改中、3-审批中、4-已完成、5-已关闭)")
private String state;
/**创建人*/
@@ -73,4 +73,6 @@ public interface ILawsEvaluationNotMetService extends IService<LawsEvaluationNot
* @return
*/
LawsEvaluationNotMet queryById(String id);
void batchClose(List<String> ids);
}
@@ -1,6 +1,7 @@
package com.jero.modules.projectLibrary.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.modules.projectLibrary.entity.LawsEvaluationNotMet;
import com.jero.modules.projectLibrary.mapper.LawsEvaluationNotMetMapper;
import com.jero.modules.projectLibrary.service.ILawsEvaluationNotMetService;
@@ -115,4 +116,15 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
public LawsEvaluationNotMet queryById(String id) {
return getById(id);
}
@Override
public void batchClose(List<String> ids) {
if (ids == null || ids.isEmpty()){
return;
}
LambdaUpdateWrapper<LawsEvaluationNotMet> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(LawsEvaluationNotMet::getState, "5");
wrapper.in(LawsEvaluationNotMet::getId, ids);
update(wrapper);
}
}
@@ -35,6 +35,7 @@ please.select.a.workgroup.for.export=please select a workgroup for export
the.job.number.cannot.be.empty.export=Line {0},job number cannot be empty
job.number.does.not.exist.export=Line {0},job number does not exist
duplicate.job.number.export=Line {0},duplicate job number
cannot.close=Expired data that is not pending rectification cannot be closed
no.corresponding.record.found=\u672A\u627E\u5230\u5BF9\u5E94\u8BB0\u5F55
parameters.cannot.be.null=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A
@@ -36,10 +36,12 @@ please.select.a.workgroup.for.export=please select a workgroup for export
the.job.number.cannot.be.empty.export=Line {0},job number cannot be empty
job.number.does.not.exist.export=Line {0},job number does not exist
duplicate.job.number.export=Line {0},duplicate job number
cannot.close=Expired data that is not pending rectification cannot be closed
no.corresponding.record.found=No corresponding record found
parameters.cannot.be.null=Parameters cannot be null
root.node.cannot.be.edited=Root node cannot be edited
horizontal.transgression=Horizontal overstepping of authority
select.level.two.tree.node=Please select a level 2 or lower system first
select.level.two.tree.node=Please select a level 2 or lower system first
@@ -12,10 +12,10 @@ message.empty.source=\u6765\u6E90\u4E0D\u80FD\u4E3A\u7A7A
message.empty.common={0}\u4E0D\u80FD\u4E3A\u7A7A
message.empty.standard.number=\u6807\u51C6\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A
message.empty.standard.name=\u6807\u51C6\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A
message.exists.standard.number=标准编号已经存在
message.no.exists.param=参数{0}不存在
message.no.permission=没有数据操作权限
message.select.data=请选择数据
message.exists.standard.number=\u6807\u51C6\u7F16\u53F7\u5DF2\u7ECF\u5B58\u5728
message.no.exists.param=\u53C2\u6570{0}\u4E0D\u5B58\u5728
message.no.permission=\u6CA1\u6709\u6570\u636E\u64CD\u4F5C\u6743\u9650
message.select.data=\u8BF7\u9009\u62E9\u6570\u636E
successfully.cleared=\u6E05\u9664\u6210\u529F
successfully.deleted.in.bulk=\u6279\u91CF\u5220\u9664\u6210\u529F
@@ -35,10 +35,12 @@ please.select.a.workgroup.for.export=\u8BF7\u9009\u62E9\u5DE5\u4F5C\u7EC4\u8FDB\
the.job.number.cannot.be.empty.export=\u7B2C{0}\u884C,\u5DE5\u53F7\u4E0D\u80FD\u4E3A\u7A7A
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
cannot.close=\u4E0D\u662F\u5F85\u6574\u6539\u5DF2\u8FC7\u671F\u7684\u6570\u636E\u4E0D\u80FD\u5173\u95ED
no.corresponding.record.found=\u672A\u627E\u5230\u5BF9\u5E94\u8BB0\u5F55
parameters.cannot.be.null=\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A
root.node.cannot.be.edited=\u6839\u8282\u70B9\u65E0\u6CD5\u7F16\u8F91
horizontal.transgression=\u6C34\u5E73\u8D8A\u6743
select.level.two.tree.node=\u8BF7\u5148\u9009\u62E9\u4E8C\u7EA7\u53CA\u4EE5\u4E0B\u4F53\u7CFB
select.level.two.tree.node=\u8BF7\u5148\u9009\u62E9\u4E8C\u7EA7\u53CA\u4EE5\u4E0B\u4F53\u7CFB