微调
This commit is contained in:
@@ -39,7 +39,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -215,6 +214,21 @@ public class PqDevController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPDATE)
|
||||
@GetMapping("/documented")
|
||||
@ApiOperation("设备归档")
|
||||
@ApiImplicitParam(name = "id", value = "设备id", required = true)
|
||||
public HttpResult<List<PqDev>> documented(@RequestParam String id) {
|
||||
String methodDescribe = getMethodDescribe("documented");
|
||||
LogUtil.njcnDebug(log, "{},设备id为:{}", methodDescribe, id);
|
||||
boolean result = pqDevService.documented(id);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
// @OperateInfo(operateType = OperateType.UPDATE)
|
||||
// @PostMapping("/bindDev")
|
||||
// @ApiOperation("检测计划绑定设备")
|
||||
@@ -229,15 +243,4 @@ public class PqDevController extends BaseController {
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @PostMapping("/listUnDocumentByPlanId")
|
||||
// @ApiOperation("根据检测计划id查询出所有已绑定(未归档)的设备")
|
||||
// @ApiImplicitParam(name = "planId", value = "计划id", required = true)
|
||||
// public HttpResult<List<PqDev>> listUnDocumentByPlanId(@RequestBody @Validated PqDevParam.QueryParam param) {
|
||||
// String methodDescribe = getMethodDescribe("listUnDocumentByPlanId");
|
||||
// LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, param);
|
||||
// List<PqDev> result = pqDevService.listUnDocumentByPlanId(param);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -196,6 +196,12 @@ public class PqDevParam {
|
||||
@Min(value = 0, message = DevValidMessage.CHECK_RESULT_FORMAT_ERROR)
|
||||
@Max(value = 2, message = DevValidMessage.CHECK_RESULT_FORMAT_ERROR)
|
||||
private Integer checkResult;
|
||||
|
||||
@ApiModelProperty("报告状态")
|
||||
@Min(value = 0, message = DevValidMessage.REPORT_STATE_FORMAT_ERROR)
|
||||
@Max(value = 2, message = DevValidMessage.REPORT_STATE_FORMAT_ERROR)
|
||||
private Integer reportState;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -81,10 +81,10 @@ public class PqDevExcel implements Serializable {
|
||||
@NotNull(message = DevValidMessage.ENCRYPTION_NOT_NULL)
|
||||
private Integer encryptionFlag;
|
||||
|
||||
@Excel(name = "识别码", width = 30, orderNum = "15", needMerge = true)
|
||||
@Excel(name = "识别码(当为加密版本时必填)", width = 30, orderNum = "15", needMerge = true)
|
||||
private String series;
|
||||
|
||||
@Excel(name = "秘钥", width = 30, orderNum = "16", needMerge = true)
|
||||
@Excel(name = "秘钥(当为加密版本时必填)", width = 30, orderNum = "16", needMerge = true)
|
||||
private String devKey;
|
||||
|
||||
@Excel(name = "所属地市名称", width = 20, orderNum = "19", needMerge = true)
|
||||
|
||||
@@ -126,7 +126,7 @@ public interface IPqDevService extends IService<PqDev> {
|
||||
* @param planId 检测计划id
|
||||
* @return 饼图数据
|
||||
*/
|
||||
List<List<Map<String, Object>>> getPieData(String planId);
|
||||
//List<List<Map<String, Object>>> getPieData(String planId);
|
||||
|
||||
/**
|
||||
* 根据id获取被检设备信息
|
||||
@@ -165,4 +165,10 @@ public interface IPqDevService extends IService<PqDev> {
|
||||
*/
|
||||
List<PreDetection> getDevInfo(@Param("devIds") List<String> devIds);
|
||||
|
||||
/**
|
||||
* 设备归档操作
|
||||
* @param id 设备id
|
||||
* @return 归档成功返回true,否则返回false
|
||||
*/
|
||||
boolean documented(String id);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -62,6 +63,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean addPqDev(PqDevParam pqDevParam) {
|
||||
this.checkRepeat(pqDevParam, false);
|
||||
|
||||
@@ -95,6 +97,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqDev(PqDevParam.UpdateParam updateParam) {
|
||||
this.checkRepeat(updateParam, true);
|
||||
|
||||
@@ -116,6 +119,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqDev(PqDevParam.DeleteParam param) {
|
||||
if (PatternEnum.CONTRAST.getValue().equals(dictDataService.getDictDataById(param.getPattern()).getCode())) {
|
||||
for (String id : param.getIds()) {
|
||||
@@ -128,6 +132,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqDevTimeCheckResult(List<String> ids, TimeCheckResultEnum result) {
|
||||
return this.lambdaUpdate().set(PqDev::getTimeCheckResult, result.getValue()).in(PqDev::getId, ids).update();
|
||||
}
|
||||
@@ -169,6 +174,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public void importContrastData(List<PqDevExcel.ContrastImportData> pqDevExcelList) {
|
||||
List<PqDev> devList = new ArrayList<>();
|
||||
List<PqMonitor> monitorList = new ArrayList<>();
|
||||
@@ -207,6 +213,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public void importSimulateAndDigitalData(List<PqDevExcel.SimulateOrDigitalImportData> pqDevExcelList) {
|
||||
List<PqDev> pqDevList = BeanUtil.copyToList(pqDevExcelList, PqDev.class);
|
||||
//逆向可视化
|
||||
@@ -230,9 +237,11 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
public List<PqDev> listByPlanId(PqDevParam.QueryParam param) {
|
||||
List<PqDev> pqDevList = this.lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(param.getPlanId()), PqDev::getPlanId, param.getPlanId())
|
||||
.eq(StrUtil.isNotBlank(param.getName()), PqDev::getName, param.getName())
|
||||
.like(StrUtil.isNotBlank(param.getName()), PqDev::getName, param.getName())
|
||||
.in(ObjectUtil.isNotEmpty(param.getCheckStateList()), PqDev::getCheckState, param.getCheckStateList())
|
||||
.eq(ObjectUtil.isNotNull(param.getCheckResult()), PqDev::getCheckResult, param.getCheckResult())
|
||||
.eq(ObjectUtil.isNotNull(param.getCheckResult()), PqDev::getCheckResult, param.getCheckResult())
|
||||
.eq(ObjectUtil.isNotNull(param.getReportState()), PqDev::getReportState, param.getReportState())
|
||||
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||
// List<Map<String, Object>> result = pqDevList.stream().map(pqDev -> {
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
@@ -244,6 +253,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean bind(String planId, List<String> devIds) {
|
||||
this.lambdaUpdate().set(PqDev::getPlanId, null).eq(PqDev::getPlanId, planId).update();
|
||||
|
||||
@@ -254,23 +264,23 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getPieData(String planId) {
|
||||
List<PqDev> pqDevList = this.lambdaQuery().eq(PqDev::getPlanId, planId).eq(PqDev::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||
Map<Integer, Long> checkStateMap = pqDevList.stream().collect(Collectors.groupingBy(PqDev::getCheckState, Collectors.counting()));
|
||||
Map<Integer, Long> checkResultMap = pqDevList.stream().collect(Collectors.groupingBy(PqDev::getCheckResult, Collectors.counting()));
|
||||
Map<Integer, Long> reportStateMap = pqDevList.stream().collect(Collectors.groupingBy(PqDev::getReportState, Collectors.counting()));
|
||||
|
||||
List<Map<String, Object>> checkStateData = getCheckStatePieData(checkStateMap);
|
||||
List<Map<String, Object>> checkResultData = getCheckResultPieData(checkResultMap);
|
||||
List<Map<String, Object>> reportStateData = getReportStatePieData(reportStateMap);
|
||||
|
||||
List<List<Map<String, Object>>> result = new ArrayList<>();
|
||||
result.add(checkStateData);
|
||||
result.add(checkResultData);
|
||||
result.add(reportStateData);
|
||||
return result;
|
||||
}
|
||||
// @Override
|
||||
// public List getPieData(String planId) {
|
||||
// List<PqDev> pqDevList = this.lambdaQuery().eq(PqDev::getPlanId, planId).eq(PqDev::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||
// Map<Integer, Long> checkStateMap = pqDevList.stream().collect(Collectors.groupingBy(PqDev::getCheckState, Collectors.counting()));
|
||||
// Map<Integer, Long> checkResultMap = pqDevList.stream().collect(Collectors.groupingBy(PqDev::getCheckResult, Collectors.counting()));
|
||||
// Map<Integer, Long> reportStateMap = pqDevList.stream().collect(Collectors.groupingBy(PqDev::getReportState, Collectors.counting()));
|
||||
//
|
||||
// List<Map<String, Object>> checkStateData = getCheckStatePieData(checkStateMap);
|
||||
// List<Map<String, Object>> checkResultData = getCheckResultPieData(checkResultMap);
|
||||
// List<Map<String, Object>> reportStateData = getReportStatePieData(reportStateMap);
|
||||
//
|
||||
// List<List<Map<String, Object>>> result = new ArrayList<>();
|
||||
// result.add(checkStateData);
|
||||
// result.add(checkResultData);
|
||||
// result.add(reportStateData);
|
||||
// return result;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public PqDevVO getPqDevById(String id) {
|
||||
@@ -396,22 +406,37 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
return this.baseMapper.selectDevInfo(devIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean documented(String id) {
|
||||
// 只有检测完成的设备才可以进行归档
|
||||
PqDev pqDev = this.getById(id);
|
||||
if (ObjectUtil.isNotNull(pqDev) && !pqDev.getCheckState().equals(CheckStateEnum.CHECKED.getValue())) {
|
||||
return this.lambdaUpdate()
|
||||
.set(PqDev::getDocumentState, DevDocumentStateEnum.DOCUMENTED.getValue())
|
||||
.set(PqDev::getCheckState, CheckStateEnum.DOCUMENTED.getValue())
|
||||
.eq(PqDev::getId, id)
|
||||
.update();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检测状态饼状图数据
|
||||
*
|
||||
* @param map 检测状态分组map
|
||||
* @return 检测状态饼状图数据
|
||||
*/
|
||||
private List<Map<String, Object>> getCheckStatePieData(Map<Integer, Long> map) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (CheckStateEnum e : CheckStateEnum.values()) {
|
||||
Map<String, Object> temp = new HashMap<>();
|
||||
temp.put("name", e.getMsg());
|
||||
temp.put("value", map.getOrDefault(e.getValue(), 0L));
|
||||
result.add(temp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// private List<Map<String, Object>> getCheckStatePieData(Map<Integer, Long> map) {
|
||||
// List<Map<String, Object>> result = new ArrayList<>();
|
||||
// for (CheckStateEnum e : CheckStateEnum.values()) {
|
||||
// Map<String, Object> temp = new HashMap<>();
|
||||
// temp.put("name", e.getMsg());
|
||||
// temp.put("value", map.getOrDefault(e.getValue(), 0L));
|
||||
// result.add(temp);
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取检测结果饼状图数据
|
||||
@@ -419,16 +444,16 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
* @param map 检测结果分组map
|
||||
* @return 检测结果饼状图数据
|
||||
*/
|
||||
private List<Map<String, Object>> getCheckResultPieData(Map<Integer, Long> map) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (CheckResultEnum e : CheckResultEnum.values()) {
|
||||
Map<String, Object> temp = new HashMap<>();
|
||||
temp.put("name", e.getMsg());
|
||||
temp.put("value", map.getOrDefault(e.getValue(), 0L));
|
||||
result.add(temp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// private List<Map<String, Object>> getCheckResultPieData(Map<Integer, Long> map) {
|
||||
// List<Map<String, Object>> result = new ArrayList<>();
|
||||
// for (CheckResultEnum e : CheckResultEnum.values()) {
|
||||
// Map<String, Object> temp = new HashMap<>();
|
||||
// temp.put("name", e.getMsg());
|
||||
// temp.put("value", map.getOrDefault(e.getValue(), 0L));
|
||||
// result.add(temp);
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取报告状态饼状图数据
|
||||
@@ -436,16 +461,16 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
* @param map 报告状态分组map
|
||||
* @return 报告状态饼状图数据
|
||||
*/
|
||||
private List<Map<String, Object>> getReportStatePieData(Map<Integer, Long> map) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (DevReportStateEnum e : DevReportStateEnum.values()) {
|
||||
Map<String, Object> temp = new HashMap<>();
|
||||
temp.put("name", e.getMsg());
|
||||
temp.put("value", map.getOrDefault(e.getValue(), 0L));
|
||||
result.add(temp);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// private List<Map<String, Object>> getReportStatePieData(Map<Integer, Long> map) {
|
||||
// List<Map<String, Object>> result = new ArrayList<>();
|
||||
// for (DevReportStateEnum e : DevReportStateEnum.values()) {
|
||||
// Map<String, Object> temp = new HashMap<>();
|
||||
// temp.put("name", e.getMsg());
|
||||
// temp.put("value", map.getOrDefault(e.getValue(), 0L));
|
||||
// result.add(temp);
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 检查设备是否重复
|
||||
|
||||
@@ -10,6 +10,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -30,6 +31,7 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl<PqErrSysDtlsMapper, PqE
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean addPqErrSysDtls(String pqErrSysId, List<PqErrSysDtlsParam> list) {
|
||||
List<PqErrSysDtls> data = new ArrayList<>();
|
||||
for (PqErrSysDtlsParam param : list) {
|
||||
@@ -42,6 +44,7 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl<PqErrSysDtlsMapper, PqE
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqErrSysDtls(String pqErrSysId, List<PqErrSysDtlsParam> list) {
|
||||
//先按照pqErrSysId全部删除
|
||||
this.deletePqErrSysDtlsByPqErrSysId(Collections.singletonList(pqErrSysId));
|
||||
@@ -51,6 +54,7 @@ public class PqErrSysDtlsServiceImpl extends ServiceImpl<PqErrSysDtlsMapper, PqE
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqErrSysDtlsByPqErrSysId(List<String> pqErrSysIds) {
|
||||
QueryWrapper<PqErrSysDtls> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("pq_err_sys_dtls.Error_Sys_Id", pqErrSysIds);
|
||||
|
||||
@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
@@ -63,6 +64,7 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean addPqErrSys(PqErrSysParam param) {
|
||||
PqErrSys pqErrSys = new PqErrSys();
|
||||
BeanUtils.copyProperties(param, pqErrSys);
|
||||
@@ -77,6 +79,7 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqErrSys(PqErrSysParam.UpdateParam param) {
|
||||
PqErrSys pqErrSys = new PqErrSys();
|
||||
BeanUtils.copyProperties(param, pqErrSys);
|
||||
@@ -88,6 +91,7 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqErrSys(List<String> ids) {
|
||||
pqErrSysDtlsService.deletePqErrSysDtlsByPqErrSysId(ids);
|
||||
this.lambdaUpdate().in(PqErrSys::getId, ids).set(PqErrSys::getState, DataStateEnum.DELETED.getCode()).update();
|
||||
@@ -112,6 +116,7 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public List<Map<String, Object>> listAllPqErrSys() {
|
||||
List<PqErrSys> pqErrSysList = this.lambdaQuery().eq(PqErrSys::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||
List<Map<String, Object>> result = pqErrSysList.stream().map(pqErrSys -> {
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.njcn.gather.system.dictionary.service.IDictDataService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -38,6 +39,7 @@ public class PqMonitorServiceImpl extends ServiceImpl<PqMonitorMapper, PqMonitor
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean addPqMonitorByDevId(String devId, List<PqMonitorParam> pqMonitorParamList) {
|
||||
List<PqMonitor> pqMonitorList = BeanUtil.copyToList(pqMonitorParamList, PqMonitor.class);
|
||||
pqMonitorList.forEach(pqMonitor -> pqMonitor.setDevId(devId));
|
||||
@@ -45,6 +47,7 @@ public class PqMonitorServiceImpl extends ServiceImpl<PqMonitorMapper, PqMonitor
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqMonitorByDevId(String devId) {
|
||||
QueryWrapper<PqMonitor> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("pq_monitor.Dev_Id", devId);
|
||||
@@ -52,6 +55,7 @@ public class PqMonitorServiceImpl extends ServiceImpl<PqMonitorMapper, PqMonitor
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqMonitorByDevId(String devId, List<PqMonitorParam> paramList) {
|
||||
// 先删除原有数据
|
||||
this.deletePqMonitorByDevId(devId);
|
||||
|
||||
@@ -196,7 +196,7 @@ public interface DevValidMessage {
|
||||
|
||||
String ERRORSYS_NOT_BLANK = "误差体系不能为空";
|
||||
|
||||
String TIMECHECK_NOT_BLANK = "守时检测不能为空";
|
||||
String TIMECHECK_NOT_BLANK = "是否做守时检测不能为空";
|
||||
|
||||
String FACTOR_FLAG_NOT_BLANK = "是否支持系数校准不能为空";
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.njcn.gather.device.script.service.IPqScriptDtlsService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -45,11 +46,13 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
private final PqScriptMapper pqScriptMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean savePqScriptDtls(PqScriptDtls pqScriptDtls) {
|
||||
return this.save(pqScriptDtls);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqScriptDtlsByIds(List<String> ids) {
|
||||
LambdaQueryWrapper<PqScriptDtls> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(PqScriptDtls::getId, ids);
|
||||
@@ -57,6 +60,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqScriptDtlsByScriptId(List<String> scriptIds) {
|
||||
LambdaQueryWrapper<PqScriptDtls> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(PqScriptDtls::getScriptId, scriptIds);
|
||||
@@ -64,6 +68,7 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqScriptDtls(PqScriptDtls pqScriptDtls) {
|
||||
return this.updateById(pqScriptDtls);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
@@ -54,6 +55,7 @@ public class PqScriptServiceImpl extends ServiceImpl<PqScriptMapper, PqScript> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean addPqScript(PqScriptParam param) {
|
||||
PqScript pqScript = new PqScript();
|
||||
BeanUtils.copyProperties(param, pqScript);
|
||||
@@ -63,6 +65,7 @@ public class PqScriptServiceImpl extends ServiceImpl<PqScriptMapper, PqScript> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqScript(PqScriptParam.UpdateParam param) {
|
||||
PqScript pqScript = new PqScript();
|
||||
BeanUtils.copyProperties(param, pqScript);
|
||||
@@ -71,6 +74,7 @@ public class PqScriptServiceImpl extends ServiceImpl<PqScriptMapper, PqScript> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqScript(List<String> ids) {
|
||||
//删除对应的脚本详情
|
||||
pqScriptDtlsService.deletePqScriptDtlsByScriptId(ids);
|
||||
@@ -81,6 +85,7 @@ public class PqScriptServiceImpl extends ServiceImpl<PqScriptMapper, PqScript> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean upgradeToTemplate(String id) {
|
||||
PqScript pqScript = this.lambdaQuery().eq(PqScript::getId, id).one();
|
||||
if (pqScript != null) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -59,6 +60,7 @@ public class PqSourceServiceImpl extends ServiceImpl<PqSourceMapper, PqSource> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean addPqSource(PqSourceParam param) {
|
||||
PqSource pqSource = new PqSource();
|
||||
BeanUtil.copyProperties(param, pqSource);
|
||||
@@ -69,6 +71,7 @@ public class PqSourceServiceImpl extends ServiceImpl<PqSourceMapper, PqSource> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean updatePqSource(PqSourceParam.UpdateParam param) {
|
||||
PqSource pqSource = new PqSource();
|
||||
BeanUtil.copyProperties(param, pqSource);
|
||||
@@ -77,6 +80,7 @@ public class PqSourceServiceImpl extends ServiceImpl<PqSourceMapper, PqSource> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public boolean deletePqSource(List<String> ids) {
|
||||
return this.lambdaUpdate().in(PqSource::getId, ids).set(PqSource::getState, DataStateEnum.DELETED.getCode()).update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user