代码优化
This commit is contained in:
@@ -51,9 +51,6 @@ public interface EquipmentFeignClient {
|
|||||||
@PostMapping("/updateModuleNumber")
|
@PostMapping("/updateModuleNumber")
|
||||||
HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number);
|
HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number);
|
||||||
|
|
||||||
@PostMapping("/updateLedger")
|
|
||||||
HttpResult<String> updateLedger(@RequestParam("nDid") String nDid,@RequestParam("engineeringId") String engineeringId,@RequestParam("projectId") String projectId);
|
|
||||||
|
|
||||||
@PostMapping("/getAll")
|
@PostMapping("/getAll")
|
||||||
HttpResult<List<CsEquipmentDeliveryPO>> getAll();
|
HttpResult<List<CsEquipmentDeliveryPO>> getAll();
|
||||||
|
|
||||||
|
|||||||
@@ -72,12 +72,6 @@ public class EquipmentFeignClientFallbackFactory implements FallbackFactory<Equi
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpResult<String> updateLedger(String nDid, String engineeringId, String projectId) {
|
|
||||||
log.error("{}异常,降级处理,异常为:{}","更新设备预设工程和项目id数据异常",cause.toString());
|
|
||||||
throw new BusinessException(finalExceptionEnum);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<CsEquipmentDeliveryPO>> getAll() {
|
public HttpResult<List<CsEquipmentDeliveryPO>> getAll() {
|
||||||
log.error("{}异常,降级处理,异常为:{}","获取所有装置",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取所有装置",cause.toString());
|
||||||
|
|||||||
@@ -303,20 +303,6 @@ public class EquipmentDeliveryController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
|
||||||
@PostMapping("/updateLedger")
|
|
||||||
@ApiOperation("更新设备预设工程和项目id")
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "nDid", value = "网络设备码", required = true),
|
|
||||||
@ApiImplicitParam(name = "engineeringId", value = "工程id", required = true),
|
|
||||||
@ApiImplicitParam(name = "projectId", value = "项目id", required = true)
|
|
||||||
})
|
|
||||||
public HttpResult<String> updateLedger(@RequestParam("nDid") String nDid,@RequestParam("engineeringId") String engineeringId,@RequestParam("projectId") String projectId){
|
|
||||||
String methodDescribe = getMethodDescribe("updateLedger");
|
|
||||||
csEquipmentDeliveryService.updateLedger(nDid,engineeringId,projectId);
|
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/rebootDevice")
|
@PostMapping("/rebootDevice")
|
||||||
@ApiOperation("重启设备")
|
@ApiOperation("重启设备")
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
|||||||
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
import com.njcn.csdevice.pojo.vo.CsEquipmentDeliveryVO;
|
||||||
import com.njcn.csdevice.pojo.vo.DeviceManagerVO;
|
import com.njcn.csdevice.pojo.vo.DeviceManagerVO;
|
||||||
import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -122,8 +121,6 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
|||||||
*/
|
*/
|
||||||
void updateModuleNumber(String nDid, Integer number);
|
void updateModuleNumber(String nDid, Integer number);
|
||||||
|
|
||||||
void updateLedger(String nDid,String engineeringId,String projectId);
|
|
||||||
|
|
||||||
boolean rebootDevice(String nDid);
|
boolean rebootDevice(String nDid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -759,20 +759,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateLedger(String nDid,String engineeringId,String projectId) {
|
|
||||||
boolean result;
|
|
||||||
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
|
||||||
lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid)
|
|
||||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
|
||||||
.set(CsEquipmentDeliveryPO::getAssociatedEngineering,engineeringId)
|
|
||||||
.set(CsEquipmentDeliveryPO::getAssociatedProject,projectId);
|
|
||||||
result = this.update(lambdaUpdateWrapper);
|
|
||||||
if (result) {
|
|
||||||
refreshDeviceDataCache();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean rebootDevice(String nDid) {
|
public boolean rebootDevice(String nDid) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|||||||
@@ -221,8 +221,13 @@ public class CsAppReportServiceImpl extends ServiceImpl<CsAppReportMapper, CsApp
|
|||||||
vo.setEventNums(item.getEventList().split(",").length);
|
vo.setEventNums(item.getEventList().split(",").length);
|
||||||
vo.setFilePath(item.getFilePath());
|
vo.setFilePath(item.getFilePath());
|
||||||
vo.setIsComplete(Objects.isNull(item.getFilePath()) ? 0 : 1);
|
vo.setIsComplete(Objects.isNull(item.getFilePath()) ? 0 : 1);
|
||||||
vo.setApplyUser(userVO.getName());
|
String applyUser = item.getCreateBy();
|
||||||
|
if (applyUser != null && !applyUser.isEmpty()) {
|
||||||
|
UserVO applyUserVo = userFeignClient.getUserById(applyUser).getData();
|
||||||
|
vo.setApplyUser(Objects.isNull(applyUserVo)? null : applyUserVo.getName());
|
||||||
|
} else {
|
||||||
|
vo.setApplyUser(null);
|
||||||
|
}
|
||||||
CsLinePO linePO = csLineFeignClient.getById(item.getLineId()).getData();
|
CsLinePO linePO = csLineFeignClient.getById(item.getLineId()).getData();
|
||||||
DevDetailDTO devDetailDTO = csLedgerFeignClient.queryDevDetail(linePO.getDeviceId()).getData();
|
DevDetailDTO devDetailDTO = csLedgerFeignClient.queryDevDetail(linePO.getDeviceId()).getData();
|
||||||
vo.setLineName(linePO.getName());
|
vo.setLineName(linePO.getName());
|
||||||
|
|||||||
Reference in New Issue
Block a user