代码调整、修改设备检测人bug
This commit is contained in:
@@ -63,6 +63,11 @@ public class PreDetectionController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 程控源-源通讯校验
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/ytxCheckSimulate")
|
||||
@OperateInfo
|
||||
@ApiOperation("源通讯校验")
|
||||
@@ -74,7 +79,7 @@ public class PreDetectionController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟检测
|
||||
* 程控源检测
|
||||
*/
|
||||
@PostMapping("/startSimulateTest")
|
||||
@OperateInfo
|
||||
@@ -87,7 +92,7 @@ public class PreDetectionController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭检测
|
||||
* 关闭检测-程控源
|
||||
*/
|
||||
@PostMapping("/closeSimulateTest")
|
||||
@OperateInfo
|
||||
|
||||
@@ -1074,7 +1074,7 @@ public class SocketDevResponseService {
|
||||
checkDataParam.setIsValueTypeName(false);
|
||||
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
||||
|
||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode());
|
||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(),param.getUserId());
|
||||
CnSocketUtil.quitSend(param);
|
||||
}
|
||||
successComm.clear();
|
||||
|
||||
@@ -63,4 +63,6 @@ public class PreDetectionParam {
|
||||
private String code;
|
||||
|
||||
private Boolean sendWebMsg;
|
||||
|
||||
private String userId;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class PreDetectionServiceImpl implements PreDetectionService {
|
||||
checkDataParam.setIsValueTypeName(false);
|
||||
List<String> valueType = iPqScriptCheckDataService.getValueType(checkDataParam);
|
||||
|
||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode());
|
||||
iPqDevService.updateResult(param.getDevIds(), valueType, param.getCode(),param.getUserId());
|
||||
CnSocketUtil.quitSend(param);
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ public class PqDevController extends BaseController {
|
||||
@ApiImplicitParam(name = "file", value = "被检设备数据文件", required = true),
|
||||
@ApiImplicitParam(name = "patternId", value = "模式id", required = true)
|
||||
})
|
||||
public HttpResult<String> importDev(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
||||
public HttpResult<Object> importDev(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("importDev");
|
||||
LogUtil.njcnDebug(log, "{},上传文件为:{}", methodDescribe, file.getOriginalFilename());
|
||||
boolean fileType = FileUtil.judgeFileIsExcel(file.getOriginalFilename());
|
||||
@@ -187,14 +187,14 @@ public class PqDevController extends BaseController {
|
||||
@PostMapping("/documented")
|
||||
@ApiOperation("设备归档")
|
||||
@ApiImplicitParam(name = "id", value = "设备id", required = true)
|
||||
public HttpResult<List<PqDev>> documented(@RequestBody List<String> ids) {
|
||||
public HttpResult<Boolean> documented(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("documented");
|
||||
LogUtil.njcnDebug(log, "{},设备id为:{}", methodDescribe, ids);
|
||||
boolean result = pqDevService.documented(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,5 +41,12 @@ public interface PqDevMapper extends MPJBaseMapper<PqDev> {
|
||||
* @param testState
|
||||
*/
|
||||
void updatePlanTestState(@Param("planId")String planId, @Param("testState")Integer testState);
|
||||
|
||||
/**
|
||||
* 根据计划id获取脚本id
|
||||
*
|
||||
* @param planId
|
||||
*/
|
||||
String getScriptIdByPlanId(String planId);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@
|
||||
update ad_plan set Test_State = #{testState} where id = #{planId}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getScriptIdByPlanId" resultType="java.lang.String">
|
||||
SELECT Script_Id FROM ad_plan WHERE id = #{planId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
||||
@@ -151,9 +151,10 @@ public interface IPqDevService extends IService<PqDev> {
|
||||
* @param ids
|
||||
* @param valueType
|
||||
* @param code
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
boolean updateResult(List<String> ids, List<String> valueType, String code);
|
||||
boolean updateResult(List<String> ids, List<String> valueType, String code,String userId);
|
||||
|
||||
void updatePqDevReportState(String devId, int i);
|
||||
|
||||
|
||||
@@ -31,7 +31,11 @@ import com.njcn.gather.device.pojo.vo.ProvinceDevExcel;
|
||||
import com.njcn.gather.device.service.IPqDevService;
|
||||
import com.njcn.gather.monitor.pojo.po.PqMonitor;
|
||||
import com.njcn.gather.monitor.service.IPqMonitorService;
|
||||
import com.njcn.gather.plan.pojo.po.AdPlan;
|
||||
import com.njcn.gather.plan.service.IAdPlanService;
|
||||
import com.njcn.gather.pojo.enums.DetectionResponseEnum;
|
||||
import com.njcn.gather.report.pojo.DevReportParam;
|
||||
import com.njcn.gather.report.service.IPqReportService;
|
||||
import com.njcn.gather.storage.service.DetectionDataDealService;
|
||||
import com.njcn.gather.system.cfg.pojo.enums.SceneEnum;
|
||||
import com.njcn.gather.system.cfg.pojo.po.SysTestConfig;
|
||||
@@ -495,11 +499,12 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateResult(List<String> ids, List<String> valueType, String code) {
|
||||
public boolean updateResult(List<String> ids, List<String> valueType, String code,String userId) {
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
SysTestConfig config = sysTestConfigService.getOneConfig();
|
||||
Map<String, Integer> result = detectionDataDealService.devResult(ids, valueType, code);
|
||||
List<PqDev> list = this.list(new LambdaQueryWrapper<PqDev>().in(PqDev::getId, ids));
|
||||
|
||||
for (PqDev pqDev : list) {
|
||||
if (result.containsKey(pqDev.getId())) {
|
||||
Integer checkState;
|
||||
@@ -518,7 +523,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
.set(PqDev::getReCheckNum, i)
|
||||
.set(PqDev::getCheckState, checkState)
|
||||
.set(PqDev::getCheckResult, result.get(pqDev.getId()))
|
||||
.set(PqDev::getCheckBy, RequestUtil.getUserId())
|
||||
.set(PqDev::getCheckBy, userId)
|
||||
.set(PqDev::getCheckTime, LocalDateTime.now())
|
||||
.set(PqDev::getReportState, DevReportStateEnum.NOT_GENERATED.getValue())
|
||||
.eq(PqDev::getId, pqDev.getId()));
|
||||
|
||||
@@ -136,7 +136,7 @@ public class AdPlanController extends BaseController {
|
||||
@ApiImplicitParam(name = "file", value = "检测计划数据文件", required = true),
|
||||
@ApiImplicitParam(name = "pattern", value = "模式Id", required = true)
|
||||
})
|
||||
public HttpResult<String> importPlan(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
||||
public HttpResult<Object> importPlan(@RequestParam("file") MultipartFile file, @RequestParam("patternId") String patternId, HttpServletResponse response) {
|
||||
String methodDescribe = getMethodDescribe("importCNPlan");
|
||||
LogUtil.njcnDebug(log, "{},上传文件为:{}", methodDescribe, file.getOriginalFilename());
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -70,7 +71,7 @@ public class ReportController extends BaseController {
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("分页查询报告模板")
|
||||
@ApiImplicitParam(name = "param", value = "查询参数", required = true)
|
||||
public HttpResult<Page<PqReportVO>> list(@RequestBody ReportParam.QueryParam queryParam) {
|
||||
public HttpResult<Page<PqReportVO>> list(@RequestBody @Validated ReportParam.QueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询参数为:{}", methodDescribe, queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, pqReportService.list(queryParam), methodDescribe);
|
||||
@@ -90,7 +91,7 @@ public class ReportController extends BaseController {
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增报告模板")
|
||||
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
||||
public HttpResult<Boolean> add(ReportParam reportParam) {
|
||||
public HttpResult<Boolean> add(@RequestBody @Validated ReportParam reportParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},新增参数为:{}", methodDescribe, reportParam);
|
||||
boolean result = pqReportService.add(reportParam);
|
||||
@@ -105,7 +106,7 @@ public class ReportController extends BaseController {
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("更新报告模板")
|
||||
@ApiImplicitParam(name = "param", value = "报告模板参数", required = true)
|
||||
public HttpResult<Boolean> update(ReportParam.UpdateParam reportParam) {
|
||||
public HttpResult<Boolean> update(@RequestBody @Validated ReportParam.UpdateParam reportParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},修改参数为:{}", methodDescribe, reportParam);
|
||||
boolean result = pqReportService.update(reportParam);
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ResultController extends BaseController {
|
||||
@PostMapping("/reCalculate")
|
||||
@ApiOperation("重新计算检测结果")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Object> reCalculate(@RequestBody ResultParam.ChangeErrorSystemParam param) {
|
||||
public HttpResult<Object> reCalculate(@RequestBody @Validated ResultParam.ChangeErrorSystemParam param) {
|
||||
String methodDescribe = getMethodDescribe("reCalculate");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, param);
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ResultController extends BaseController {
|
||||
@PostMapping("/changeErrorSystem")
|
||||
@ApiOperation("更换误差体系")
|
||||
@ApiImplicitParam(name = "param", value = "修改参数", required = true)
|
||||
public HttpResult<Object> changeErrorSystem(@RequestBody ResultParam.ChangeErrorSystemParam param) {
|
||||
public HttpResult<Object> changeErrorSystem(@RequestBody @Validated ResultParam.ChangeErrorSystemParam param) {
|
||||
String methodDescribe = getMethodDescribe("changeErrorSystem");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, param);
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class PqScriptController extends BaseController {
|
||||
@GetMapping("/upgradeToTemplate")
|
||||
@ApiOperation("升级为模板")
|
||||
@ApiImplicitParam(name = "id", value = "检测脚本id", required = true)
|
||||
public HttpResult<Boolean> upgradeToTemplate(@RequestParam("id") String id, HttpServletRequest request) {
|
||||
public HttpResult<Boolean> upgradeToTemplate(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("upgradeToTemplate");
|
||||
LogUtil.njcnDebug(log, "{},升级ID数据为:{}", methodDescribe, id);
|
||||
boolean result = pqScriptService.upgradeToTemplate(id);
|
||||
|
||||
Reference in New Issue
Block a user