复制误差体系

This commit is contained in:
caozehui
2025-03-17 11:18:44 +08:00
parent 04bd8a7db3
commit a108b295d1
4 changed files with 34 additions and 25 deletions

View File

@@ -125,19 +125,19 @@ public class PqErrSysController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
} }
// @OperateInfo(operateType = OperateType.ADD) @OperateInfo(operateType = OperateType.ADD)
// @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<Object> 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, null, methodDescribe);
// } else { } else {
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
// } }
// } }
} }

View File

@@ -78,5 +78,5 @@ public interface IPqErrSysService extends IService<PqErrSys> {
* @param id 误差体系id * @param id 误差体系id
* @return 成功返回true失败返回false * @return 成功返回true失败返回false
*/ */
//boolean copyPqErrSys(String id); boolean copyPqErrSys(String id);
} }

View File

@@ -1,5 +1,6 @@
package com.njcn.gather.err.service.impl; package com.njcn.gather.err.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.text.StrPool; import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -7,15 +8,16 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException; import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.gather.device.pojo.enums.DevResponseEnum;
import com.njcn.gather.err.mapper.PqErrSysMapper; import com.njcn.gather.err.mapper.PqErrSysMapper;
import com.njcn.gather.err.pojo.enums.ErrResponseEnum; import com.njcn.gather.err.pojo.enums.ErrResponseEnum;
import com.njcn.gather.err.pojo.param.PqErrSysDtlsParam;
import com.njcn.gather.err.pojo.param.PqErrSysParam; import com.njcn.gather.err.pojo.param.PqErrSysParam;
import com.njcn.gather.err.pojo.po.PqErrSys; import com.njcn.gather.err.pojo.po.PqErrSys;
import com.njcn.gather.err.pojo.po.PqErrSysDtls; import com.njcn.gather.err.pojo.po.PqErrSysDtls;
import com.njcn.gather.err.pojo.vo.PqErrSysDtlsVO; import com.njcn.gather.err.pojo.vo.PqErrSysDtlsVO;
import com.njcn.gather.err.service.IPqErrSysDtlsService; import com.njcn.gather.err.service.IPqErrSysDtlsService;
import com.njcn.gather.err.service.IPqErrSysService; import com.njcn.gather.err.service.IPqErrSysService;
import com.njcn.gather.device.pojo.enums.DevResponseEnum;
import com.njcn.gather.system.dictionary.pojo.po.DictData; import com.njcn.gather.system.dictionary.pojo.po.DictData;
import com.njcn.gather.system.dictionary.pojo.po.DictTree; import com.njcn.gather.system.dictionary.pojo.po.DictTree;
import com.njcn.gather.system.dictionary.service.IDictDataService; import com.njcn.gather.system.dictionary.service.IDictDataService;
@@ -189,15 +191,17 @@ public class PqErrSysServiceImpl extends ServiceImpl<PqErrSysMapper, PqErrSys> i
throw new BusinessException(DevResponseEnum.PQ_ERRSYS_GEN_NAME_ERROR); throw new BusinessException(DevResponseEnum.PQ_ERRSYS_GEN_NAME_ERROR);
} }
// @Override @Override
// public boolean copyPqErrSys(String id) { public boolean copyPqErrSys(String id) {
// PqErrSys pqErrSys = this.getPqErrSysById(id); PqErrSys pqErrSys = this.getPqErrSysById(id);
// pqErrSys.setId(UUID.randomUUID().toString().replaceAll("-", "")); pqErrSys.setId(UUID.randomUUID().toString().replaceAll("-", ""));
// pqErrSys.setName(pqErrSys.getName() + "_副本"); pqErrSys.setName(pqErrSys.getName() + "_copy");
// pqErrSys.setStandardTime(LocalDate.of(pqErrSys.getStandardTime().getYear(), 1, 1)); pqErrSys.setStandardName(pqErrSys.getStandardName() + "_copy");
// pqErrSys.getPqErrSysDtlsList().forEach(pqErrSysDtls -> pqErrSysDtls.setId(UUID.randomUUID().toString().replaceAll("-", ""))); pqErrSys.setStandardTime(LocalDate.of(pqErrSys.getStandardTime().getYear(), 1, 1));
// return this.save(pqErrSys); List<PqErrSysDtlsParam> pqErrSysDtlsParams = BeanUtil.copyToList(pqErrSys.getPqErrSysDtlsList(), PqErrSysDtlsParam.class);
// } pqErrSysDtlsService.addPqErrSysDtls(pqErrSys.getId(), pqErrSysDtlsParams);
return this.save(pqErrSys);
}
/** /**
* 生成误差体系名称(标准号+年份+设备等级) * 生成误差体系名称(标准号+年份+设备等级)

View File

@@ -25,4 +25,9 @@ public class RegInfoData {
* 到期日期 * 到期日期
*/ */
private List<String> expireDateList; private List<String> expireDateList;
/**
* 使用场景
*/
private String scene;
} }