app试验管理
This commit is contained in:
parent
5f3c5a7065
commit
2d36aaa573
|
|
@ -4,15 +4,11 @@ import com.bonus.aqgqj.annotation.DecryptAndVerify;
|
|||
import com.bonus.aqgqj.annotation.LogAnnotation;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalAppVo;
|
||||
import com.bonus.aqgqj.app.entity.ExperimentalDetailAppVo;
|
||||
import com.bonus.aqgqj.app.entity.SamplesManageAppVo;
|
||||
import com.bonus.aqgqj.app.entity.TestAppVo;
|
||||
import com.bonus.aqgqj.app.entity.dto.ParamsAppDto;
|
||||
import com.bonus.aqgqj.app.service.ExperimentalAppService;
|
||||
import com.bonus.aqgqj.basis.service.ExperimentalService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
|
@ -76,13 +72,13 @@ public class ExperimentalAppController {
|
|||
return service.getTestBasicInfo(data.getData());
|
||||
}
|
||||
|
||||
// @PostMapping(value = "addTestData")
|
||||
// @DecryptAndVerify(decryptedClass = TestAppVo.class)//加解密统一管理
|
||||
// @LogAnnotation(operModul = "试验详情管理", operation = "新增试验数据", operDesc = "业务级事件", operType = "新增")
|
||||
// // @PreAuthorize("@pms.hasPermission('sys:experimentalTest:add')")
|
||||
// public ServerResponse addTestData(EncryptedReq<TestAppVo> data) {
|
||||
// return service.addTestData(data.getData());
|
||||
// }
|
||||
@PostMapping(value = "addTestData")
|
||||
@DecryptAndVerify(decryptedClass = TestAppVo.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "新增试验数据", operDesc = "业务级事件", operType = "新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:add')")
|
||||
public ServerResponse addTestData(EncryptedReq<TestAppVo> data) {
|
||||
return service.addTestData(data.getData());
|
||||
}
|
||||
//
|
||||
// @PostMapping(value = "editTestData")
|
||||
// @DecryptAndVerify(decryptedClass = TestAppVo.class)//加解密统一管理
|
||||
|
|
@ -100,17 +96,20 @@ public class ExperimentalAppController {
|
|||
// return service.delTestData(data.getData());
|
||||
// }
|
||||
//
|
||||
// @PostMapping(value = "viewTestData")
|
||||
// @DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
// public ServerResponse viewTestData(EncryptedReq<ParamsAppDto> data) {
|
||||
// return service.viewTestData(data.getData());
|
||||
// }
|
||||
//
|
||||
// @PostMapping(value = "commitCheckTestData")
|
||||
// @DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
// @LogAnnotation(operModul = "试验管理", operation = "提交审查数据", operDesc = "业务级事件", operType = "提交审查")
|
||||
// // @PreAuthorize("@pms.hasPermission('sys:experimentalTest:commitCheck')")
|
||||
// public ServerResponse commitCheckTestData(EncryptedReq<ParamsAppDto> data) {
|
||||
// return service.commitCheckTestData(data.getData());
|
||||
// }
|
||||
/**
|
||||
* 试验数据详情
|
||||
*/
|
||||
@PostMapping(value = "viewTestData")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
public ServerResponse viewTestData(EncryptedReq<ParamsAppDto> data) {
|
||||
return service.viewTestData(data.getData());
|
||||
}
|
||||
|
||||
@PostMapping(value = "commitCheckTestData")
|
||||
@DecryptAndVerify(decryptedClass = ParamsAppDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "试验管理", operation = "提交审查数据", operDesc = "业务级事件", operType = "提交审查")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:commitCheck')")
|
||||
public ServerResponse commitCheckTestData(EncryptedReq<ParamsAppDto> data) {
|
||||
return service.commitCheckTestData(data.getData());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,27 +47,27 @@ public interface ExperimentalAppMapper {
|
|||
*/
|
||||
TestAppVo getTestBasicInfo(ParamsAppDto dto);
|
||||
|
||||
// /**
|
||||
// * 添加试验信息
|
||||
// *
|
||||
// * @param vo
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/20 16:13
|
||||
// */
|
||||
// void addExper(TestAppVo vo);
|
||||
//
|
||||
// /**
|
||||
// * 添加试验依据信息数据
|
||||
// *
|
||||
// * @param basisVos
|
||||
// * @param experId
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/20 17:05
|
||||
// */
|
||||
// void addConfigBasis(@Param("list") List<ExperBasisAppVo> basisVos, @Param("experId") Long experId);
|
||||
//
|
||||
/**
|
||||
* 添加试验信息
|
||||
*
|
||||
* @param vo
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 16:13
|
||||
*/
|
||||
void addExper(TestAppVo vo);
|
||||
|
||||
/**
|
||||
* 添加试验依据信息数据
|
||||
*
|
||||
* @param basisVos
|
||||
* @param experId
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 17:05
|
||||
*/
|
||||
void addConfigBasis(@Param("list") List<ExperBasisAppVo> basisVos, @Param("experId") Long experId);
|
||||
|
||||
/**
|
||||
* 查询收样设备-根据设备类型
|
||||
*
|
||||
|
|
@ -118,69 +118,69 @@ public interface ExperimentalAppMapper {
|
|||
*/
|
||||
List<ConfigItemAppVo> getConfiItem(Long id);
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 添加试验项信息
|
||||
// *
|
||||
// * @param configItemsVo
|
||||
// * @param experId
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 17:21
|
||||
// */
|
||||
// void addExperItems(@Param("params") ConfigItemsVo configItemsVo, @Param("experId") Long experId);
|
||||
//
|
||||
// /**
|
||||
// * 添加试验项内容
|
||||
// *
|
||||
// * @param configItemVo
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 17:28
|
||||
// */
|
||||
// void addExperItem(@Param("params") ConfigItemVo configItemVo, @Param("experId") Long experId);
|
||||
//
|
||||
// /**
|
||||
// * 添加试验样品设备表
|
||||
// *
|
||||
// * @param experDevVo
|
||||
// * @param experId
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 17:58
|
||||
// */
|
||||
// void addExperDev(@Param("params") ExperDevVo experDevVo, @Param("experId") Long experId);
|
||||
//
|
||||
// /**
|
||||
// * 添加设备试验项信息
|
||||
// *
|
||||
// * @param experDevItemsVo
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 18:19
|
||||
// */
|
||||
// void addExperDevItems(ExperDevItemsVo experDevItemsVo);
|
||||
//
|
||||
// /**
|
||||
// * 添加设备试验项数据
|
||||
// *
|
||||
// * @param experDevItemVos
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 19:48
|
||||
// */
|
||||
// void addExperDevItem(List<ExperDevItemVo> experDevItemVos);
|
||||
//
|
||||
// /**
|
||||
// * 试验数据详情
|
||||
// *
|
||||
// * @param dto
|
||||
// * @return TestAppVo
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 22:53
|
||||
// */
|
||||
// TestAppVo viewTestData(ParamsAppDto dto);
|
||||
//
|
||||
|
||||
/**
|
||||
* 添加试验项信息
|
||||
*
|
||||
* @param configItemsVo
|
||||
* @param experId
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 17:21
|
||||
*/
|
||||
void addExperItems(@Param("params") ConfigItemsAppVo configItemsVo, @Param("experId") Long experId);
|
||||
|
||||
/**
|
||||
* 添加试验项内容
|
||||
*
|
||||
* @param configItemVo
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 17:28
|
||||
*/
|
||||
void addExperItem(@Param("params") ConfigItemAppVo configItemVo, @Param("experId") Long experId);
|
||||
|
||||
/**
|
||||
* 添加试验样品设备表
|
||||
*
|
||||
* @param experDevVo
|
||||
* @param experId
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 17:58
|
||||
*/
|
||||
void addExperDev(@Param("params") ExperDevAppVo experDevVo, @Param("experId") Long experId);
|
||||
|
||||
/**
|
||||
* 添加设备试验项信息
|
||||
*
|
||||
* @param experDevItemsVo
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 18:19
|
||||
*/
|
||||
void addExperDevItems(ExperDevItemsAppVo experDevItemsVo);
|
||||
|
||||
/**
|
||||
* 添加设备试验项数据
|
||||
*
|
||||
* @param experDevItemVos
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 19:48
|
||||
*/
|
||||
void addExperDevItem(List<ExperDevItemVo> experDevItemVos);
|
||||
|
||||
/**
|
||||
* 试验数据详情
|
||||
*
|
||||
* @param dto
|
||||
* @return TestAppVo
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 22:53
|
||||
*/
|
||||
TestAppVo viewTestData(ParamsAppDto dto);
|
||||
|
||||
// /**
|
||||
// * 添加试验设备数据
|
||||
// *
|
||||
|
|
@ -191,17 +191,17 @@ public interface ExperimentalAppMapper {
|
|||
// * @date 2024/7/21 23:12
|
||||
// */
|
||||
// void addExperConfigDev(@Param("list") List<ConfigDevVo> deviceVos, @Param("experId") Long experId);
|
||||
//
|
||||
// /**
|
||||
// * 试验依据信息
|
||||
// *
|
||||
// * @param dto
|
||||
// * @return List<ExperBasisAppVo>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 23:19
|
||||
// */
|
||||
// List<ExperBasisAppVo> getConfigBasis(ParamsAppDto dto);
|
||||
//
|
||||
|
||||
/**
|
||||
* 试验依据信息
|
||||
*
|
||||
* @param dto
|
||||
* @return List<ExperBasisAppVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 23:19
|
||||
*/
|
||||
List<ExperBasisAppVo> getConfigBasis(ParamsAppDto dto);
|
||||
|
||||
// /**
|
||||
// * 试验设备信息
|
||||
// *
|
||||
|
|
@ -211,37 +211,37 @@ public interface ExperimentalAppMapper {
|
|||
// * @date 2024/7/21 23:22
|
||||
// */
|
||||
// List<ConfigDevVo> getExperConfigDevs(ParamsAppDto dto);
|
||||
//
|
||||
// /**
|
||||
// * 试验项信息
|
||||
// *
|
||||
// * @param dto
|
||||
// * @return List<ConfigItemsVo>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 23:27
|
||||
// */
|
||||
// List<ConfigItemsVo> getExperItems(ParamsAppDto dto);
|
||||
//
|
||||
// /**
|
||||
// * 试验项内容信息
|
||||
// *
|
||||
// * @param id
|
||||
// * @return List<ConfigItemVo>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 23:33
|
||||
// */
|
||||
// List<ConfigItemVo> getExperItem(Long id);
|
||||
//
|
||||
// /**
|
||||
// * 试验样品设备
|
||||
// *
|
||||
// * @param dto
|
||||
// * @return List<ExperDevVo>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 23:37
|
||||
// */
|
||||
// List<ExperDevVo> getExperDev(ParamsAppDto dto);
|
||||
//
|
||||
|
||||
/**
|
||||
* 试验项信息
|
||||
*
|
||||
* @param dto
|
||||
* @return List<ConfigItemsVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 23:27
|
||||
*/
|
||||
List<ConfigItemsAppVo> getExperItems(ParamsAppDto dto);
|
||||
|
||||
/**
|
||||
* 试验项内容信息
|
||||
*
|
||||
* @param id
|
||||
* @return List<ConfigItemVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 23:33
|
||||
*/
|
||||
List<ConfigItemAppVo> getExperItem(Long id);
|
||||
|
||||
/**
|
||||
* 试验样品设备
|
||||
*
|
||||
* @param dto
|
||||
* @return List<ExperDevVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 23:37
|
||||
*/
|
||||
List<ExperDevAppVo> getExperDev(ParamsAppDto dto);
|
||||
|
||||
// /**
|
||||
// * 修改试验信息数据
|
||||
// *
|
||||
|
|
@ -382,69 +382,69 @@ public interface ExperimentalAppMapper {
|
|||
// * @date 2024/7/22 14:13
|
||||
// */
|
||||
// int isCheck(Long id);
|
||||
//
|
||||
// /**
|
||||
// * 判断提交数据中是否存在流程数据或者存在待试验项
|
||||
// *
|
||||
// * @param list
|
||||
// * @return int
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/22 15:24
|
||||
// */
|
||||
// int isNotEditData(List<Long> list);
|
||||
//
|
||||
// /**
|
||||
// * 更新收样表中的状态为待审阅
|
||||
// *
|
||||
// * @param list
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/22 15:33
|
||||
// */
|
||||
// void updateSampleStatus(List<Long> list);
|
||||
//
|
||||
// /**
|
||||
// * 更新试验表中数据为待审阅
|
||||
// *
|
||||
// * @param list
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/22 15:33
|
||||
// */
|
||||
// void updateExperStatus(List<Long> list);
|
||||
//
|
||||
// /**
|
||||
// * 获取收样中的试验项是否全部填写
|
||||
// *
|
||||
// * @param sampleId
|
||||
// * @return List<Integer>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/22 16:09
|
||||
// */
|
||||
// List<Integer> isAllExper(Long sampleId);
|
||||
//
|
||||
// /**
|
||||
// * 更新收样表中的状态为待提交
|
||||
// *
|
||||
// * @param id
|
||||
// * @return void
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/22 16:24
|
||||
// */
|
||||
// void editSampleStatus(Long id);
|
||||
//
|
||||
// /**
|
||||
// * 获取记录编号
|
||||
// * @param testAppVo
|
||||
// * @return List<Integer>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/28 15:52
|
||||
// */
|
||||
// List<Long> getRecordNum(TestAppVo testAppVo);
|
||||
//
|
||||
// /**
|
||||
// * 更新总结
|
||||
// * @param vo
|
||||
// */
|
||||
// void updateExperMony(TestAppVo vo);
|
||||
|
||||
/**
|
||||
* 判断提交数据中是否存在流程数据或者存在待试验项
|
||||
*
|
||||
* @param list
|
||||
* @return int
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 15:24
|
||||
*/
|
||||
int isNotEditData(List<Long> list);
|
||||
|
||||
/**
|
||||
* 更新收样表中的状态为待审阅
|
||||
*
|
||||
* @param list
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 15:33
|
||||
*/
|
||||
void updateSampleStatus(List<Long> list);
|
||||
|
||||
/**
|
||||
* 更新试验表中数据为待审阅
|
||||
*
|
||||
* @param list
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 15:33
|
||||
*/
|
||||
void updateExperStatus(List<Long> list);
|
||||
|
||||
/**
|
||||
* 获取收样中的试验项是否全部填写
|
||||
*
|
||||
* @param sampleId
|
||||
* @return List<Integer>
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 16:09
|
||||
*/
|
||||
List<Integer> isAllExper(Long sampleId);
|
||||
|
||||
/**
|
||||
* 更新收样表中的状态为待提交
|
||||
*
|
||||
* @param id
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 16:24
|
||||
*/
|
||||
void editSampleStatus(Long id);
|
||||
|
||||
/**
|
||||
* 获取记录编号
|
||||
* @param testAppVo
|
||||
* @return List<Integer>
|
||||
* @author cwchen
|
||||
* @date 2024/7/28 15:52
|
||||
*/
|
||||
List<Long> getRecordNum(TestAppVo testAppVo);
|
||||
|
||||
/**
|
||||
* 更新总结
|
||||
* @param vo
|
||||
*/
|
||||
void updateExperMony(TestAppVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
package com.bonus.aqgqj.app.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* @className:ExperDevVo
|
||||
* @author:cwchen
|
||||
* @date:2024-07-21-16:46
|
||||
* @version:1.0
|
||||
* @description:试验样品设备-vo
|
||||
*/
|
||||
@Data
|
||||
public class ExperDevAppVo {
|
||||
|
||||
/**id*/
|
||||
private Long id;
|
||||
/**试验表id */
|
||||
private Long experId;
|
||||
|
||||
@NotNull(message = "收样设备id不能为空", groups = {Query.class})
|
||||
private Long devId;
|
||||
|
||||
/**客户自编号*/
|
||||
@NotBlank(message = "客户自编号不能为空", groups = {Query.class})
|
||||
@Length(max = 32, message = "编号字符长度不能超过32", groups = {Query.class})
|
||||
private String devCode;
|
||||
/**生产厂家*/
|
||||
@NotBlank(message = "生产厂家不能为空", groups = {Query.class})
|
||||
@Length(max = 32, message = "生产厂家字符长度不能超过32", groups = {Query.class})
|
||||
private String manufacturer;
|
||||
/**生产日期*/
|
||||
@NotBlank(message = "生产日期不能为空", groups = {Query.class})
|
||||
@Length(max = 32, message = "生产日期字符长度不能超过32", groups = {Query.class})
|
||||
private String manufactureDate;
|
||||
/**规格型号*/
|
||||
@NotBlank(message = "规格型号不能为空", groups = {Query.class})
|
||||
@Length(max = 32, message = "规格型号字符长度不能超过32", groups = {Query.class})
|
||||
private String devModule;
|
||||
/**外观状态*/
|
||||
@NotBlank(message = "外观状态不能为空", groups = {Query.class})
|
||||
@Length(max = 32, message = "外观状态字符长度不能超过32", groups = {Query.class})
|
||||
private String devStatus;
|
||||
/**设备试验项值*/
|
||||
@NotBlank(message = "设备试验项值不能为空", groups = {Query.class})
|
||||
@Length(max = 2000, message = "设备试验项值字符长度不能超过200", groups = {Query.class})
|
||||
private String devData;
|
||||
/**额外超出的金额默认值0*/
|
||||
@NotBlank(message = "金额不能为空", groups = {Query.class})
|
||||
@Pattern(regexp = "(?:0(?:\\.0{0,2})?|[1-9]\\d{0,7}(?:\\.\\d{1,2})?|100000000(?:\\.0{1,2})?)", message = "金额格式不正确(范围0-100000000并且最多保留两位小数)", groups = {Query.class})
|
||||
private String amount;
|
||||
/**备注*/
|
||||
@NotBlank(message = "备注不能为空", groups = {Query.class})
|
||||
@Length(max = 256, message = "备注字符长度不能超过256", groups = {Query.class})
|
||||
private String remarks;
|
||||
|
||||
@NotNull(message = "部门id不能为空", groups = {Query.class})
|
||||
private Integer departmentId;
|
||||
|
||||
/*是否合格*/
|
||||
private String isHg;
|
||||
|
||||
private String experAmount;
|
||||
|
||||
public interface Query {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备编码(自动生成)
|
||||
*/
|
||||
private String customerCode;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.bonus.aqgqj.app.entity;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperDevItemVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className:ExperDevItemsVo
|
||||
* @author:cwchen
|
||||
* @date:2024-07-21-18:12
|
||||
* @version:1.0
|
||||
* @description:设备试验项信息-vo
|
||||
*/
|
||||
@Data
|
||||
public class ExperDevItemsAppVo {
|
||||
|
||||
/**id*/
|
||||
private Long id;
|
||||
/**试验设备id*/
|
||||
private Long devId;
|
||||
/**实验项id*/
|
||||
private Long itemsId;
|
||||
/**试验项名称*/
|
||||
private String itemsName;
|
||||
/**排序*/
|
||||
private Integer valSort;
|
||||
|
||||
/**设备试验项内容数据 list*/
|
||||
private List<ExperDevItemVo> experDevItemVos;
|
||||
}
|
||||
|
|
@ -36,6 +36,11 @@ public class TestAppVo {
|
|||
@NotNull(message = "收样id不能为空", groups = {Query.class})
|
||||
private Long sampleId;
|
||||
|
||||
/**
|
||||
* 送样日期
|
||||
*/
|
||||
private String sampleTime;
|
||||
|
||||
/**
|
||||
* 收样日期
|
||||
*/
|
||||
|
|
@ -223,7 +228,7 @@ public class TestAppVo {
|
|||
/**
|
||||
* 试验样品设备list
|
||||
*/
|
||||
private List<ExperDevVo> experDevVos;
|
||||
private List<ExperDevAppVo> experDevVos;
|
||||
|
||||
|
||||
private String allMoney;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ public class ParamsAppDto extends PageEntity {
|
|||
*/
|
||||
private String devTypeCode;
|
||||
|
||||
/**
|
||||
* 送样日期
|
||||
*/
|
||||
private String sampleTime;
|
||||
|
||||
/**
|
||||
* 收样人
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -44,15 +44,15 @@ public interface ExperimentalAppService {
|
|||
*/
|
||||
ServerResponse getTestBasicInfo(ParamsAppDto data);
|
||||
|
||||
// /**
|
||||
// * 新增试验数据
|
||||
// *
|
||||
// * @param data
|
||||
// * @return ServerResponse
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/20 15:42
|
||||
// */
|
||||
// ServerResponse addTestData(TestAppVo data);
|
||||
/**
|
||||
* 新增试验数据
|
||||
*
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 15:42
|
||||
*/
|
||||
ServerResponse addTestData(TestAppVo data);
|
||||
//
|
||||
// /**
|
||||
// * 修改试验数据
|
||||
|
|
@ -73,23 +73,23 @@ public interface ExperimentalAppService {
|
|||
// * @date 2024/7/21 20:06
|
||||
// */
|
||||
// ServerResponse delTestData(ParamsAppDto data);
|
||||
//
|
||||
// /**
|
||||
// * 试验数据详情
|
||||
// *
|
||||
// * @param data
|
||||
// * @return ServerResponse
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 20:06
|
||||
// */
|
||||
// ServerResponse viewTestData(ParamsAppDto data);
|
||||
//
|
||||
// /**
|
||||
// * 试验管理-提交审查
|
||||
// * @param data
|
||||
// * @return ServerResponse
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/22 14:25
|
||||
// */
|
||||
// ServerResponse commitCheckTestData(ParamsAppDto data);
|
||||
|
||||
/**
|
||||
* 试验数据详情
|
||||
*
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 20:06
|
||||
*/
|
||||
ServerResponse viewTestData(ParamsAppDto data);
|
||||
|
||||
/**
|
||||
* 试验管理-提交审查
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2024/7/22 14:25
|
||||
*/
|
||||
ServerResponse commitCheckTestData(ParamsAppDto data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
@Resource(name = "ValidatorsUtils")
|
||||
private ValidatorsUtils validatorsUtils;
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExperimentalAppVo> getList(ParamsAppDto dto) {
|
||||
List<ExperimentalAppVo> list = new ArrayList<>();
|
||||
|
|
@ -56,6 +59,9 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情列表
|
||||
*/
|
||||
@Override
|
||||
public List<ExperimentalDetailAppVo> getDetailList(ParamsAppDto dto) {
|
||||
List<ExperimentalDetailAppVo> list = new ArrayList<>();
|
||||
|
|
@ -67,6 +73,9 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询试验模板数据、基础数据
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getTestBasicInfo(ParamsAppDto dto) {
|
||||
TestAppVo vo = new TestAppVo();
|
||||
|
|
@ -99,85 +108,91 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
return ServerResponse.createSuccess(vo);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public ServerResponse addTestData(TestAppVo vo) {
|
||||
// try {
|
||||
// if (!SystemUtils.isExperimentalTeam()) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法添加试验数据");
|
||||
// }
|
||||
// // 整体数据校验数据
|
||||
// String validResult = validatorsUtils.valid(vo, TestAppVo.Query.class);
|
||||
// if (StringUtils.isNotBlank(validResult)) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, validResult);
|
||||
// }
|
||||
// if (!validatorsDate(vo)) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "下次试验日期不能早于试验日期");
|
||||
// }
|
||||
// String result = validatorsParams(vo.getParamsData());
|
||||
// if (StringUtils.isNotBlank(result)) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, result);
|
||||
// }
|
||||
// TestAppVo testAppVo = handleConfigItem(vo);
|
||||
// if (testAppVo == null) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "参数异常");
|
||||
// }
|
||||
// // 试验主要设备、试验依据、试验项校验
|
||||
// String result2 = singleValidators(testAppVo);
|
||||
// if (StringUtils.isNotBlank(result2)) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, result2);
|
||||
// }
|
||||
// BigDecimal allMony = new BigDecimal("0");
|
||||
// // 添加试验信息数据
|
||||
// mapper.addExper(vo);
|
||||
// // 添加试验依据信息数据
|
||||
// mapper.addConfigBasis(vo.getBasisVos(), vo.getId());
|
||||
// for (int i = 0; i < vo.getExperDevVos().size(); i++) {
|
||||
// ExperDevVo experDevVo = vo.getExperDevVos().get(i);
|
||||
// experDevVo.setIsHg(setHgData(experDevVo.getDevData()));
|
||||
// BigDecimal bigDecimal = new BigDecimal("0");
|
||||
// if (i == 0) {
|
||||
// for (ConfigItemsVo configItemsVo : vo.getConfigItemsVos()) {
|
||||
// // 添加试验项数据
|
||||
// mapper.addExperItems(configItemsVo, vo.getId());
|
||||
// BigDecimal amount = new BigDecimal(configItemsVo.getAmount());
|
||||
// bigDecimal=bigDecimal.add(amount);
|
||||
// // 添加试验项内容数据
|
||||
// for (ConfigItemVo configItemVo : configItemsVo.getItemList()) {
|
||||
// mapper.addExperItem(configItemVo, configItemsVo.getId());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// //计算设备总金额
|
||||
// experDevVo.setExperAmount(bigDecimal.toString());
|
||||
// BigDecimal amount= new BigDecimal(experDevVo.getAmount());
|
||||
// allMony=allMony.add(bigDecimal).add(amount);
|
||||
// mapper.addExperDev(experDevVo, vo.getId());
|
||||
// List<ExperDevItemsVo> experDevItemsVos = setExperDevItemsList(vo.getExperDevVos().get(i), vo);
|
||||
// for (ExperDevItemsVo experDevItemsVo : experDevItemsVos) {
|
||||
// // 添加设备试验项信息
|
||||
// mapper.addExperDevItems(experDevItemsVo);
|
||||
// List<ExperDevItemVo> experDevItemVos = setExperDevItemList(vo.getExperDevVos().get(i), vo, experDevItemsVo);
|
||||
// // 添加设备试验项数据
|
||||
// mapper.addExperDevItem(experDevItemVos);
|
||||
// }
|
||||
// }
|
||||
// // 获取收样中的试验项是否全部填写
|
||||
// List<Integer> resultList = mapper.isAllExper(vo.getSampleId());
|
||||
// if (Objects.equals(resultList.get(0), resultList.get(1))) {
|
||||
// // 更新收样表中的状态为待提交
|
||||
// mapper.editSampleStatus(vo.getSampleId());
|
||||
// }
|
||||
//
|
||||
// vo.setAllMoney(allMony.toString());
|
||||
// mapper.updateExperMony(vo);
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "操作失败");
|
||||
// }
|
||||
// return ServerResponse.createBySuccessMsg("操作成功");
|
||||
// }
|
||||
/**
|
||||
* 添加试验数据
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse addTestData(TestAppVo vo) {
|
||||
try {
|
||||
if (!SystemUtils.isExperimentalTeam()) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法添加试验数据");
|
||||
}
|
||||
// 整体数据校验数据
|
||||
String validResult = validatorsUtils.valid(vo, TestAppVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, validResult);
|
||||
}
|
||||
if (!validatorsDate(vo)) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "下次试验日期不能早于试验日期");
|
||||
}
|
||||
//验证参数是否为空
|
||||
String result = validatorsParams(vo.getParamsData());
|
||||
if (StringUtils.isNotBlank(result)) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, result);
|
||||
}
|
||||
//处理试验项、试验项内容、试验依据、试验设备、主要试验设备、样品设备试验数据 数据
|
||||
TestAppVo testAppVo = handleConfigItem(vo);
|
||||
if (testAppVo == null) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "参数异常");
|
||||
}
|
||||
// 试验主要设备、试验依据、试验项校验
|
||||
String result2 = singleValidators(testAppVo);
|
||||
if (StringUtils.isNotBlank(result2)) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, result2);
|
||||
}
|
||||
BigDecimal allMony = new BigDecimal("0");
|
||||
// 添加试验信息数据
|
||||
mapper.addExper(vo);
|
||||
// 添加试验依据信息数据
|
||||
mapper.addConfigBasis(vo.getBasisVos(), vo.getId());
|
||||
for (int i = 0; i < vo.getExperDevVos().size(); i++) {
|
||||
ExperDevAppVo experDevVo = vo.getExperDevVos().get(i);
|
||||
experDevVo.setIsHg(setHgData(experDevVo.getDevData()));
|
||||
BigDecimal bigDecimal = new BigDecimal("0");
|
||||
if (i == 0) {
|
||||
for (ConfigItemsAppVo configItemsVo : vo.getConfigItemsVos()) {
|
||||
// 添加试验项数据
|
||||
mapper.addExperItems(configItemsVo, vo.getId());
|
||||
BigDecimal amount = new BigDecimal(configItemsVo.getAmount());
|
||||
bigDecimal=bigDecimal.add(amount);
|
||||
// 添加试验项内容数据
|
||||
for (ConfigItemAppVo configItemVo : configItemsVo.getItemList()) {
|
||||
mapper.addExperItem(configItemVo, configItemsVo.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
//计算设备总金额
|
||||
experDevVo.setExperAmount(bigDecimal.toString());
|
||||
BigDecimal amount= new BigDecimal(experDevVo.getAmount());
|
||||
allMony=allMony.add(bigDecimal).add(amount);
|
||||
mapper.addExperDev(experDevVo, vo.getId());
|
||||
List<ExperDevItemsAppVo> experDevItemsVos = setExperDevItemsList(vo.getExperDevVos().get(i), vo);
|
||||
for (ExperDevItemsAppVo experDevItemsVo : experDevItemsVos) {
|
||||
// 添加设备试验项信息
|
||||
mapper.addExperDevItems(experDevItemsVo);
|
||||
List<ExperDevItemVo> experDevItemVos = setExperDevItemList(vo.getExperDevVos().get(i), vo, experDevItemsVo);
|
||||
// 添加设备试验项数据
|
||||
mapper.addExperDevItem(experDevItemVos);
|
||||
}
|
||||
}
|
||||
// 获取收样中的试验项是否全部填写
|
||||
List<Integer> resultList = mapper.isAllExper(vo.getSampleId());
|
||||
if (Objects.equals(resultList.get(0), resultList.get(1))) {
|
||||
// 更新收样表中的状态为待提交
|
||||
mapper.editSampleStatus(vo.getSampleId());
|
||||
}
|
||||
|
||||
vo.setAllMoney(allMony.toString());
|
||||
mapper.updateExperMony(vo);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "操作失败");
|
||||
}
|
||||
return ServerResponse.createBySuccessMsg("操作成功");
|
||||
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
|
|
@ -288,321 +303,322 @@ public class ExperimentalAppServiceImpl implements ExperimentalAppService {
|
|||
// }
|
||||
// return ServerResponse.createBySuccessMsg("操作成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ServerResponse viewTestData(ParamsAppDto dto) {
|
||||
// TestAppVo testAppVo = new TestAppVo();
|
||||
// try {
|
||||
// if (dto.getId() == null) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "请求参数不完整");
|
||||
// }
|
||||
// // 试验数据详情
|
||||
// testAppVo = mapper.viewTestData(dto);
|
||||
// List<Long> numList = mapper.getRecordNum(testAppVo);
|
||||
// int recordNum = 0;
|
||||
// for (int i = 0; i < numList.size(); i++) {
|
||||
// if (Objects.equals(testAppVo.getId(), numList.get(i))) {
|
||||
// recordNum = i + 1;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// testAppVo.setRecordNum(testAppVo.getExperTime().replace("-", "") + setRecordNum(recordNum));
|
||||
// //试验依据信息、试验项、试验项目信息、试验样品设备
|
||||
// ConfigMainDevVo configMainDevVo = new ConfigMainDevVo();
|
||||
// configMainDevVo.setExperDevName(testAppVo.getExperDev());
|
||||
// configMainDevVo.setExperDevModule(testAppVo.getExperModule());
|
||||
// configMainDevVo.setExperDevCode(testAppVo.getExperCode());
|
||||
// configMainDevVo.setDevContractDate(testAppVo.getCheckTime());
|
||||
// List<ConfigMainDevVo> configMainDevVos = new ArrayList<>();
|
||||
// configMainDevVos.add(configMainDevVo);
|
||||
// List<ExperBasisAppVo> experBasisVos = mapper.getConfigBasis(dto);
|
||||
// List<ConfigItemsVo> configItemsVos = mapper.getExperItems(dto);
|
||||
// for (ConfigItemsVo configItemsVo : configItemsVos) {
|
||||
// List<ConfigItemVo> configItemVos = mapper.getExperItem(configItemsVo.getId());
|
||||
// configItemsVo.setItemList(configItemVos);
|
||||
// }
|
||||
// List<ExperDevVo> experDevVos = mapper.getExperDev(dto);
|
||||
// testAppVo.setMainDeviceVos(configMainDevVos);
|
||||
// testAppVo.setBasisVos(experBasisVos);
|
||||
// testAppVo.setConfigItemsVos(configItemsVos);
|
||||
// testAppVo.setExperDevVos(experDevVos);
|
||||
// return ServerResponse.createSuccess(testAppVo);
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return ServerResponse.createSuccess(null);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public ServerResponse commitCheckTestData(ParamsAppDto dto) {
|
||||
// try {
|
||||
// // 判断是否提交空数据
|
||||
// if (dto.getIds() == null || dto.getIds().length == 0) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "未提交审查数据");
|
||||
// }
|
||||
// if (!SystemUtils.isExperimentalTeam()) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法提交审查数据");
|
||||
// }
|
||||
// // 判断提交数据中是否存在流程数据或者存在待试验项
|
||||
// List<Long> list = Arrays.asList(dto.getIds());
|
||||
// int result = mapper.isNotEditData(list);
|
||||
// if (result > 0) {
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "提交数据中存在待试验项或处于审核流程或已试验结束");
|
||||
// }
|
||||
// // 更新收样表中的状态为待审阅
|
||||
// mapper.updateSampleStatus(list);
|
||||
// // 更新试验表中数据为待审阅
|
||||
// mapper.updateExperStatus(list);
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "操作失败");
|
||||
// }
|
||||
// return ServerResponse.createBySuccessMsg("操作成功");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 验证参数是否为空
|
||||
// *
|
||||
// * @param value
|
||||
// * @return String
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/18 17:22
|
||||
// */
|
||||
// public String validatorsParams(String value) {
|
||||
// try {
|
||||
// // 试验配置项、试验依据、主要试验设备、样品设备验证数据是否为空
|
||||
// JSONObject obj = JSONObject.parseObject(value);
|
||||
// JSONArray itemsList = obj.getJSONArray("items");
|
||||
// JSONArray yjList = obj.getJSONArray("yjList");
|
||||
// JSONArray mainDevList = obj.getJSONArray("mainDevList");
|
||||
// JSONArray experDevList = obj.getJSONArray("experDevList");
|
||||
// if (CollectionUtils.isEmpty(mainDevList)) {
|
||||
// return Constants.ERROR_2;
|
||||
// }
|
||||
// if (CollectionUtils.isEmpty(yjList)) {
|
||||
// return Constants.ERROR_3;
|
||||
// }
|
||||
// if (CollectionUtils.isEmpty(itemsList)) {
|
||||
// return Constants.ERROR_4;
|
||||
// }
|
||||
// if (CollectionUtils.isEmpty(experDevList)) {
|
||||
// return Constants.ERROR_6;
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return Constants.ERROR_5;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理试验项、试验项内容、试验依据、试验设备、主要试验设备、样品设备试验数据 数据
|
||||
// *
|
||||
// * @param vo
|
||||
// * @return List<ConfigItemsVo>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/18 16:43
|
||||
// */
|
||||
// public TestAppVo handleConfigItem(TestAppVo vo) {
|
||||
// try {
|
||||
// JSONObject obj = JSONObject.parseObject(vo.getParamsData());
|
||||
// JSONArray yjList = obj.getJSONArray("yjList");
|
||||
// JSONArray mainDevList = obj.getJSONArray("mainDevList");
|
||||
// JSONArray itemsList = obj.getJSONArray("items");
|
||||
// JSONArray experDevList = obj.getJSONArray("experDevList");
|
||||
// List<ExperBasisAppVo> basisVos = yjList.toJavaList(ExperBasisAppVo.class);
|
||||
// List<ConfigMainDevVo> mainDeviceVos = mainDevList.toJavaList(ConfigMainDevVo.class);
|
||||
// List<ConfigItemsVo> configItemsVos = itemsList.toJavaList(ConfigItemsVo.class);
|
||||
// List<ExperDevVo> experDevVos = experDevList.toJavaList(ExperDevVo.class);
|
||||
// for (ConfigItemsVo configItemsVo : configItemsVos) {
|
||||
// JSONArray itemArr = JSONObject.parseArray(configItemsVo.getItem());
|
||||
// List<ConfigItemVo> configItemVos = itemArr.toJavaList(ConfigItemVo.class);
|
||||
// configItemsVo.setItemList(configItemVos);
|
||||
// }
|
||||
// for (ConfigMainDevVo mainDeviceVo : mainDeviceVos) {
|
||||
// vo.setExperDev(mainDeviceVo.getExperDevName());
|
||||
// vo.setExperModule(mainDeviceVo.getExperDevModule());
|
||||
// vo.setExperCode(mainDeviceVo.getExperDevCode());
|
||||
// vo.setCheckTime(mainDeviceVo.getDevContractDate());
|
||||
// }
|
||||
// vo.setBasisVos(basisVos);
|
||||
// vo.setMainDeviceVos(mainDeviceVos);
|
||||
// vo.setConfigItemsVos(configItemsVos);
|
||||
// vo.setExperDevVos(experDevVos);
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return null;
|
||||
// }
|
||||
// return vo;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 试验项、试验项内容、试验依据、试验设备、主要试验设备数据校验
|
||||
// *
|
||||
// * @param vo
|
||||
// * @return String
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/18 19:17
|
||||
// */
|
||||
// public String singleValidators(TestAppVo vo) {
|
||||
// List<ConfigMainDevVo> mainDeviceVos = vo.getMainDeviceVos();
|
||||
// List<ExperBasisAppVo> basisVos = vo.getBasisVos();
|
||||
// List<ConfigItemsVo> configItemsVos = vo.getConfigItemsVos();
|
||||
// List<ExperDevVo> experDevVos = vo.getExperDevVos();
|
||||
// for (ConfigMainDevVo mainDeviceVo : mainDeviceVos) {
|
||||
// String validResult = validatorsUtils.valid(mainDeviceVo, ConfigMainDevVo.Query.class);
|
||||
// if (StringUtils.isNotBlank(validResult)) {
|
||||
// return validResult;
|
||||
// }
|
||||
// }
|
||||
// for (ExperBasisAppVo basisVo : basisVos) {
|
||||
// String validResult = validatorsUtils.valid(basisVo, ExperBasisAppVo.Query.class);
|
||||
// if (StringUtils.isNotBlank(validResult)) {
|
||||
// return validResult;
|
||||
// }
|
||||
// }
|
||||
// for (ConfigItemsVo configItemsVo : configItemsVos) {
|
||||
// String validResult = validatorsUtils.valid(configItemsVo, ConfigItemsVo.Query.class);
|
||||
// if (StringUtils.isNotBlank(validResult)) {
|
||||
// return validResult;
|
||||
// }
|
||||
// for (ConfigItemVo configItemVo : configItemsVo.getItemList()) {
|
||||
// String validResult2 = validatorsUtils.valid(configItemVo, ConfigItemVo.Query.class);
|
||||
// if (StringUtils.isNotBlank(validResult2)) {
|
||||
// return validResult2;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// for (ExperDevVo experDevVo : experDevVos) {
|
||||
// String validResult = validatorsUtils.valid(experDevVo, ExperDevVo.Query.class);
|
||||
// if (StringUtils.isNotBlank(validResult)) {
|
||||
// return validResult;
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 校验试验时间和下次试验时间
|
||||
// *
|
||||
// * @param vo
|
||||
// * @return boolean
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/20 16:56
|
||||
// */
|
||||
// public boolean validatorsDate(TestAppVo vo) {
|
||||
// long time = DateTimeHelper.getTimeStampConverter(vo.getExperTime(), Constants.FORMAT_STR);
|
||||
// long time2 = DateTimeHelper.getTimeStampConverter(vo.getNextExperTime(), Constants.FORMAT_STR);
|
||||
// if (time2 < time) {
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理设备试验项数据
|
||||
// *
|
||||
// * @param experDevVo
|
||||
// * @param vo
|
||||
// * @return List<ExperDevItemsVo>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 19:17
|
||||
// */
|
||||
// public List<ExperDevItemsVo> setExperDevItemsList(ExperDevVo experDevVo, TestAppVo vo) {
|
||||
// List<ExperDevItemsVo> experDevItemsList = new ArrayList<>();
|
||||
// for (int i = 0; i < vo.getConfigItemsVos().size(); i++) {
|
||||
// ConfigItemsVo configItemsVo = vo.getConfigItemsVos().get(i);
|
||||
// ExperDevItemsVo experDevItems = new ExperDevItemsVo();
|
||||
// experDevItems.setItemsId(configItemsVo.getId());
|
||||
// experDevItems.setDevId(experDevVo.getId());
|
||||
// experDevItems.setItemsName(configItemsVo.getExperTypeName());
|
||||
// experDevItems.setValSort(configItemsVo.getItemsSort());
|
||||
// experDevItemsList.add(experDevItems);
|
||||
// }
|
||||
// return experDevItemsList;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 处理设备试验项内容数据
|
||||
// *
|
||||
// * @param experDevVo
|
||||
// * @param vo
|
||||
// * @return List<ExperDevItemVo>
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 19:17
|
||||
// */
|
||||
// public List<ExperDevItemVo> setExperDevItemList(ExperDevVo experDevVo, TestAppVo vo, ExperDevItemsVo experDevItemsVo) {
|
||||
// List<ExperDevItemVo> experDevItemList = new ArrayList<>();
|
||||
// int index = 0;
|
||||
// for (int i = 0; i < vo.getConfigItemsVos().size(); i++) {
|
||||
// ConfigItemsVo configItemsVo = vo.getConfigItemsVos().get(i);
|
||||
// List<ExperDevItemVo> experDevItemVos = new ArrayList<>();
|
||||
// for (int j = 0; j < configItemsVo.getItemList().size(); j++) {
|
||||
// ConfigItemVo configItemVo = configItemsVo.getItemList().get(j);
|
||||
// ExperDevItemVo experDevItemVo = new ExperDevItemVo();
|
||||
// experDevItemVo.setItemsId(configItemsVo.getId());
|
||||
// experDevItemVo.setItemId(configItemVo.getId());
|
||||
// experDevItemVo.setDevId(experDevItemsVo.getId());
|
||||
// experDevItemVo.setItemName(configItemVo.getItemName());
|
||||
// index = i * configItemsVo.getItemList().size() + j;
|
||||
// String val = getVal(experDevVo, index);
|
||||
// experDevItemVo.setItemVal(val);
|
||||
// experDevItemList.add(experDevItemVo);
|
||||
// }
|
||||
// }
|
||||
// return experDevItemList;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取设备试验项内容数据
|
||||
// *
|
||||
// * @param experDevVo
|
||||
// * @param index
|
||||
// * @return String
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/21 19:30
|
||||
// */
|
||||
// public String getVal(ExperDevVo experDevVo, int index) {
|
||||
// try {
|
||||
// String devData = experDevVo.getDevData();
|
||||
// JSONArray jsonArray = JSONObject.parseArray(devData);
|
||||
// String data = (String) jsonArray.get(index);
|
||||
// return data;
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.toString(), e);
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置试验设备数据是否合格
|
||||
// *
|
||||
// * @param value
|
||||
// * @return String
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/23 15:25
|
||||
// */
|
||||
// public String setHgData(String value) {
|
||||
// if (value.contains(Constants.ERROR_RESULT) ||
|
||||
// value.contains(Constants.ERROR_RESULT2)
|
||||
// ) {
|
||||
// return "1";
|
||||
// } else {
|
||||
// return "0";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置记录编号
|
||||
// * @param number
|
||||
// * @return String
|
||||
// * @author cwchen
|
||||
// * @date 2024/7/28 16:00
|
||||
// */
|
||||
// public String setRecordNum(int number) {
|
||||
// String formattedNumber = String.format("%05d", number);
|
||||
// return formattedNumber;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public ServerResponse viewTestData(ParamsAppDto dto) {
|
||||
TestAppVo testAppVo = new TestAppVo();
|
||||
try {
|
||||
if (dto.getId() == null) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "请求参数不完整");
|
||||
}
|
||||
// 试验数据详情
|
||||
testAppVo = mapper.viewTestData(dto);
|
||||
List<Long> numList = mapper.getRecordNum(testAppVo);
|
||||
int recordNum = 0;
|
||||
for (int i = 0; i < numList.size(); i++) {
|
||||
if (Objects.equals(testAppVo.getId(), numList.get(i))) {
|
||||
recordNum = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
testAppVo.setRecordNum(testAppVo.getExperTime().replace("-", "") + setRecordNum(recordNum));
|
||||
//试验依据信息、试验项、试验项目信息、试验样品设备
|
||||
ConfigMainDevAppVo configMainDevVo = new ConfigMainDevAppVo();
|
||||
configMainDevVo.setExperDevName(testAppVo.getExperDev());
|
||||
configMainDevVo.setExperDevModule(testAppVo.getExperModule());
|
||||
configMainDevVo.setExperDevCode(testAppVo.getExperCode());
|
||||
configMainDevVo.setDevContractDate(testAppVo.getCheckTime());
|
||||
List<ConfigMainDevAppVo> configMainDevVos = new ArrayList<>();
|
||||
configMainDevVos.add(configMainDevVo);
|
||||
List<ExperBasisAppVo> experBasisVos = mapper.getConfigBasis(dto);
|
||||
List<ConfigItemsAppVo> configItemsVos = mapper.getExperItems(dto);
|
||||
for (ConfigItemsAppVo configItemsVo : configItemsVos) {
|
||||
List<ConfigItemAppVo> configItemVos = mapper.getExperItem(configItemsVo.getId());
|
||||
configItemsVo.setItemList(configItemVos);
|
||||
}
|
||||
List<ExperDevAppVo> experDevVos = mapper.getExperDev(dto);
|
||||
testAppVo.setMainDeviceVos(configMainDevVos);
|
||||
testAppVo.setBasisVos(experBasisVos);
|
||||
testAppVo.setConfigItemsVos(configItemsVos);
|
||||
testAppVo.setExperDevVos(experDevVos);
|
||||
return ServerResponse.createSuccess(testAppVo);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createSuccess(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse commitCheckTestData(ParamsAppDto dto) {
|
||||
try {
|
||||
// 判断是否提交空数据
|
||||
if (dto.getIds() == null || dto.getIds().length == 0) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "未提交审查数据");
|
||||
}
|
||||
if (!SystemUtils.isExperimentalTeam()) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "非试验班组,无法提交审查数据");
|
||||
}
|
||||
// 判断提交数据中是否存在流程数据或者存在待试验项
|
||||
List<Long> list = Arrays.asList(dto.getIds());
|
||||
int result = mapper.isNotEditData(list);
|
||||
if (result > 0) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "提交数据中存在待试验项或处于审核流程或已试验结束");
|
||||
}
|
||||
// 更新收样表中的状态为待审阅
|
||||
mapper.updateSampleStatus(list);
|
||||
// 更新试验表中数据为待审阅
|
||||
mapper.updateExperStatus(list);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "操作失败");
|
||||
}
|
||||
return ServerResponse.createBySuccessMsg("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证参数是否为空
|
||||
*
|
||||
* @param value
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 17:22
|
||||
*/
|
||||
public String validatorsParams(String value) {
|
||||
try {
|
||||
// 试验配置项、试验依据、主要试验设备、样品设备验证数据是否为空
|
||||
JSONObject obj = JSONObject.parseObject(value);
|
||||
JSONArray itemsList = obj.getJSONArray("items");
|
||||
JSONArray yjList = obj.getJSONArray("yjList");
|
||||
JSONArray mainDevList = obj.getJSONArray("mainDevList");
|
||||
JSONArray experDevList = obj.getJSONArray("experDevList");
|
||||
if (CollectionUtils.isEmpty(mainDevList)) {
|
||||
return Constants.ERROR_2;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(yjList)) {
|
||||
return Constants.ERROR_3;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(itemsList)) {
|
||||
return Constants.ERROR_4;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(experDevList)) {
|
||||
return Constants.ERROR_6;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return Constants.ERROR_5;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理试验项、试验项内容、试验依据、试验设备、主要试验设备、样品设备试验数据 数据
|
||||
*
|
||||
* @param vo
|
||||
* @return List<ConfigItemsVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 16:43
|
||||
*/
|
||||
public TestAppVo handleConfigItem(TestAppVo vo) {
|
||||
try {
|
||||
JSONObject obj = JSONObject.parseObject(vo.getParamsData());
|
||||
JSONArray yjList = obj.getJSONArray("yjList");
|
||||
JSONArray mainDevList = obj.getJSONArray("mainDevList");
|
||||
JSONArray itemsList = obj.getJSONArray("items");
|
||||
JSONArray experDevList = obj.getJSONArray("experDevList");
|
||||
List<ExperBasisAppVo> basisVos = yjList.toJavaList(ExperBasisAppVo.class);
|
||||
List<ConfigMainDevAppVo> mainDeviceVos = mainDevList.toJavaList(ConfigMainDevAppVo.class);
|
||||
List<ConfigItemsAppVo> configItemsVos = itemsList.toJavaList(ConfigItemsAppVo.class);
|
||||
List<ExperDevAppVo> experDevVos = experDevList.toJavaList(ExperDevAppVo.class);
|
||||
for (ConfigItemsAppVo configItemsVo : configItemsVos) {
|
||||
JSONArray itemArr = JSONObject.parseArray(configItemsVo.getItem());
|
||||
List<ConfigItemAppVo> configItemVos = itemArr.toJavaList(ConfigItemAppVo.class);
|
||||
configItemsVo.setItemList(configItemVos);
|
||||
}
|
||||
for (ConfigMainDevAppVo mainDeviceVo : mainDeviceVos) {
|
||||
vo.setExperDev(mainDeviceVo.getExperDevName());
|
||||
vo.setExperModule(mainDeviceVo.getExperDevModule());
|
||||
vo.setExperCode(mainDeviceVo.getExperDevCode());
|
||||
vo.setCheckTime(mainDeviceVo.getDevContractDate());
|
||||
}
|
||||
vo.setBasisVos(basisVos);
|
||||
vo.setMainDeviceVos(mainDeviceVos);
|
||||
vo.setConfigItemsVos(configItemsVos);
|
||||
vo.setExperDevVos(experDevVos);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return null;
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 试验项、试验项内容、试验依据、试验设备、主要试验设备数据校验
|
||||
*
|
||||
* @param vo
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 19:17
|
||||
*/
|
||||
public String singleValidators(TestAppVo vo) {
|
||||
List<ConfigMainDevAppVo> mainDeviceVos = vo.getMainDeviceVos();
|
||||
List<ExperBasisAppVo> basisVos = vo.getBasisVos();
|
||||
List<ConfigItemsAppVo> configItemsVos = vo.getConfigItemsVos();
|
||||
List<ExperDevAppVo> experDevVos = vo.getExperDevVos();
|
||||
for (ConfigMainDevAppVo mainDeviceVo : mainDeviceVos) {
|
||||
String validResult = validatorsUtils.valid(mainDeviceVo, ConfigMainDevAppVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
}
|
||||
for (ExperBasisAppVo basisVo : basisVos) {
|
||||
String validResult = validatorsUtils.valid(basisVo, ExperBasisAppVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
}
|
||||
for (ConfigItemsAppVo configItemsVo : configItemsVos) {
|
||||
String validResult = validatorsUtils.valid(configItemsVo, ConfigItemsAppVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
for (ConfigItemAppVo configItemVo : configItemsVo.getItemList()) {
|
||||
String validResult2 = validatorsUtils.valid(configItemVo, ConfigItemAppVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult2)) {
|
||||
return validResult2;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (ExperDevAppVo experDevVo : experDevVos) {
|
||||
String validResult = validatorsUtils.valid(experDevVo, ExperDevAppVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验试验时间和下次试验时间
|
||||
*
|
||||
* @param vo
|
||||
* @return boolean
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 16:56
|
||||
*/
|
||||
public boolean validatorsDate(TestAppVo vo) {
|
||||
long time = DateTimeHelper.getTimeStampConverter(vo.getExperTime(), Constants.FORMAT_STR);
|
||||
long time2 = DateTimeHelper.getTimeStampConverter(vo.getNextExperTime(), Constants.FORMAT_STR);
|
||||
if (time2 < time) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理设备试验项数据
|
||||
*
|
||||
* @param experDevVo
|
||||
* @param vo
|
||||
* @return List<ExperDevItemsVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 19:17
|
||||
*/
|
||||
public List<ExperDevItemsAppVo> setExperDevItemsList(ExperDevAppVo experDevVo, TestAppVo vo) {
|
||||
List<ExperDevItemsAppVo> experDevItemsList = new ArrayList<>();
|
||||
for (int i = 0; i < vo.getConfigItemsVos().size(); i++) {
|
||||
ConfigItemsAppVo configItemsVo = vo.getConfigItemsVos().get(i);
|
||||
ExperDevItemsAppVo experDevItems = new ExperDevItemsAppVo();
|
||||
experDevItems.setItemsId(configItemsVo.getId());
|
||||
experDevItems.setDevId(experDevVo.getId());
|
||||
experDevItems.setItemsName(configItemsVo.getExperTypeName());
|
||||
experDevItems.setValSort(configItemsVo.getItemsSort());
|
||||
experDevItemsList.add(experDevItems);
|
||||
}
|
||||
return experDevItemsList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理设备试验项内容数据
|
||||
*
|
||||
* @param experDevVo
|
||||
* @param vo
|
||||
* @return List<ExperDevItemVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 19:17
|
||||
*/
|
||||
public List<ExperDevItemVo> setExperDevItemList(ExperDevAppVo experDevVo, TestAppVo vo, ExperDevItemsAppVo experDevItemsVo) {
|
||||
List<ExperDevItemVo> experDevItemList = new ArrayList<>();
|
||||
int index = 0;
|
||||
for (int i = 0; i < vo.getConfigItemsVos().size(); i++) {
|
||||
ConfigItemsAppVo configItemsVo = vo.getConfigItemsVos().get(i);
|
||||
List<ExperDevItemVo> experDevItemVos = new ArrayList<>();
|
||||
for (int j = 0; j < configItemsVo.getItemList().size(); j++) {
|
||||
ConfigItemAppVo configItemVo = configItemsVo.getItemList().get(j);
|
||||
ExperDevItemVo experDevItemVo = new ExperDevItemVo();
|
||||
experDevItemVo.setItemsId(configItemsVo.getId());
|
||||
experDevItemVo.setItemId(configItemVo.getId());
|
||||
experDevItemVo.setDevId(experDevItemsVo.getId());
|
||||
experDevItemVo.setItemName(configItemVo.getItemName());
|
||||
index = i * configItemsVo.getItemList().size() + j;
|
||||
String val = getVal(experDevVo, index);
|
||||
experDevItemVo.setItemVal(val);
|
||||
experDevItemList.add(experDevItemVo);
|
||||
}
|
||||
}
|
||||
return experDevItemList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备试验项内容数据
|
||||
*
|
||||
* @param experDevVo
|
||||
* @param index
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/7/21 19:30
|
||||
*/
|
||||
public String getVal(ExperDevAppVo experDevVo, int index) {
|
||||
try {
|
||||
String devData = experDevVo.getDevData();
|
||||
JSONArray jsonArray = JSONObject.parseArray(devData);
|
||||
String data = (String) jsonArray.get(index);
|
||||
return data;
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置试验设备数据是否合格
|
||||
*
|
||||
* @param value
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/7/23 15:25
|
||||
*/
|
||||
public String setHgData(String value) {
|
||||
if (value.contains(Constants.ERROR_RESULT) ||
|
||||
value.contains(Constants.ERROR_RESULT2)
|
||||
) {
|
||||
return "1";
|
||||
} else {
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置记录编号
|
||||
* @param number
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/7/28 16:00
|
||||
*/
|
||||
public String setRecordNum(int number) {
|
||||
String formattedNumber = String.format("%05d", number);
|
||||
return formattedNumber;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@
|
|||
WHERE exper_id = #{id}
|
||||
</select>
|
||||
<!--试验项信息-->
|
||||
<select id="getExperItems" resultType="com.bonus.aqgqj.basis.entity.vo.ConfigItemsVo">
|
||||
<select id="getExperItems" resultType="com.bonus.aqgqj.app.entity.ConfigItemsAppVo">
|
||||
SELECT id,
|
||||
exper_type_code AS experTypeCode,
|
||||
exper_type_name AS experTypeName,
|
||||
|
|
@ -458,7 +458,7 @@
|
|||
ORDER BY items_sort
|
||||
</select>
|
||||
<!--试验项内容信息-->
|
||||
<select id="getExperItem" resultType="com.bonus.aqgqj.basis.entity.vo.ConfigItemVo">
|
||||
<select id="getExperItem" resultType="com.bonus.aqgqj.app.entity.ConfigItemAppVo">
|
||||
SELECT id,
|
||||
items_id AS itemId,
|
||||
item_sort AS itemNum,
|
||||
|
|
@ -468,7 +468,7 @@
|
|||
ORDER BY item_sort
|
||||
</select>
|
||||
<!--试验样品设备-->
|
||||
<select id="getExperDev" resultType="com.bonus.aqgqj.basis.entity.vo.ExperDevVo">
|
||||
<select id="getExperDev" resultType="com.bonus.aqgqj.app.entity.ExperDevAppVo">
|
||||
SELECT id,
|
||||
exper_id AS experId,
|
||||
dev_code AS devCode,
|
||||
|
|
|
|||
Loading…
Reference in New Issue