修改代码中"0"、"1"等改为静态常量
This commit is contained in:
+8
-7
@@ -11,6 +11,7 @@ import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
@@ -71,7 +72,7 @@ public class LawsAssessController extends JeroController<LawsAssess, ILawsAssess
|
||||
if (StringUtils.isBlank(projectId)){
|
||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||
}
|
||||
lawsAssess.setDelFlag("0");
|
||||
lawsAssess.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
IPage<LawsAssess> pageList = lawsAssessService.queryPage(lawsAssess, pageNo, pageSize, req);
|
||||
this.assignment(pageList.getRecords());
|
||||
return Result.OK(pageList);
|
||||
@@ -80,7 +81,7 @@ public class LawsAssessController extends JeroController<LawsAssess, ILawsAssess
|
||||
for (LawsAssess assess : records) {
|
||||
String standardId = assess.getStandardId();
|
||||
String source = assess.getSource();
|
||||
if ("1".equals(source)){
|
||||
if (CommonConstant.STANDARD_SOURCE_1.equals(source)){
|
||||
//查询国内标准数据,赋值给collection
|
||||
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(standardId);
|
||||
assess.setStandardEnglishName(standard.getStandardEnglishName());
|
||||
@@ -91,7 +92,7 @@ public class LawsAssessController extends JeroController<LawsAssess, ILawsAssess
|
||||
assess.setEvaluationResults("这里要用额外方法查询");
|
||||
assess.setResponsibleDepartment(standard.getResponsibleDepartment());
|
||||
}
|
||||
if ("2".equals(source)){
|
||||
if (CommonConstant.STANDARD_SOURCE_2.equals(source)){
|
||||
//查询海外标准数据,赋值给collection
|
||||
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(standardId);
|
||||
assess.setStandardEnglishName(standard.getStandardEnglishName());
|
||||
@@ -137,14 +138,14 @@ public class LawsAssessController extends JeroController<LawsAssess, ILawsAssess
|
||||
if (allByProjectIdDeletedIdList.contains(id)){
|
||||
//如果已删除则恢复未删除状态
|
||||
LawsAssess lawsAssess = lawsAssessService.getById(id);
|
||||
lawsAssess.setDelFlag("0");
|
||||
lawsAssess.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
lawsAssess.setCreateTime(now);
|
||||
lawsAssess.setUpdateTime(now);
|
||||
lawsAssessService.updateById(lawsAssess);
|
||||
continue;
|
||||
}
|
||||
LawsAssess lawsAssess = new LawsAssess();
|
||||
lawsAssess.setSource("1");
|
||||
lawsAssess.setSource(CommonConstant.STANDARD_SOURCE_1);
|
||||
lawsAssess.setProjectId(lawsAssessAddVo.getProjectId());
|
||||
lawsAssess.setStandardId(id);
|
||||
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(id);
|
||||
@@ -166,7 +167,7 @@ public class LawsAssessController extends JeroController<LawsAssess, ILawsAssess
|
||||
if (allByProjectIdDeletedIdList.contains(id)){
|
||||
//如果已删除则恢复未删除状态
|
||||
LawsAssess lawsAssess = lawsAssessService.getById(id);
|
||||
lawsAssess.setDelFlag("0");
|
||||
lawsAssess.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
lawsAssess.setCreateTime(now);
|
||||
lawsAssess.setUpdateTime(now);
|
||||
lawsAssessService.updateById(lawsAssess);
|
||||
@@ -217,7 +218,7 @@ public class LawsAssessController extends JeroController<LawsAssess, ILawsAssess
|
||||
if (allByProjectIdDeletedIdList.contains(standardId)){
|
||||
//如果已删除则恢复未删除状态
|
||||
LawsAssess assess = lawsAssessService.getById(standardId);
|
||||
assess.setDelFlag("0");
|
||||
assess.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
assess.setCreateTime(now);
|
||||
assess.setUpdateTime(now);
|
||||
lawsAssessService.updateById(assess);
|
||||
|
||||
+4
-3
@@ -12,6 +12,7 @@ import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
@@ -63,7 +64,7 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
lawsProjectLibrary.setDelFlag("0");
|
||||
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
IPage<LawsProjectLibrary> pageList = lawsProjectLibraryService.queryPage(lawsProjectLibrary, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
@@ -76,7 +77,7 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
||||
@ApiOperation(value="项目库-添加", notes="项目库-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<T> add(@Validated @RequestBody LawsProjectLibrary lawsProjectLibrary) {
|
||||
lawsProjectLibrary.setDelFlag("0");
|
||||
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
lawsProjectLibraryService.add(lawsProjectLibrary);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
@@ -158,7 +159,7 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
||||
if (StringUtils.isNotBlank(selections)){
|
||||
dos = lawsProjectLibraryService.listByIds(Arrays.asList(selections.split(",")));
|
||||
}else {
|
||||
lawsProjectLibrary.setDelFlag("0");
|
||||
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||
QueryWrapper<LawsProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProjectLibrary, request.getParameterMap());
|
||||
dos = lawsProjectLibraryService.list(queryWrapper);
|
||||
}
|
||||
|
||||
+4
-3
@@ -2,6 +2,7 @@ package com.jero.modules.projectLibrary.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.modules.projectLibrary.entity.LawsAssess;
|
||||
import com.jero.modules.projectLibrary.mapper.LawsAssessMapper;
|
||||
import com.jero.modules.projectLibrary.service.ILawsAssessService;
|
||||
@@ -96,7 +97,7 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
LawsAssess lawsAssess = getById(id);
|
||||
lawsAssess.setDelFlag("1");
|
||||
lawsAssess.setDelFlag(CommonConstant.DEL_FLAG_1.toString());
|
||||
updateById(lawsAssess);
|
||||
}
|
||||
|
||||
@@ -118,7 +119,7 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
|
||||
}
|
||||
LambdaQueryWrapper<LawsAssess> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsAssess::getProjectId, projectId);
|
||||
wrapper.eq(LawsAssess::getDelFlag, "0");
|
||||
wrapper.eq(LawsAssess::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
||||
return list(wrapper);
|
||||
}
|
||||
|
||||
@@ -129,7 +130,7 @@ public class LawsAssessServiceImpl extends ServiceImpl<LawsAssessMapper, LawsAss
|
||||
}
|
||||
LambdaQueryWrapper<LawsAssess> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(LawsAssess::getProjectId, projectId);
|
||||
wrapper.eq(LawsAssess::getDelFlag, "1");
|
||||
wrapper.eq(LawsAssess::getDelFlag, CommonConstant.DEL_FLAG_1.toString());
|
||||
return list(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -2,6 +2,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.common.constant.CommonConstant;
|
||||
import com.jero.modules.projectLibrary.entity.LawsProjectLibrary;
|
||||
import com.jero.modules.projectLibrary.mapper.LawsProjectLibraryMapper;
|
||||
import com.jero.modules.projectLibrary.service.ILawsProjectLibraryService;
|
||||
@@ -87,7 +88,7 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
LawsProjectLibrary projectLibrary = getById(id);
|
||||
projectLibrary.setDelFlag("1");
|
||||
projectLibrary.setDelFlag(CommonConstant.DEL_FLAG_1.toString());
|
||||
updateById(projectLibrary);
|
||||
}
|
||||
|
||||
@@ -98,7 +99,7 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
|
||||
public void deleteByIds(List<String> ids) {
|
||||
LambdaUpdateWrapper<LawsProjectLibrary> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.in(LawsProjectLibrary::getId, ids);
|
||||
wrapper.set(LawsProjectLibrary::getDelFlag, "1");
|
||||
wrapper.set(LawsProjectLibrary::getDelFlag, CommonConstant.DEL_FLAG_1.toString());
|
||||
update(wrapper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user