feat:意见读取方法;检定校准、期间核查增加意见返回
This commit is contained in:
@@ -83,4 +83,13 @@ public class DataOpinionRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
//===========扩展字段
|
||||
|
||||
@Schema(description = "审批时间年月日")
|
||||
@ExcelProperty("审批时间年月日")
|
||||
private String opinionTimeYYYYMMDD;
|
||||
|
||||
@Schema(description = "base64签名图片")
|
||||
private String signatureIdBase64;
|
||||
}
|
||||
@@ -28,6 +28,8 @@ public interface DataOpinionService {
|
||||
|
||||
List<DataOpinionDO> getListByFlowInsId(String flowInsId);
|
||||
|
||||
JSONObject assembleOpinion(Long busId);
|
||||
|
||||
/**
|
||||
* 创建审批意见
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zt.plat.module.qms.common.data.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.common.data.dal.dataobject.DataOpinionDO;
|
||||
@@ -105,6 +107,30 @@ public class DataOpinionServiceImpl implements DataOpinionService {
|
||||
return dataOpinionMapper.selectList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject assembleOpinion(Long busId) {
|
||||
List<DataOpinionDO> opinionList = this.getListByBusId(busId);
|
||||
List<DataOpinionRespVO> opinionRespVOList = BeanUtils.toBean(opinionList, DataOpinionRespVO.class);
|
||||
List<Long> signatureIdList = opinionRespVOList.stream().map(DataOpinionRespVO::getOpinionSignatureId).distinct().toList();
|
||||
List<ConfigUserSignatureDO> signatureList = new ArrayList<>();
|
||||
if(!signatureIdList.isEmpty())
|
||||
signatureList = configUserSignatureService.getByIdList(signatureIdList);
|
||||
JSONObject opinion = new JSONObject();
|
||||
for(DataOpinionRespVO opinionRespVO : opinionRespVOList){
|
||||
for(ConfigUserSignatureDO signature : signatureList){
|
||||
if(signature.getId().equals(opinionRespVO.getOpinionSignatureId())){
|
||||
opinionRespVO.setSignatureIdBase64(signature.getSignatureContent());
|
||||
}
|
||||
}
|
||||
if(opinionRespVO.getOpinionTime() != null){
|
||||
opinionRespVO.setOpinionTimeYYYYMMDD(DateUtil.format(opinionRespVO.getOpinionTime(), "yyyy-MM-dd"));
|
||||
}
|
||||
String nodeKey = opinionRespVO.getNodeKey();
|
||||
opinion.put(nodeKey, opinionRespVO);
|
||||
}
|
||||
return opinion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataOpinionRespVO createDataOpinion(DataOpinionSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
|
||||
@@ -67,9 +67,10 @@ public class DeviceCalibrationController extends AbstractFileUploadController im
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备-检定校准")
|
||||
public CommonResult<Boolean> updateDeviceCalibration(@Valid @RequestBody DeviceCalibrationSaveReqVO updateReqVO) {
|
||||
deviceCalibrationService.updateDeviceCalibration(updateReqVO);
|
||||
return success(true);
|
||||
public CommonResult<DeviceCalibrationRespVO> updateDeviceCalibration(@Valid @RequestBody DeviceCalibrationSaveReqVO updateReqVO) {
|
||||
DeviceCalibrationDO entity = deviceCalibrationService.updateDeviceCalibration(updateReqVO);
|
||||
DeviceCalibrationRespVO vo = BeanUtils.toBean(entity, DeviceCalibrationRespVO.class);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
|
||||
@@ -65,9 +65,10 @@ public class DevicePeriodCheckController extends AbstractFileUploadController im
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备-期间核查")
|
||||
public CommonResult<Boolean> updateDevicePeriodCheck(@Valid @RequestBody DevicePeriodCheckSaveReqVO updateReqVO) {
|
||||
devicePeriodCheckService.updateDevicePeriodCheck(updateReqVO);
|
||||
return success(true);
|
||||
public CommonResult<DevicePeriodCheckRespVO> updateDevicePeriodCheck(@Valid @RequestBody DevicePeriodCheckSaveReqVO updateReqVO) {
|
||||
DevicePeriodCheckDO entity = devicePeriodCheckService.updateDevicePeriodCheck(updateReqVO);
|
||||
DevicePeriodCheckRespVO vo = BeanUtils.toBean(entity, DevicePeriodCheckRespVO.class);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
|
||||
@@ -52,4 +52,7 @@ public class DeviceCalibrationVO extends DeviceCalibrationRespVO{
|
||||
private String deviceCode; //管理编号
|
||||
|
||||
private String factoryCode; //出厂编号
|
||||
|
||||
//============其他字段============
|
||||
private JSONObject signatureData;
|
||||
}
|
||||
|
||||
@@ -51,4 +51,9 @@ public class DevicePeriodCheckVO extends DevicePeriodCheckRespVO{
|
||||
private String deviceCode; //管理编号
|
||||
|
||||
private String factoryCode; //出厂编号
|
||||
|
||||
|
||||
//============其他字段============
|
||||
private JSONObject signatureData;
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface DeviceCalibrationService {
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceCalibration(@Valid DeviceCalibrationSaveReqVO updateReqVO);
|
||||
DeviceCalibrationDO updateDeviceCalibration(@Valid DeviceCalibrationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备-检定校准
|
||||
|
||||
@@ -205,12 +205,13 @@ public class DeviceCalibrationServiceImpl implements DeviceCalibrationService, B
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceCalibration(DeviceCalibrationSaveReqVO updateReqVO) {
|
||||
public DeviceCalibrationDO updateDeviceCalibration(DeviceCalibrationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceCalibrationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceCalibrationDO updateObj = BeanUtils.toBean(updateReqVO, DeviceCalibrationDO.class);
|
||||
deviceCalibrationMapper.updateById(updateObj);
|
||||
return updateObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -256,7 +257,11 @@ public class DeviceCalibrationServiceImpl implements DeviceCalibrationService, B
|
||||
PageResult<DeviceCalibrationVO> pageResult = new PageResult<>(pageList.getRecords(), pageList.getTotal());
|
||||
if(pageResult.getList().isEmpty())
|
||||
return null;
|
||||
return pageResult.getList().get(0);
|
||||
DeviceCalibrationVO vo = pageResult.getList().get(0);
|
||||
//处理审批意见
|
||||
JSONObject opinion = dataOpinionService.assembleOpinion(id);
|
||||
vo.setSignatureData( opinion);
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,7 +47,7 @@ public interface DevicePeriodCheckService {
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDevicePeriodCheck(@Valid DevicePeriodCheckSaveReqVO updateReqVO);
|
||||
DevicePeriodCheckDO updateDevicePeriodCheck(@Valid DevicePeriodCheckSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备-期间核查
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user