整理代码、修改登录接口使用密文传输
This commit is contained in:
@@ -3,7 +3,6 @@ package com.njcn.gather.device.controller;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
@@ -15,7 +14,6 @@ import com.njcn.common.utils.LogUtil;
|
|||||||
import com.njcn.gather.device.pojo.param.PqDevParam;
|
import com.njcn.gather.device.pojo.param.PqDevParam;
|
||||||
import com.njcn.gather.device.pojo.po.PqDev;
|
import com.njcn.gather.device.pojo.po.PqDev;
|
||||||
import com.njcn.gather.device.pojo.vo.PqDevVO;
|
import com.njcn.gather.device.pojo.vo.PqDevVO;
|
||||||
import com.njcn.gather.device.pojo.vo.PreDetection;
|
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
import com.njcn.gather.type.pojo.po.DevType;
|
import com.njcn.gather.type.pojo.po.DevType;
|
||||||
import com.njcn.gather.type.service.IDevTypeService;
|
import com.njcn.gather.type.service.IDevTypeService;
|
||||||
@@ -33,8 +31,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -79,14 +75,14 @@ public class PqDevController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增被检设备")
|
@ApiOperation("新增被检设备")
|
||||||
@ApiImplicitParam(name = "pqDevParam", value = "被检设备", required = true)
|
@ApiImplicitParam(name = "pqDevParam", value = "被检设备", required = true)
|
||||||
public HttpResult<Object> add(@RequestBody @Validated PqDevParam pqDevParam) {
|
public HttpResult<Boolean> add(@RequestBody @Validated PqDevParam pqDevParam) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, pqDevParam);
|
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, pqDevParam);
|
||||||
boolean result = pqDevService.addPqDev(pqDevParam);
|
boolean result = pqDevService.addPqDev(pqDevParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,14 +90,14 @@ public class PqDevController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改被检设备")
|
@ApiOperation("修改被检设备")
|
||||||
@ApiImplicitParam(name = "updateParam", value = "被检设备", required = true)
|
@ApiImplicitParam(name = "updateParam", value = "被检设备", required = true)
|
||||||
public HttpResult<Object> update(@RequestBody @Validated PqDevParam.UpdateParam updateParam) {
|
public HttpResult<Boolean> update(@RequestBody @Validated PqDevParam.UpdateParam updateParam) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, updateParam);
|
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, updateParam);
|
||||||
boolean result = pqDevService.updatePqDev(updateParam);
|
boolean result = pqDevService.updatePqDev(updateParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,14 +105,14 @@ public class PqDevController extends BaseController {
|
|||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除被检设备")
|
@ApiOperation("删除被检设备")
|
||||||
@ApiImplicitParam(name = "ids", value = "被检设备id", required = true)
|
@ApiImplicitParam(name = "ids", value = "被检设备id", required = true)
|
||||||
public HttpResult<Object> delete(@RequestBody @Validated PqDevParam.DeleteParam param) {
|
public HttpResult<Boolean> delete(@RequestBody @Validated PqDevParam.DeleteParam param) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, param.getIds()));
|
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, param.getIds()));
|
||||||
boolean result = pqDevService.deletePqDev(param);
|
boolean result = pqDevService.deletePqDev(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,20 @@ public interface PqDevMapper extends MPJBaseMapper<PqDev> {
|
|||||||
|
|
||||||
void updateReportState(@Param("id")String id);
|
void updateReportState(@Param("id")String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改检测计划的检测结果
|
||||||
|
*
|
||||||
|
* @param planId
|
||||||
|
* @param checkResult
|
||||||
|
*/
|
||||||
void updatePlanCheckResult(@Param("planId")String planId, @Param("checkResult")Integer checkResult);
|
void updatePlanCheckResult(@Param("planId")String planId, @Param("checkResult")Integer checkResult);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改检测计划的检测状态
|
||||||
|
*
|
||||||
|
* @param planId
|
||||||
|
* @param testState
|
||||||
|
*/
|
||||||
void updatePlanTestState(@Param("planId")String planId, @Param("testState")Integer testState);
|
void updatePlanTestState(@Param("planId")String planId, @Param("testState")Integer testState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
.set(PqDev::getReCheckNum, i)
|
.set(PqDev::getReCheckNum, i)
|
||||||
.set(PqDev::getCheckState, checkState)
|
.set(PqDev::getCheckState, checkState)
|
||||||
.set(PqDev::getCheckResult, result.get(pqDev.getId()))
|
.set(PqDev::getCheckResult, result.get(pqDev.getId()))
|
||||||
.set(PqDev::getCheckBy, RequestUtil.getUserName())
|
.set(PqDev::getCheckBy, RequestUtil.getUserId())
|
||||||
.set(PqDev::getCheckTime, LocalDateTime.now())
|
.set(PqDev::getCheckTime, LocalDateTime.now())
|
||||||
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
||||||
.eq(PqDev::getId, pqDev.getId()));
|
.eq(PqDev::getId, pqDev.getId()));
|
||||||
|
|||||||
@@ -63,14 +63,14 @@ public class PqErrSysController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增误差体系")
|
@ApiOperation("新增误差体系")
|
||||||
@ApiImplicitParam(name = "param", value = "误差体系", required = true)
|
@ApiImplicitParam(name = "param", value = "误差体系", required = true)
|
||||||
public HttpResult<Object> add(@RequestBody @Validated PqErrSysParam param) {
|
public HttpResult<Boolean> add(@RequestBody @Validated PqErrSysParam param) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
||||||
boolean result = pqErrSysService.addPqErrSys(param);
|
boolean result = pqErrSysService.addPqErrSys(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,14 +78,14 @@ public class PqErrSysController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改误差体系")
|
@ApiOperation("修改误差体系")
|
||||||
@ApiImplicitParam(name = "param", value = "误差体系", required = true)
|
@ApiImplicitParam(name = "param", value = "误差体系", required = true)
|
||||||
public HttpResult<Object> update(@RequestBody @Validated PqErrSysParam.UpdateParam param) {
|
public HttpResult<Boolean> update(@RequestBody @Validated PqErrSysParam.UpdateParam param) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
||||||
boolean result = pqErrSysService.updatePqErrSys(param);
|
boolean result = pqErrSysService.updatePqErrSys(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,14 +93,14 @@ public class PqErrSysController extends BaseController {
|
|||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除误差体系")
|
@ApiOperation("删除误差体系")
|
||||||
@ApiImplicitParam(name = "ids", value = "误差体系id", required = true)
|
@ApiImplicitParam(name = "ids", value = "误差体系id", required = true)
|
||||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
boolean result = pqErrSysService.deletePqErrSys(ids);
|
boolean result = pqErrSysService.deletePqErrSys(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,14 +129,14 @@ public class PqErrSysController extends BaseController {
|
|||||||
@GetMapping("/copy")
|
@GetMapping("/copy")
|
||||||
@ApiOperation("复制误差体系")
|
@ApiOperation("复制误差体系")
|
||||||
@ApiImplicitParam(name = "id", value = "误差体系id", required = true)
|
@ApiImplicitParam(name = "id", value = "误差体系id", required = true)
|
||||||
public HttpResult<Object> copy(@RequestParam("id") String id) {
|
public HttpResult<Boolean> copy(@RequestParam("id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("copy");
|
String methodDescribe = getMethodDescribe("copy");
|
||||||
LogUtil.njcnDebug(log, "{},复制ID为:{}", methodDescribe, id);
|
LogUtil.njcnDebug(log, "{},复制ID为:{}", methodDescribe, id);
|
||||||
boolean result = pqErrSysService.copyPqErrSys(id);
|
boolean result = pqErrSysService.copyPqErrSys(id);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ import com.njcn.common.utils.LogUtil;
|
|||||||
import com.njcn.gather.icd.pojo.param.PqIcdPathParam;
|
import com.njcn.gather.icd.pojo.param.PqIcdPathParam;
|
||||||
import com.njcn.gather.icd.pojo.po.PqIcdPath;
|
import com.njcn.gather.icd.pojo.po.PqIcdPath;
|
||||||
import com.njcn.gather.icd.service.IPqIcdPathService;
|
import com.njcn.gather.icd.service.IPqIcdPathService;
|
||||||
import com.njcn.gather.type.pojo.param.DevTypeParam;
|
|
||||||
import com.njcn.gather.type.pojo.po.DevType;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.njcn.web.utils.HttpResultUtil;
|
import com.njcn.web.utils.HttpResultUtil;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -27,16 +25,15 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author caozehui
|
* @author caozehui
|
||||||
* @date 2025-02-10
|
* @date 2025-02-10
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Api(tags="icd管理")
|
@Api(tags = "icd管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/icd")
|
@RequestMapping("/icd")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PqIcdPathController extends BaseController{
|
public class PqIcdPathController extends BaseController {
|
||||||
private final IPqIcdPathService pqIcdPathService;
|
private final IPqIcdPathService pqIcdPathService;
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@@ -63,15 +60,15 @@ public class PqIcdPathController extends BaseController{
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增icd")
|
@ApiOperation("新增icd")
|
||||||
@ApiImplicitParam(name = "param", value = "icd新增参数", required = true)
|
@ApiImplicitParam(name = "param", value = "icd新增参数", required = true)
|
||||||
public HttpResult<String> add(@RequestBody @Validated PqIcdPathParam param) {
|
public HttpResult<Boolean> add(@RequestBody @Validated PqIcdPathParam param) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
||||||
|
|
||||||
boolean result = pqIcdPathService.addIcd(param);
|
boolean result = pqIcdPathService.addIcd(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,15 +76,15 @@ public class PqIcdPathController extends BaseController{
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改icd")
|
@ApiOperation("修改icd")
|
||||||
@ApiImplicitParam(name = "param", value = "icd修改参数", required = true)
|
@ApiImplicitParam(name = "param", value = "icd修改参数", required = true)
|
||||||
public HttpResult<String> update(@RequestBody @Validated PqIcdPathParam.UpdateParam param) {
|
public HttpResult<Boolean> update(@RequestBody @Validated PqIcdPathParam.UpdateParam param) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
||||||
|
|
||||||
boolean result = pqIcdPathService.updateIcd(param);
|
boolean result = pqIcdPathService.updateIcd(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,14 +92,14 @@ public class PqIcdPathController extends BaseController{
|
|||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除icd")
|
@ApiOperation("删除icd")
|
||||||
@ApiImplicitParam(name = "ids", value = "icd的id列表", required = true)
|
@ApiImplicitParam(name = "ids", value = "icd的id列表", required = true)
|
||||||
public HttpResult<String> delete(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
LogUtil.njcnDebug(log, "{},删除数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
boolean result = pqIcdPathService.deleteIcd(ids);
|
boolean result = pqIcdPathService.deleteIcd(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,14 +58,14 @@ public class AdPlanController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增检测计划")
|
@ApiOperation("新增检测计划")
|
||||||
@ApiImplicitParam(name = "param", value = "检测计划", required = true)
|
@ApiImplicitParam(name = "param", value = "检测计划", required = true)
|
||||||
public HttpResult<Object> add(@RequestBody @Validated AdPlanParam param) {
|
public HttpResult<Boolean> add(@RequestBody @Validated AdPlanParam param) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
||||||
boolean result = adPlanService.addAdPlan(param);
|
boolean result = adPlanService.addAdPlan(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,14 +73,14 @@ public class AdPlanController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改检测计划")
|
@ApiOperation("修改检测计划")
|
||||||
@ApiImplicitParam(name = "updateParam", value = "检测计划", required = true)
|
@ApiImplicitParam(name = "updateParam", value = "检测计划", required = true)
|
||||||
public HttpResult<Object> update(@RequestBody @Validated AdPlanParam.UpdateParam updateParam) {
|
public HttpResult<Boolean> update(@RequestBody @Validated AdPlanParam.UpdateParam updateParam) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, updateParam);
|
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, updateParam);
|
||||||
boolean result = adPlanService.updateAdPlan(updateParam);
|
boolean result = adPlanService.updateAdPlan(updateParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,14 +88,14 @@ public class AdPlanController extends BaseController {
|
|||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除检测计划")
|
@ApiOperation("删除检测计划")
|
||||||
@ApiImplicitParam(name = "ids", value = "检测计划id", required = true)
|
@ApiImplicitParam(name = "ids", value = "检测计划id", required = true)
|
||||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
boolean result = adPlanService.deleteAdPlan(ids);
|
boolean result = adPlanService.deleteAdPlan(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ public enum DetectionResponseEnum {
|
|||||||
RAW_DATA_NOT_EXIST("A02004", "原始数据不存在"),
|
RAW_DATA_NOT_EXIST("A02004", "原始数据不存在"),
|
||||||
PLAN_REPEATED("A02005", "当前模式下,该计划已存在"),
|
PLAN_REPEATED("A02005", "当前模式下,该计划已存在"),
|
||||||
PLAN_NOT_EXIST("A02006", "该计划不存在"),
|
PLAN_NOT_EXIST("A02006", "该计划不存在"),
|
||||||
SCRIPT_RELATE_DICT_NOT_EXIST("A02007","脚本关联的字典不存在"),
|
SCRIPT_RELATE_DICT_NOT_EXIST("A02007", "脚本关联的字典不存在"),
|
||||||
NOT_CHECKED_PLAN_CANNOT_ANALYSE("A02008","只有检测状态为检测完成的计划才能进行统计分析" ),
|
NOT_CHECKED_PLAN_CANNOT_ANALYSE("A02008", "只有检测状态为检测完成的计划才能进行统计分析"),
|
||||||
CANNOT_CHANGE_SCRIPT_WHEN_CHECKING("A02009","只有检测状态为未检时,才能修改检测脚本" ),
|
CANNOT_CHANGE_SCRIPT_WHEN_CHECKING("A02009", "只有检测状态为未检时,才能修改检测脚本"),
|
||||||
CANNOT_CHANGE_ERROR_SYS_WHEN_CHECKING("A02010","只有检测状态为未检时,才能修改误差体系" ),
|
CANNOT_CHANGE_ERROR_SYS_WHEN_CHECKING("A02010", "只有检测状态为未检时,才能修改误差体系"),
|
||||||
CANNOT_CHANGE_REPORT_WHEN_CHECKING("A02011","只有检测状态为未检时,才能修改绑定报告模板"),
|
CANNOT_CHANGE_REPORT_WHEN_CHECKING("A02011", "只有检测状态为未检时,才能修改绑定报告模板"),
|
||||||
ICD_PATH_NAME_REPEAT("A02012", "icd名称重复"),
|
ICD_PATH_NAME_REPEAT("A02012", "icd名称重复"),
|
||||||
ERR_SYS_BOUND_NOT_DELETE("A02013","误差体系已被计划所绑定,无法删除!"),
|
ERR_SYS_BOUND_NOT_DELETE("A02013", "误差体系已被计划所绑定,无法删除!"),
|
||||||
|
|
||||||
|
|
||||||
IMPORT_DATA_FAIL("A02014", "导入数据失败"),
|
IMPORT_DATA_FAIL("A02014", "导入数据失败"),
|
||||||
@@ -38,12 +38,12 @@ public enum DetectionResponseEnum {
|
|||||||
HAS_NOT_UNCHECKED_DEVICE("A02022", "设备在检测中或已被检测过,请勿解除绑定"),
|
HAS_NOT_UNCHECKED_DEVICE("A02022", "设备在检测中或已被检测过,请勿解除绑定"),
|
||||||
IMPORT_PLAN_DATA_FAIL("A02023", "导入的检测计划为空"),
|
IMPORT_PLAN_DATA_FAIL("A02023", "导入的检测计划为空"),
|
||||||
IMPORT_DATA_FORMAT_FAIL("A02024", "导入数据格式错误"),
|
IMPORT_DATA_FORMAT_FAIL("A02024", "导入数据格式错误"),
|
||||||
IMPORT_SOURCE_ERROR("A02025","当前模式下一个检测计划只能有一个检测源" ),
|
IMPORT_SOURCE_ERROR("A02025", "当前模式下一个检测计划只能有一个检测源"),
|
||||||
IMPORT_DATASOURCE_ERROR("A02026","当前模式下一个检测计划只能有一个数据源" ),
|
IMPORT_DATASOURCE_ERROR("A02026", "当前模式下一个检测计划只能有一个数据源"),
|
||||||
DEV_UN_CHECKED("A02027","装置还未检测完成!" ),
|
DEV_UN_CHECKED("A02027", "装置还未检测完成!"),
|
||||||
DEV_UN_REPORT("A02028","装置报告未生成!" ),
|
DEV_UN_REPORT("A02028", "装置报告未生成!"),
|
||||||
DEVICE_DIS_ERROR("A02029","装置配置异常" ),
|
DEVICE_DIS_ERROR("A02029", "装置配置异常"),
|
||||||
DEVICE_DELETE("A02030","设备无法删除,已绑定计划!" );
|
DEVICE_DELETE("A02030", "设备无法删除,已绑定计划!");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|
||||||
|
|||||||
@@ -90,42 +90,45 @@ public class ReportController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增报告模板")
|
@ApiOperation("新增报告模板")
|
||||||
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
||||||
public HttpResult<Object> add(ReportParam reportParam) {
|
public HttpResult<Boolean> add(ReportParam reportParam) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, reportParam);
|
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, reportParam);
|
||||||
boolean result = pqReportService.add(reportParam);
|
boolean result = pqReportService.add(reportParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(operateType = OperateType.UPDATE)
|
@OperateInfo(operateType = OperateType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("更新报告模板")
|
@ApiOperation("更新报告模板")
|
||||||
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
||||||
public HttpResult<Object> update(ReportParam.UpdateParam reportParam) {
|
public HttpResult<Boolean> update(ReportParam.UpdateParam reportParam) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改参数为:{}", methodDescribe, reportParam);
|
LogUtil.njcnDebug(log, "{},修改参数为:{}", methodDescribe, reportParam);
|
||||||
boolean result = pqReportService.update(reportParam);
|
boolean result = pqReportService.update(reportParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(operateType = OperateType.DELETE)
|
@OperateInfo(operateType = OperateType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除报告模板")
|
@ApiOperation("删除报告模板")
|
||||||
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
||||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除参数为:{}", methodDescribe, ids);
|
LogUtil.njcnDebug(log, "{},删除参数为:{}", methodDescribe, ids);
|
||||||
boolean result = pqReportService.delete(ids);
|
boolean result = pqReportService.delete(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
|
} else {
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ import com.njcn.gather.system.dictionary.service.IDictTreeService;
|
|||||||
import com.njcn.gather.system.pojo.enums.DicDataEnum;
|
import com.njcn.gather.system.pojo.enums.DicDataEnum;
|
||||||
import com.njcn.gather.type.pojo.po.DevType;
|
import com.njcn.gather.type.pojo.po.DevType;
|
||||||
import com.njcn.gather.type.service.IDevTypeService;
|
import com.njcn.gather.type.service.IDevTypeService;
|
||||||
|
import com.njcn.gather.user.user.pojo.po.SysUser;
|
||||||
|
import com.njcn.gather.user.user.service.ISysUserService;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -120,6 +122,8 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
|
|
||||||
private final IResultService resultService;
|
private final IResultService resultService;
|
||||||
|
|
||||||
|
private final ISysUserService sysUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<PqReportVO> list(ReportParam.QueryParam queryParam) {
|
public Page<PqReportVO> list(ReportParam.QueryParam queryParam) {
|
||||||
QueryWrapper<PqReport> wrapper = new QueryWrapper<>();
|
QueryWrapper<PqReport> wrapper = new QueryWrapper<>();
|
||||||
@@ -496,7 +500,8 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
baseModelMap.put("${device_type}", devType.getName());
|
baseModelMap.put("${device_type}", devType.getName());
|
||||||
// 调试人员,todo... 待咨询曹泽辉如何获取当前用户信息,目前先写死
|
// 调试人员,todo... 待咨询曹泽辉如何获取当前用户信息,目前先写死
|
||||||
//String userName = RequestUtil.getUserName();
|
//String userName = RequestUtil.getUserName();
|
||||||
baseModelMap.put("${userName}", pqDevVO.getCheckBy());
|
SysUser user = sysUserService.getById(pqDevVO.getCheckBy());
|
||||||
|
baseModelMap.put("${userName}", user.getName());
|
||||||
// 调试日期
|
// 调试日期
|
||||||
if (pqDevVO.getCheckTime() != null) {
|
if (pqDevVO.getCheckTime() != null) {
|
||||||
baseModelMap.put("${testDate}", DateUtil.format(pqDevVO.getCheckTime(), DatePattern.CHINESE_DATE_PATTERN));
|
baseModelMap.put("${testDate}", DateUtil.format(pqDevVO.getCheckTime(), DatePattern.CHINESE_DATE_PATTERN));
|
||||||
@@ -530,7 +535,7 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
|||||||
baseModelMap.put("${sample_id}", pqDevVO.getSampleId());
|
baseModelMap.put("${sample_id}", pqDevVO.getSampleId());
|
||||||
baseModelMap.put("${arrived_date}", String.valueOf(pqDevVO.getArrivedDate()));
|
baseModelMap.put("${arrived_date}", String.valueOf(pqDevVO.getArrivedDate()));
|
||||||
baseModelMap.put("${check_date}", String.valueOf(pqDevVO.getCheckTime()).substring(0, 10));
|
baseModelMap.put("${check_date}", String.valueOf(pqDevVO.getCheckTime()).substring(0, 10));
|
||||||
baseModelMap.put("${tested_by}", pqDevVO.getCheckBy());
|
baseModelMap.put("${tested_by}", user.getName());
|
||||||
|
|
||||||
// 替换模板中的信息,避免信息丢失,段落和表格均参与替换
|
// 替换模板中的信息,避免信息丢失,段落和表格均参与替换
|
||||||
WordUtil.replacePlaceholdersInParagraphs(baseModelDocument, baseModelMap);
|
WordUtil.replacePlaceholdersInParagraphs(baseModelDocument, baseModelMap);
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public interface IResultService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出原始数据
|
* 导出原始数据
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
void exportRawData(ResultParam param);
|
void exportRawData(ResultParam param);
|
||||||
@@ -70,6 +71,7 @@ public interface IResultService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 重新计算
|
* 重新计算
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
*/
|
*/
|
||||||
void reCalculate(ResultParam.ChangeErrorSystemParam param);
|
void reCalculate(ResultParam.ChangeErrorSystemParam param);
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ public class PqScriptController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增检测脚本")
|
@ApiOperation("新增检测脚本")
|
||||||
@ApiImplicitParam(name = "pqDevParam", value = "检测脚本", required = true)
|
@ApiImplicitParam(name = "pqDevParam", value = "检测脚本", required = true)
|
||||||
public HttpResult<String> add(@RequestBody @Validated PqScriptParam param) {
|
public HttpResult<Boolean> add(@RequestBody @Validated PqScriptParam param) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
||||||
String result = pqScriptService.addPqScript(param);
|
Boolean result = pqScriptService.addPqScript(param);
|
||||||
if (StrUtil.isNotBlank(result)) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,14 +75,14 @@ public class PqScriptController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改检测脚本")
|
@ApiOperation("修改检测脚本")
|
||||||
@ApiImplicitParam(name = "updateParam", value = "检测脚本", required = true)
|
@ApiImplicitParam(name = "updateParam", value = "检测脚本", required = true)
|
||||||
public HttpResult<Object> update(@RequestBody @Validated PqScriptParam.UpdateParam param) {
|
public HttpResult<Boolean> update(@RequestBody @Validated PqScriptParam.UpdateParam param) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
||||||
boolean result = pqScriptService.updatePqScript(param);
|
boolean result = pqScriptService.updatePqScript(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,14 +90,14 @@ public class PqScriptController extends BaseController {
|
|||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除检测脚本")
|
@ApiOperation("删除检测脚本")
|
||||||
@ApiImplicitParam(name = "ids", value = "检测脚本id", required = true)
|
@ApiImplicitParam(name = "ids", value = "检测脚本id", required = true)
|
||||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
boolean result = pqScriptService.deletePqScript(ids);
|
boolean result = pqScriptService.deletePqScript(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,14 +116,14 @@ public class PqScriptController extends BaseController {
|
|||||||
@GetMapping("/upgradeToTemplate")
|
@GetMapping("/upgradeToTemplate")
|
||||||
@ApiOperation("升级为模板")
|
@ApiOperation("升级为模板")
|
||||||
@ApiImplicitParam(name = "id", value = "检测脚本id", required = true)
|
@ApiImplicitParam(name = "id", value = "检测脚本id", required = true)
|
||||||
public HttpResult<Object> upgradeToTemplate(@RequestParam("id") String id, HttpServletRequest request) {
|
public HttpResult<Boolean> upgradeToTemplate(@RequestParam("id") String id, HttpServletRequest request) {
|
||||||
String methodDescribe = getMethodDescribe("upgradeToTemplate");
|
String methodDescribe = getMethodDescribe("upgradeToTemplate");
|
||||||
LogUtil.njcnDebug(log, "{},升级ID数据为:{}", methodDescribe, id);
|
LogUtil.njcnDebug(log, "{},升级ID数据为:{}", methodDescribe, id);
|
||||||
boolean result = pqScriptService.upgradeToTemplate(id);
|
boolean result = pqScriptService.upgradeToTemplate(id);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ public class PqScriptController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("addScriptDtls");
|
String methodDescribe = getMethodDescribe("addScriptDtls");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
||||||
Boolean b = pqScriptDtlsService.saveScriptDtls(sourceIssue);
|
Boolean b = pqScriptDtlsService.saveScriptDtls(sourceIssue);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b , methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
@@ -170,7 +170,7 @@ public class PqScriptController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("scriptDtlsCheckDataList");
|
String methodDescribe = getMethodDescribe("scriptDtlsCheckDataList");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
||||||
List<PqScriptDtlsParam.CheckData> checkData = pqScriptDtlsService.scriptDtlsCheckDataList(sourceIssue);
|
List<PqScriptDtlsParam.CheckData> checkData = pqScriptDtlsService.scriptDtlsCheckDataList(sourceIssue);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, checkData , methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, checkData, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ public class PqScriptController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("deleteDtls");
|
String methodDescribe = getMethodDescribe("deleteDtls");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
||||||
Boolean b = pqScriptDtlsService.deleteDtls(sourceIssue);
|
Boolean b = pqScriptDtlsService.deleteDtls(sourceIssue);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b , methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ public class PqScriptController extends BaseController {
|
|||||||
String methodDescribe = getMethodDescribe("updateDtls");
|
String methodDescribe = getMethodDescribe("updateDtls");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, sourceIssue);
|
||||||
Boolean b = pqScriptDtlsService.updateDtls(sourceIssue);
|
Boolean b = pqScriptDtlsService.updateDtls(sourceIssue);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b , methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo
|
@OperateInfo
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public interface PqScriptDtlsMapper extends MPJBaseMapper<PqScriptDtls> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前检测脚本最大index值
|
* 获取当前检测脚本最大index值
|
||||||
|
*
|
||||||
* @param scriptId
|
* @param scriptId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public interface PqScriptMapper extends MPJBaseMapper<PqScript> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取检测脚本信息(先获取检测脚本类型是否相对值 true相对值 false绝对值(相对值要乘额定值,绝对值不需要处理))
|
* 获取检测脚本信息(先获取检测脚本类型是否相对值 true相对值 false绝对值(相对值要乘额定值,绝对值不需要处理))
|
||||||
|
*
|
||||||
* @param scriptId
|
* @param scriptId
|
||||||
* @return: com.njcn.gather.device.script.pojo.po.PqScript
|
* @return: com.njcn.gather.device.script.pojo.po.PqScript
|
||||||
* @Author: wr
|
* @Author: wr
|
||||||
|
|||||||
@@ -5,12 +5,9 @@
|
|||||||
|
|
||||||
<select id="selectMaxIndex" resultType="java.lang.Integer">
|
<select id="selectMaxIndex" resultType="java.lang.Integer">
|
||||||
|
|
||||||
SELECT
|
SELECT IFNULL(max(t.Script_Index), -1) AS num
|
||||||
IFNULL( max( t.Script_Index ), -1 ) AS num
|
FROM pq_script_dtls t
|
||||||
FROM
|
WHERE Script_Id = #{scriptId}
|
||||||
pq_script_dtls t
|
|
||||||
WHERE
|
|
||||||
Script_Id = #{scriptId}
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -18,17 +18,18 @@ public interface IPqScriptCheckDataService extends IService<PqScriptCheckData> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取检测指标类型
|
* 获取检测指标类型
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> getValueType(PqScriptCheckDataParam param);
|
List<String> getValueType(PqScriptCheckDataParam param);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, String> getValueTypeMap(String scriptId);
|
||||||
Map<String,String> getValueTypeMap(String scriptId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取监测脚本code
|
* 获取监测脚本code
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public interface IPqScriptDtlsService extends IService<PqScriptDtls> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测脚本单次小项数据新增
|
* 检测脚本单次小项数据新增
|
||||||
|
*
|
||||||
* @param sourceIssue
|
* @param sourceIssue
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -83,12 +84,14 @@ public interface IPqScriptDtlsService extends IService<PqScriptDtls> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据通讯参数生成装置下发原始数据公式
|
* 根据通讯参数生成装置下发原始数据公式
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<PqScriptDtlsParam.CheckData> scriptDtlsCheckDataList(PqScriptDtlsParam sourceIssue);
|
List<PqScriptDtlsParam.CheckData> scriptDtlsCheckDataList(PqScriptDtlsParam sourceIssue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除脚本
|
* 删除脚本
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -96,6 +99,7 @@ public interface IPqScriptDtlsService extends IService<PqScriptDtls> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用关闭脚本
|
* 启用关闭脚本
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -103,6 +107,7 @@ public interface IPqScriptDtlsService extends IService<PqScriptDtls> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通讯脚本回显
|
* 通讯脚本回显
|
||||||
|
*
|
||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public interface IPqScriptService extends IService<PqScript> {
|
|||||||
* @param param 检测脚本
|
* @param param 检测脚本
|
||||||
* @return 成功返回true, 失败返回false
|
* @return 成功返回true, 失败返回false
|
||||||
*/
|
*/
|
||||||
String addPqScript(PqScriptParam param);
|
Boolean addPqScript(PqScriptParam param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除检测脚本
|
* 删除检测脚本
|
||||||
|
|||||||
@@ -58,13 +58,12 @@ public class PqScriptServiceImpl extends ServiceImpl<PqScriptMapper, PqScript> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public String addPqScript(PqScriptParam param) {
|
public Boolean addPqScript(PqScriptParam param) {
|
||||||
PqScript pqScript = new PqScript();
|
PqScript pqScript = new PqScript();
|
||||||
BeanUtils.copyProperties(param, pqScript);
|
BeanUtils.copyProperties(param, pqScript);
|
||||||
pqScript.setStandardTime(LocalDate.of(Integer.parseInt(param.getStandardTime()), 1, 1));
|
pqScript.setStandardTime(LocalDate.of(Integer.parseInt(param.getStandardTime()), 1, 1));
|
||||||
pqScript.setState(DataStateEnum.ENABLE.getCode());
|
pqScript.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.save(pqScript);
|
return this.save(pqScript);
|
||||||
return pqScript.getId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -65,14 +65,14 @@ public class PqSourceController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增检测源")
|
@ApiOperation("新增检测源")
|
||||||
@ApiImplicitParam(name = "param", value = "检测源", required = true)
|
@ApiImplicitParam(name = "param", value = "检测源", required = true)
|
||||||
public HttpResult<Object> add(@RequestBody @Validated PqSourceParam param) {
|
public HttpResult<Boolean> add(@RequestBody @Validated PqSourceParam param) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, param);
|
||||||
boolean result = pqSourceService.addPqSource(param);
|
boolean result = pqSourceService.addPqSource(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,14 +80,14 @@ public class PqSourceController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改检测源")
|
@ApiOperation("修改检测源")
|
||||||
@ApiImplicitParam(name = "param", value = "检测源", required = true)
|
@ApiImplicitParam(name = "param", value = "检测源", required = true)
|
||||||
public HttpResult<Object> update(@RequestBody @Validated PqSourceParam.UpdateParam param) {
|
public HttpResult<Boolean> update(@RequestBody @Validated PqSourceParam.UpdateParam param) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, param);
|
||||||
boolean result = pqSourceService.updatePqSource(param);
|
boolean result = pqSourceService.updatePqSource(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,14 +95,14 @@ public class PqSourceController extends BaseController {
|
|||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除检测源")
|
@ApiOperation("删除检测源")
|
||||||
@ApiImplicitParam(name = "ids", value = "检测源id", required = true)
|
@ApiImplicitParam(name = "ids", value = "检测源id", required = true)
|
||||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
LogUtil.njcnDebug(log, "{},删除ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
boolean result = pqSourceService.deletePqSource(ids);
|
boolean result = pqSourceService.deletePqSource(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,15 +66,15 @@ public class DevTypeController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增设备类型")
|
@ApiOperation("新增设备类型")
|
||||||
@ApiImplicitParam(name = "devTypeParam", value = "设备类型", required = true)
|
@ApiImplicitParam(name = "devTypeParam", value = "设备类型", required = true)
|
||||||
public HttpResult<String> add(@RequestBody @Validated DevTypeParam devTypeParam) {
|
public HttpResult<Boolean> add(@RequestBody @Validated DevTypeParam devTypeParam) {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, devTypeParam);
|
LogUtil.njcnDebug(log, "{},新增数据为:{}", methodDescribe, devTypeParam);
|
||||||
|
|
||||||
boolean result = devTypeService.addDevType(devTypeParam);
|
boolean result = devTypeService.addDevType(devTypeParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,15 +82,15 @@ public class DevTypeController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改设备类型")
|
@ApiOperation("修改设备类型")
|
||||||
@ApiImplicitParam(name = "devTypeParam", value = "设备类型", required = true)
|
@ApiImplicitParam(name = "devTypeParam", value = "设备类型", required = true)
|
||||||
public HttpResult<String> update(@RequestBody @Validated DevTypeParam.UpdateParam updateParam) {
|
public HttpResult<Boolean> update(@RequestBody @Validated DevTypeParam.UpdateParam updateParam) {
|
||||||
String methodDescribe = getMethodDescribe("update");
|
String methodDescribe = getMethodDescribe("update");
|
||||||
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, updateParam);
|
LogUtil.njcnDebug(log, "{},修改数据为:{}", methodDescribe, updateParam);
|
||||||
|
|
||||||
boolean result = devTypeService.updateDevType(updateParam);
|
boolean result = devTypeService.updateDevType(updateParam);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,14 +98,14 @@ public class DevTypeController extends BaseController {
|
|||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除设备类型")
|
@ApiOperation("删除设备类型")
|
||||||
@ApiImplicitParam(name = "ids", value = "设备类型id列表", required = true)
|
@ApiImplicitParam(name = "ids", value = "设备类型id列表", required = true)
|
||||||
public HttpResult<String> delete(@RequestBody List<String> ids) {
|
public HttpResult<Boolean> delete(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("delete");
|
String methodDescribe = getMethodDescribe("delete");
|
||||||
LogUtil.njcnDebug(log, "{},删除数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
LogUtil.njcnDebug(log, "{},删除数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||||
boolean result = devTypeService.deleteDevType(ids);
|
boolean result = devTypeService.deleteDevType(ids);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njcn.gather.system.config.mapper.SysTestConfigMapper">
|
<mapper namespace="com.njcn.gather.system.cfg.mapper.SysTestConfigMapper">
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public class SysTestConfigServiceImpl extends ServiceImpl<SysTestConfigMapper, S
|
|||||||
public boolean addTestConfig(String scene) {
|
public boolean addTestConfig(String scene) {
|
||||||
SysTestConfig sysTestConfig = new SysTestConfig();
|
SysTestConfig sysTestConfig = new SysTestConfig();
|
||||||
sysTestConfig.setAutoGenerate(1);
|
sysTestConfig.setAutoGenerate(1);
|
||||||
|
// 最大被检次数默认为3次
|
||||||
sysTestConfig.setMaxTime(3);
|
sysTestConfig.setMaxTime(3);
|
||||||
sysTestConfig.setDataRule("46cf964bd76fb12a19cfb1700442eeeb"); // 任意值
|
sysTestConfig.setDataRule("46cf964bd76fb12a19cfb1700442eeeb"); // 任意值
|
||||||
sysTestConfig.setScene(scene);
|
sysTestConfig.setScene(scene);
|
||||||
|
|||||||
@@ -40,9 +40,6 @@ public class DictDataController extends BaseController {
|
|||||||
|
|
||||||
private final IDictDataService dictDataService;
|
private final IDictDataService dictDataService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据字典类型id分页查询字典数据
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@PostMapping("/listByTypeId")
|
@PostMapping("/listByTypeId")
|
||||||
@ApiOperation("根据字典类型id查询字典数据")
|
@ApiOperation("根据字典类型id查询字典数据")
|
||||||
@@ -54,11 +51,6 @@ public class DictDataController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增字典数据
|
|
||||||
*
|
|
||||||
* @param dictDataParam 字典数据
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增字典数据")
|
@ApiOperation("新增字典数据")
|
||||||
@@ -74,9 +66,6 @@ public class DictDataController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改字典数据
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改字典数据")
|
@ApiOperation("修改字典数据")
|
||||||
@@ -92,9 +81,6 @@ public class DictDataController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除字典数据
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除字典数据")
|
@ApiOperation("删除字典数据")
|
||||||
@@ -130,9 +116,6 @@ public class DictDataController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所有字典数据基础信息
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@GetMapping("/dictDataCache")
|
@GetMapping("/dictDataCache")
|
||||||
@ApiOperation("获取所有字典数据缓存到前端")
|
@ApiOperation("获取所有字典数据缓存到前端")
|
||||||
|
|||||||
@@ -79,11 +79,6 @@ public class DictTreeController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*
|
|
||||||
* @param dicParam 修改参数
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改字典树数据")
|
@ApiOperation("修改字典树数据")
|
||||||
@@ -99,11 +94,6 @@ public class DictTreeController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*
|
|
||||||
* @param id 字典id
|
|
||||||
*/
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||||
@PostMapping("/delete")
|
@PostMapping("/delete")
|
||||||
@ApiOperation("删除字典树数据")
|
@ApiOperation("删除字典树数据")
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import com.njcn.common.pojo.response.HttpResult;
|
|||||||
import com.njcn.db.mybatisplus.constant.UserConstant;
|
import com.njcn.db.mybatisplus.constant.UserConstant;
|
||||||
import com.njcn.gather.system.log.pojo.enums.LogLevelEnum;
|
import com.njcn.gather.system.log.pojo.enums.LogLevelEnum;
|
||||||
import com.njcn.gather.system.log.pojo.enums.LogOperationTypeEnum;
|
import com.njcn.gather.system.log.pojo.enums.LogOperationTypeEnum;
|
||||||
import com.njcn.gather.system.log.pojo.enums.LogResponseEnum;
|
|
||||||
import com.njcn.gather.system.log.pojo.po.SysLogAudit;
|
import com.njcn.gather.system.log.pojo.po.SysLogAudit;
|
||||||
import com.njcn.gather.system.log.service.ISysLogAuditService;
|
import com.njcn.gather.system.log.service.ISysLogAuditService;
|
||||||
|
import com.njcn.gather.system.pojo.enums.SystemResponseEnum;
|
||||||
import com.njcn.gather.user.user.pojo.param.SysUserParam;
|
import com.njcn.gather.user.user.pojo.param.SysUserParam;
|
||||||
import com.njcn.gather.user.user.pojo.po.SysUser;
|
import com.njcn.gather.user.user.pojo.po.SysUser;
|
||||||
import com.njcn.gather.user.user.service.ISysUserService;
|
import com.njcn.gather.user.user.service.ISysUserService;
|
||||||
@@ -144,7 +144,7 @@ public class LogAdvice implements ApplicationListener<ContextRefreshedEvent> {
|
|||||||
sysLogAuditService.saveBatch(logList); // 假设有一个批量保存的方法
|
sysLogAuditService.saveBatch(logList); // 假设有一个批量保存的方法
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(LogResponseEnum.LOG_RECORD_FAILED);
|
throw new BusinessException(SystemResponseEnum.LOG_RECORD_FAILED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
package com.njcn.gather.system.log.pojo.enums;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author caozehui
|
|
||||||
* @data 2025-02-12
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
public enum LogResponseEnum {
|
|
||||||
|
|
||||||
LOG_RECORD_FAILED("A006001", "日志记录失败");
|
|
||||||
|
|
||||||
private final String code;
|
|
||||||
private final String message;
|
|
||||||
|
|
||||||
LogResponseEnum(String code, String message) {
|
|
||||||
this.message = message;
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,7 +20,8 @@ public enum SystemResponseEnum {
|
|||||||
EXISTS_CHILDREN_NOT_DELETE("A01004", "当前字典下存在子字典,不能删除"),
|
EXISTS_CHILDREN_NOT_DELETE("A01004", "当前字典下存在子字典,不能删除"),
|
||||||
CODE_REPEAT("A01005", "该层级下已存在相同的编码"),
|
CODE_REPEAT("A01005", "该层级下已存在相同的编码"),
|
||||||
CAN_NOT_DELETE_USED_DICT("A01006", "该字典在使用中,不能删除"),
|
CAN_NOT_DELETE_USED_DICT("A01006", "该字典在使用中,不能删除"),
|
||||||
CAN_NOT_UPDATE_USED_DICT("A01007", "该字典在使用中,不能修改");
|
CAN_NOT_UPDATE_USED_DICT("A01007", "该字典在使用中,不能修改"),
|
||||||
|
LOG_RECORD_FAILED("A01008", "日志记录失败");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|
||||||
|
|||||||
@@ -61,14 +61,14 @@ public class SysRegResController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增注册版本")
|
@ApiOperation("新增注册版本")
|
||||||
@ApiImplicitParam(name = "sysRegRes", value = "注册版本对象", required = true)
|
@ApiImplicitParam(name = "sysRegRes", value = "注册版本对象", required = true)
|
||||||
public HttpResult<String> addRegRes(@RequestBody @Validated SysRegResParam param) {
|
public HttpResult<Boolean> addRegRes(@RequestBody @Validated SysRegResParam param) {
|
||||||
String methodDescribe = getMethodDescribe("addRegRes");
|
String methodDescribe = getMethodDescribe("addRegRes");
|
||||||
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, param);
|
||||||
boolean result = sysRegResService.addRegRes(param);
|
boolean result = sysRegResService.addRegRes(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,14 +76,14 @@ public class SysRegResController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改配置")
|
@ApiOperation("修改配置")
|
||||||
@ApiImplicitParam(name = "param", value = "注册版本更新对象", required = true)
|
@ApiImplicitParam(name = "param", value = "注册版本更新对象", required = true)
|
||||||
public HttpResult<String> updateRegRes(@RequestBody @Validated SysRegResParam.UpdateParam param) {
|
public HttpResult<Boolean> updateRegRes(@RequestBody @Validated SysRegResParam.UpdateParam param) {
|
||||||
String methodDescribe = getMethodDescribe("updateRegRes");
|
String methodDescribe = getMethodDescribe("updateRegRes");
|
||||||
LogUtil.njcnDebug(log, "{},更新参数为:{}", methodDescribe, param);
|
LogUtil.njcnDebug(log, "{},更新参数为:{}", methodDescribe, param);
|
||||||
boolean result = sysRegResService.updateRegRes(param);
|
boolean result = sysRegResService.updateRegRes(param);
|
||||||
if (result) {
|
if (result) {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
} else {
|
} else {
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public class AuthController extends BaseController {
|
|||||||
|
|
||||||
private final ISysUserService sysUserService;
|
private final ISysUserService sysUserService;
|
||||||
private final CustomCacheUtil customCacheUtil;
|
private final CustomCacheUtil customCacheUtil;
|
||||||
|
private final String PUBLIC_KEY = "publicKey";
|
||||||
|
private final String PRIVATE_KEY = "privateKey";
|
||||||
private KeyPair keyPair;
|
private KeyPair keyPair;
|
||||||
|
|
||||||
|
|
||||||
@@ -57,7 +59,16 @@ public class AuthController extends BaseController {
|
|||||||
byte[] decode = Base64.getDecoder().decode(param.getUsername());
|
byte[] decode = Base64.getDecoder().decode(param.getUsername());
|
||||||
String username = new String(decode);
|
String username = new String(decode);
|
||||||
String password = null;
|
String password = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
String keyPairJSON = customCacheUtil.get(username, false);
|
||||||
|
if (StrUtil.isNotBlank(keyPairJSON)) {
|
||||||
|
Map map = JSON.parseObject(keyPairJSON, Map.class);
|
||||||
|
keyPair = new KeyPair(RSAUtil.stringToPublicKey(map.get(PUBLIC_KEY).toString()), RSAUtil.stringToPrivateKey(map.get(PRIVATE_KEY).toString()));
|
||||||
|
}
|
||||||
|
if (!param.getChecked()) {
|
||||||
|
customCacheUtil.remove(username);
|
||||||
|
}
|
||||||
password = RSAUtil.decrypt(param.getPassword(), keyPair.getPrivate());
|
password = RSAUtil.decrypt(param.getPassword(), keyPair.getPrivate());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(UserResponseEnum.RSA_DECRYT_ERROR);
|
throw new BusinessException(UserResponseEnum.RSA_DECRYT_ERROR);
|
||||||
@@ -129,10 +140,18 @@ public class AuthController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
@ApiOperation("获取RSA公钥")
|
@ApiOperation("获取RSA公钥")
|
||||||
@GetMapping("/getPublicKey")
|
@GetMapping("/getPublicKey")
|
||||||
public HttpResult<String> publicKey() throws Exception {
|
public HttpResult<String> publicKey(@RequestParam("username") String username, @RequestParam("checked") Boolean checked) throws Exception {
|
||||||
String methodDescribe = getMethodDescribe("publicKey");
|
String methodDescribe = getMethodDescribe("publicKey");
|
||||||
LogUtil.njcnDebug(log, "{},获取RSA公钥", methodDescribe);
|
LogUtil.njcnDebug(log, "{},获取RSA公钥", methodDescribe);
|
||||||
keyPair = RSAUtil.generateKeyPair();
|
keyPair = RSAUtil.generateKeyPair();
|
||||||
|
if (checked) {
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put(PUBLIC_KEY, RSAUtil.publicKeyToString(keyPair.getPublic()));
|
||||||
|
map.put(PRIVATE_KEY, RSAUtil.privateKeyToString(keyPair.getPrivate()));
|
||||||
|
customCacheUtil.putWithExpireTime(username, JSON.toJSONString(map), DateUnit.DAY.getMillis() * 30);
|
||||||
|
} else {
|
||||||
|
customCacheUtil.remove(username);
|
||||||
|
}
|
||||||
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, RSAUtil.publicKeyToString(keyPair.getPublic()), methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, RSAUtil.publicKeyToString(keyPair.getPublic()), methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class SysFunctionController extends BaseController {
|
|||||||
@GetMapping("/functionTreeNoButton")
|
@GetMapping("/functionTreeNoButton")
|
||||||
@ApiOperation("菜单树-不包括按钮")
|
@ApiOperation("菜单树-不包括按钮")
|
||||||
public HttpResult<List<SysFunction>> getFunctionTreeNoButton() {
|
public HttpResult<List<SysFunction>> getFunctionTreeNoButton() {
|
||||||
String methodDescribe = getMethodDescribe("getFunctionTree");
|
String methodDescribe = getMethodDescribe("getFunctionTreeNoButton");
|
||||||
List<SysFunction> list = sysFunctionService.getFunctionTree(false);
|
List<SysFunction> list = sysFunctionService.getFunctionTree(false);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,16 +49,6 @@ public class SysUserController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
|
||||||
@GetMapping("/listUserByDeptId")
|
|
||||||
@ApiOperation("查询部门下的用户")
|
|
||||||
@ApiImplicitParam(name = "deptId", value = "部门id", required = true)
|
|
||||||
public HttpResult<List<SysUser>> listUserByDeptId(String deptId) {
|
|
||||||
String methodDescribe = getMethodDescribe("listAllUserByDeptId");
|
|
||||||
List<SysUser> list = sysUserService.listUserByDeptId(deptId);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增用户")
|
@ApiOperation("新增用户")
|
||||||
|
|||||||
@@ -100,5 +100,7 @@ public class SysUserParam {
|
|||||||
@NotBlank(message = UserValidMessage.PASSWORD_NOT_BLANK)
|
@NotBlank(message = UserValidMessage.PASSWORD_NOT_BLANK)
|
||||||
@Pattern(regexp = PatternRegex.PASSWORD_REGEX, message = UserValidMessage.PASSWORD_FORMAT_ERROR)
|
@Pattern(regexp = PatternRegex.PASSWORD_REGEX, message = UserValidMessage.PASSWORD_FORMAT_ERROR)
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
private Boolean checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,15 +20,6 @@ public interface ISysRoleFunctionService extends IService<SysRoleFunction> {
|
|||||||
*/
|
*/
|
||||||
List<SysFunction> listFunctionByRoleId(String roleId);
|
List<SysFunction> listFunctionByRoleId(String roleId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增角色菜单(资源)关联数据
|
|
||||||
*
|
|
||||||
* @param roleId 角色id
|
|
||||||
* @param functionIds 菜单(资源)ids
|
|
||||||
* @return 成功返回true,失败返回false
|
|
||||||
*/
|
|
||||||
boolean addRoleFunction(String roleId, List<String> functionIds);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新角色菜单(资源)关联数据
|
* 更新角色菜单(资源)关联数据
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -21,14 +21,6 @@ public interface ISysUserService extends IService<SysUser> {
|
|||||||
*/
|
*/
|
||||||
Page<SysUser> listUser(SysUserParam.SysUserQueryParam queryParam);
|
Page<SysUser> listUser(SysUserParam.SysUserQueryParam queryParam);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据部门ID查询用户列表
|
|
||||||
*
|
|
||||||
* @param deptId 部门ID
|
|
||||||
* @return 用户列表
|
|
||||||
*/
|
|
||||||
List<SysUser> listUserByDeptId(String deptId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据登录名查询用户
|
* 根据登录名查询用户
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -30,21 +30,6 @@ public class SysRoleFunctionServiceImpl extends ServiceImpl<SysRoleFunctionMappe
|
|||||||
return this.baseMapper.getFunctionListByRoleId(roleId);
|
return this.baseMapper.getFunctionListByRoleId(roleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional
|
|
||||||
public boolean addRoleFunction(String roleId, List<String> functionIds) {
|
|
||||||
List<SysRoleFunction> roleFunctions = new ArrayList<>();
|
|
||||||
if (!CollectionUtil.isEmpty(functionIds)) {
|
|
||||||
functionIds.forEach(functionId -> {
|
|
||||||
SysRoleFunction roleFunction = new SysRoleFunction();
|
|
||||||
roleFunction.setRoleId(roleId);
|
|
||||||
roleFunction.setFunctionId(functionId);
|
|
||||||
roleFunctions.add(roleFunction);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return this.saveBatch(roleFunctions);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public boolean updateRoleFunction(String roleId, List<String> functionIds) {
|
public boolean updateRoleFunction(String roleId, List<String> functionIds) {
|
||||||
|
|||||||
@@ -68,14 +68,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<SysUser> listUserByDeptId(String deptId) {
|
|
||||||
if (StrUtil.isNotBlank(deptId)) {
|
|
||||||
return this.lambdaQuery().ne(SysUser::getState, UserConst.STATE_DELETE).eq(SysUser::getDeptId, deptId).orderByAsc(SysUser::getCreateTime).list();
|
|
||||||
}
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SysUser getUserByLoginName(String loginName) {
|
public SysUser getUserByLoginName(String loginName) {
|
||||||
return this.lambdaQuery().ne(SysUser::getState, UserConst.STATE_DELETE).eq(SysUser::getLoginName, loginName).one();
|
return this.lambdaQuery().ne(SysUser::getState, UserConst.STATE_DELETE).eq(SysUser::getLoginName, loginName).one();
|
||||||
|
|||||||
Reference in New Issue
Block a user