升级功能调整
This commit is contained in:
@@ -66,7 +66,5 @@ public class CsSoftInfoController extends BaseController {
|
||||
csSoftInfoService.removeById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.njcn.csdevice.controller.equipment;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.po.CsUpgradeLogs;
|
||||
import com.njcn.csdevice.service.CsUpgradeLogsService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2026-04-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/csUpgradeLogs")
|
||||
@Api(tags = "装置升级日志")
|
||||
@AllArgsConstructor
|
||||
@Validated
|
||||
public class CsUpgradeLogsController extends BaseController {
|
||||
private final CsUpgradeLogsService csUpgradeLogsService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增升级日志")
|
||||
@ApiImplicitParam(name = "csUpgradeLogs", value = "日志参数", required = true)
|
||||
public HttpResult add(@RequestBody CsUpgradeLogs csUpgradeLogs) {
|
||||
csUpgradeLogs.setUserName(RequestUtil.getUsername());
|
||||
csUpgradeLogs.setLoginName(RequestUtil.getLoginName());
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
return HttpResultUtil.assembleCommonResponseResult(csUpgradeLogsService.save(csUpgradeLogs) ? CommonResponseEnum.SUCCESS : CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@GetMapping("/getByDevId")
|
||||
@ApiOperation("查询指定devId的所有升级日志")
|
||||
@ApiImplicitParam(name = "devId", value = "装置Id", required = true)
|
||||
public HttpResult<List<CsUpgradeLogs>> getByDevId(@RequestBody String devId) {
|
||||
String methodDescribe = getMethodDescribe("getByDevId");
|
||||
List<CsUpgradeLogs> result = csUpgradeLogsService.lambdaQuery().eq(CsUpgradeLogs::getDevId, devId).list();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.param.CsEdDataAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEdDataAuditParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEdDataQueryParm;
|
||||
import com.njcn.csdevice.pojo.po.CsEdDataPO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEdDataVO;
|
||||
import com.njcn.csdevice.service.CsEdDataService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -79,4 +80,14 @@ public class CsEdDataController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getById")
|
||||
@ApiOperation("根据id查询")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true)
|
||||
public HttpResult<CsEdDataPO> getById(@Validated @RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getById");
|
||||
CsEdDataPO dataPO = csEdDataService.getById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dataPO, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsUpgradeLogs;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2026-04-23
|
||||
*/
|
||||
public interface CsUpgradeLogsMapper extends BaseMapper<CsUpgradeLogs> {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.CsUpgradeLogs;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2026-04-23
|
||||
*/
|
||||
public interface CsUpgradeLogsService extends IService<CsUpgradeLogs> {
|
||||
}
|
||||
@@ -43,8 +43,8 @@ public class CsEdDataServiceImpl extends ServiceImpl<CsEdDataMapper, CsEdDataPO>
|
||||
public boolean addEdData(CsEdDataAddParm csEdDataAddParm) {
|
||||
CsEdDataPO csEdDataPO = new CsEdDataPO();
|
||||
BeanUtils.copyProperties(csEdDataAddParm, csEdDataPO);
|
||||
String remoteDir = OssPath.EDDATA + csEdDataAddParm.getDevTypeName() + StrUtil.SLASH + csEdDataAddParm.getVersionNo() + StrUtil.SLASH;
|
||||
String filePath = fileStorageUtil.uploadMultipart(csEdDataAddParm.getFile(), remoteDir);
|
||||
String remoteDir = StrUtil.SLASH + OssPath.EDDATA + csEdDataAddParm.getDevTypeName() + StrUtil.SLASH + csEdDataAddParm.getVersionNo() + StrUtil.SLASH;
|
||||
String filePath = fileStorageUtil.uploadMultipart(csEdDataAddParm.getFile(), remoteDir, true);
|
||||
csEdDataPO.setCrc(csEdDataAddParm.getCrcInfo());
|
||||
csEdDataPO.setFilePath(filePath);
|
||||
csEdDataPO.setStatus("1");
|
||||
@@ -58,7 +58,7 @@ public class CsEdDataServiceImpl extends ServiceImpl<CsEdDataMapper, CsEdDataPO>
|
||||
CsEdDataPO csEdDataPO = new CsEdDataPO();
|
||||
BeanUtils.copyProperties(csEdDataAuditParm, csEdDataPO);
|
||||
if (!Objects.isNull(csEdDataAuditParm.getFile())) {
|
||||
String filePath = fileStorageUtil.uploadMultipart(csEdDataAuditParm.getFile(), OssPath.EDDATA);
|
||||
String filePath = fileStorageUtil.uploadMultipart(csEdDataAuditParm.getFile(), StrUtil.SLASH + OssPath.EDDATA + csEdDataAuditParm.getDevTypeName() + StrUtil.SLASH + csEdDataAuditParm.getVersionNo() + StrUtil.SLASH, true);
|
||||
csEdDataPO.setFilePath(filePath);
|
||||
}
|
||||
boolean b = this.updateById(csEdDataPO);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.CsUpgradeLogsMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsUpgradeLogs;
|
||||
import com.njcn.csdevice.service.CsUpgradeLogsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2026-04-23
|
||||
*/
|
||||
@Service
|
||||
public class CsUpgradeLogsServiceImpl extends ServiceImpl<CsUpgradeLogsMapper, CsUpgradeLogs> implements CsUpgradeLogsService {
|
||||
}
|
||||
Reference in New Issue
Block a user