|
@@ -27,9 +27,7 @@ import org.springblade.business.mapper.EntrustInfoMapper;
|
|
import org.springblade.business.mapper.TrialMaterialMobilizationMapper;
|
|
import org.springblade.business.mapper.TrialMaterialMobilizationMapper;
|
|
import org.springblade.business.mapper.TrialSampleInfoMapper;
|
|
import org.springblade.business.mapper.TrialSampleInfoMapper;
|
|
import org.springblade.business.mapper.TrialSelfInspectionRecordMapper;
|
|
import org.springblade.business.mapper.TrialSelfInspectionRecordMapper;
|
|
-import org.springblade.business.service.IEntrustInfoService;
|
|
|
|
-import org.springblade.business.service.ITrialNumberRuleService;
|
|
|
|
-import org.springblade.business.service.ITrialSelfInspectionRecordService;
|
|
|
|
|
|
+import org.springblade.business.service.*;
|
|
import org.springblade.business.utils.FileUtils;
|
|
import org.springblade.business.utils.FileUtils;
|
|
import org.springblade.business.utils.FileUtils2;
|
|
import org.springblade.business.utils.FileUtils2;
|
|
import org.springblade.business.utils.StringSPUtils;
|
|
import org.springblade.business.utils.StringSPUtils;
|
|
@@ -100,6 +98,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
private final TrialDetectionDataServiceImpl trialDetectionDataService;
|
|
private final TrialDetectionDataServiceImpl trialDetectionDataService;
|
|
private final IEntrustInfoService entrustInfoService;
|
|
private final IEntrustInfoService entrustInfoService;
|
|
private final ITrialNumberRuleService trialNumberRuleService;
|
|
private final ITrialNumberRuleService trialNumberRuleService;
|
|
|
|
+ private final TrialCyThirdReportService trialCyThirdReportService;
|
|
|
|
+ private final TrialCyFinishTestReportService trialCyFinishTestReportService;
|
|
|
|
+ private final TrialCyAccessoriesService trialCyAccessoriesService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) throws FileNotFoundException {
|
|
public IPage<TrialSelfInspectionRecordVO> selfPage(IPage<TrialSelfInspectionRecord> page, TrialSelfInspectionRecordPageDTO dto) throws FileNotFoundException {
|
|
@@ -118,7 +119,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
List<EntrustInfo> entrustInfos = entrustInfoMapper.selectList(Wrappers.<EntrustInfo>lambdaQuery()
|
|
List<EntrustInfo> entrustInfos = entrustInfoMapper.selectList(Wrappers.<EntrustInfo>lambdaQuery()
|
|
.like(EntrustInfo::getEntrustNo, dto.getQueryValue()));
|
|
.like(EntrustInfo::getEntrustNo, dto.getQueryValue()));
|
|
List<Long> entrustIds;
|
|
List<Long> entrustIds;
|
|
- if(CollectionUtil.isNotEmpty(entrustInfos)){
|
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(entrustInfos)) {
|
|
entrustIds = entrustInfos.stream().map(EntrustInfo::getId).collect(Collectors.toList());
|
|
entrustIds = entrustInfos.stream().map(EntrustInfo::getId).collect(Collectors.toList());
|
|
} else {
|
|
} else {
|
|
entrustIds = null;
|
|
entrustIds = null;
|
|
@@ -126,11 +127,11 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
|
|
|
queryWrapper.lambda().and(
|
|
queryWrapper.lambda().and(
|
|
wq ->
|
|
wq ->
|
|
- wq.like(TrialSelfInspectionRecord::getTrialProjectName, dto.getQueryValue()).or()
|
|
|
|
- .like(TrialSelfInspectionRecord::getRecordNo, dto.getQueryValue()).or()
|
|
|
|
- .like(TrialSelfInspectionRecord::getReportNo, dto.getQueryValue()).or()
|
|
|
|
- .like(TrialSelfInspectionRecord::getSpecificationNumber, dto.getQueryValue()).or()
|
|
|
|
- .in(CollectionUtil.isNotEmpty(entrustIds),TrialSelfInspectionRecord::getEntrustId, entrustIds)
|
|
|
|
|
|
+ wq.like(TrialSelfInspectionRecord::getTrialProjectName, dto.getQueryValue()).or()
|
|
|
|
+ .like(TrialSelfInspectionRecord::getRecordNo, dto.getQueryValue()).or()
|
|
|
|
+ .like(TrialSelfInspectionRecord::getReportNo, dto.getQueryValue()).or()
|
|
|
|
+ .like(TrialSelfInspectionRecord::getSpecificationNumber, dto.getQueryValue()).or()
|
|
|
|
+ .in(CollectionUtil.isNotEmpty(entrustIds), TrialSelfInspectionRecord::getEntrustId, entrustIds)
|
|
);
|
|
);
|
|
}
|
|
}
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getStartTime()) && org.apache.commons.lang.StringUtils.isNotEmpty(dto.getEndTime())) {
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getStartTime()) && org.apache.commons.lang.StringUtils.isNotEmpty(dto.getEndTime())) {
|
|
@@ -144,7 +145,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getQueryStatus())) {
|
|
if (org.apache.commons.lang.StringUtils.isNotEmpty(dto.getQueryStatus())) {
|
|
queryWrapper.lambda().eq(TrialSelfInspectionRecord::getDetectionResult, dto.getQueryStatus());
|
|
queryWrapper.lambda().eq(TrialSelfInspectionRecord::getDetectionResult, dto.getQueryStatus());
|
|
}
|
|
}
|
|
- if (dto.getSortType() != null) {
|
|
|
|
|
|
+ if (dto.getSortType() != null) {
|
|
if (dto.getSortType().equals("1")) {
|
|
if (dto.getSortType().equals("1")) {
|
|
queryWrapper.lambda().orderByAsc(TrialSelfInspectionRecord::getReportNo);
|
|
queryWrapper.lambda().orderByAsc(TrialSelfInspectionRecord::getReportNo);
|
|
} else if (dto.getSortType().equals("2")) {
|
|
} else if (dto.getSortType().equals("2")) {
|
|
@@ -209,17 +210,17 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
}
|
|
}
|
|
//委托单名称 委托单编号
|
|
//委托单名称 委托单编号
|
|
EntrustInfo entrustInfo = entrustInfoMapper.selectById(record.getEntrustId());
|
|
EntrustInfo entrustInfo = entrustInfoMapper.selectById(record.getEntrustId());
|
|
- if (entrustInfo != null){
|
|
|
|
|
|
+ if (entrustInfo != null) {
|
|
record.setEntrustName(entrustInfo.getEntrustName());
|
|
record.setEntrustName(entrustInfo.getEntrustName());
|
|
record.setEntrustNo(entrustInfo.getEntrustNo());
|
|
record.setEntrustNo(entrustInfo.getEntrustNo());
|
|
//材料id不为空
|
|
//材料id不为空
|
|
- if(Func.isNotEmpty(entrustInfo.getSampleId())){
|
|
|
|
- TrialSampleInfo sampleInfo = trialSampleInfoMapper.selectById(entrustInfo.getSampleId());
|
|
|
|
- if (Func.isNotEmpty(sampleInfo)){
|
|
|
|
- record.setSpecificationNumber(sampleInfo.getSpecificationNumber());
|
|
|
|
- record.setSpecificationModel(sampleInfo.getSpecificationModel());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ if (Func.isNotEmpty(entrustInfo.getSampleId())) {
|
|
|
|
+ TrialSampleInfo sampleInfo = trialSampleInfoMapper.selectById(entrustInfo.getSampleId());
|
|
|
|
+ if (Func.isNotEmpty(sampleInfo)) {
|
|
|
|
+ record.setSpecificationNumber(sampleInfo.getSpecificationNumber());
|
|
|
|
+ record.setSpecificationModel(sampleInfo.getSpecificationModel());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (record.getBaseInfo() != null && !record.getBaseInfo().isEmpty()) {
|
|
if (record.getBaseInfo() != null && !record.getBaseInfo().isEmpty()) {
|
|
try {
|
|
try {
|
|
@@ -310,7 +311,8 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *新增返回该试验材料报告关联的委托单pdf也拼接在后面
|
|
|
|
|
|
+ * 新增返回该试验材料报告关联的委托单pdf也拼接在后面
|
|
|
|
+ *
|
|
* @param contractId
|
|
* @param contractId
|
|
* @param nodeId
|
|
* @param nodeId
|
|
* @param type
|
|
* @param type
|
|
@@ -318,7 +320,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
* @throws FileNotFoundException
|
|
* @throws FileNotFoundException
|
|
*/
|
|
*/
|
|
private String getMergePdfToTrialNew(Long contractId, Long nodeId, Integer type) throws FileNotFoundException {
|
|
private String getMergePdfToTrialNew(Long contractId, Long nodeId, Integer type) throws FileNotFoundException {
|
|
- String sql = "select pdf_url,e_visa_pdf_url from u_information_query where wbs_id='" + nodeId + "' and status in(0,1,2) and contract_id ='" + contractId + "' and classify = '" + type + "'" ;
|
|
|
|
|
|
+ String sql = "select pdf_url,e_visa_pdf_url from u_information_query where wbs_id='" + nodeId + "' and status in(0,1,2) and contract_id ='" + contractId + "' and classify = '" + type + "'";
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
|
|
if (maps.size() >= 1) {
|
|
if (maps.size() >= 1) {
|
|
Map<String, Object> stringObjectMap = maps.get(0);
|
|
Map<String, Object> stringObjectMap = maps.get(0);
|
|
@@ -330,11 +332,11 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
}
|
|
}
|
|
String entrustPdfUrl = "";
|
|
String entrustPdfUrl = "";
|
|
//关联的委托单pdf
|
|
//关联的委托单pdf
|
|
- String sqlEntrust = "select entrust_id from u_trial_self_inspection_record where is_deleted = 0 and id = "+nodeId ;
|
|
|
|
|
|
+ String sqlEntrust = "select entrust_id from u_trial_self_inspection_record where is_deleted = 0 and id = " + nodeId;
|
|
TrialSelfInspectionRecord record = jdbcTemplate.queryForObject(sqlEntrust, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
|
|
TrialSelfInspectionRecord record = jdbcTemplate.queryForObject(sqlEntrust, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
|
|
- if(ObjectUtil.isNotEmpty(record) && ObjectUtil.isNotEmpty(record.getEntrustId()) && record.getEntrustId() != 0){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(record) && ObjectUtil.isNotEmpty(record.getEntrustId()) && record.getEntrustId() != 0) {
|
|
//优先查询带电签的,没有电签在查entrust_pdf
|
|
//优先查询带电签的,没有电签在查entrust_pdf
|
|
- String sqlEntrustPdf = "SELECT COALESCE(entrust_e_pdf, entrust_pdf) AS pdf_url from u_entrust_info where is_deleted = 0 and id = "+record.getEntrustId();
|
|
|
|
|
|
+ String sqlEntrustPdf = "SELECT COALESCE(entrust_e_pdf, entrust_pdf) AS pdf_url from u_entrust_info where is_deleted = 0 and id = " + record.getEntrustId();
|
|
try {
|
|
try {
|
|
entrustPdfUrl = jdbcTemplate.queryForObject(sqlEntrustPdf, String.class);
|
|
entrustPdfUrl = jdbcTemplate.queryForObject(sqlEntrustPdf, String.class);
|
|
} catch (DataAccessException e) {
|
|
} catch (DataAccessException e) {
|
|
@@ -353,7 +355,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
//材料检测报告pdf
|
|
//材料检测报告pdf
|
|
pdfList.add(pdfUrlTrialRawMaterial);
|
|
pdfList.add(pdfUrlTrialRawMaterial);
|
|
//委托单pdf
|
|
//委托单pdf
|
|
- if(ObjectUtil.isNotEmpty(entrustPdfUrl)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(entrustPdfUrl)) {
|
|
pdfList.add(entrustPdfUrl);
|
|
pdfList.add(entrustPdfUrl);
|
|
}
|
|
}
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
String file_path = FileUtils.getSysLocalFileUrl();
|
|
@@ -375,10 +377,10 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
}
|
|
}
|
|
assert pdfUrl != null;
|
|
assert pdfUrl != null;
|
|
//拼接委托单pdf
|
|
//拼接委托单pdf
|
|
- if(ObjectUtil.isNotEmpty(entrustPdfUrl)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(entrustPdfUrl)) {
|
|
List<String> pdfList = new ArrayList<>();
|
|
List<String> pdfList = new ArrayList<>();
|
|
//试验原始pdf
|
|
//试验原始pdf
|
|
- if(pdfUrl!=null){
|
|
|
|
|
|
+ if (pdfUrl != null) {
|
|
pdfList.add(pdfUrl.toString());
|
|
pdfList.add(pdfUrl.toString());
|
|
}
|
|
}
|
|
//委托单pdf
|
|
//委托单pdf
|
|
@@ -398,8 +400,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
pdfUrl = bladeFile.getLink();
|
|
pdfUrl = bladeFile.getLink();
|
|
return pdfUrl.toString();
|
|
return pdfUrl.toString();
|
|
}
|
|
}
|
|
- }}
|
|
|
|
- if(ObjectUtil.isNotEmpty(pdfUrl)){
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ObjectUtil.isNotEmpty(pdfUrl)) {
|
|
return pdfUrl.toString();
|
|
return pdfUrl.toString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1137,21 +1140,21 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
//------初始当前填报的表pKeyIds------
|
|
//------初始当前填报的表pKeyIds------
|
|
this.initTrialTabIds(dto);
|
|
this.initTrialTabIds(dto);
|
|
|
|
|
|
- if(!this.judgingParameters(dto)){
|
|
|
|
- //------初始编号信息------
|
|
|
|
- this.initBuildNumber(dto);
|
|
|
|
- }
|
|
|
|
|
|
+// if (!this.judgingParameters(dto)) {
|
|
|
|
+// //------初始编号信息------
|
|
|
|
+// this.initBuildNumber(dto);
|
|
|
|
+// }
|
|
this.saveOrUpdate(dto);
|
|
this.saveOrUpdate(dto);
|
|
|
|
+
|
|
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
|
if (ObjectUtil.isNotEmpty(dto.getId())) {
|
|
//------获取最新试验记录------
|
|
//------获取最新试验记录------
|
|
TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
|
|
TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
|
|
//如果传递了编号就修改对应记录的值 以第一张表的数据为准
|
|
//如果传递了编号就修改对应记录的值 以第一张表的数据为准
|
|
this.updateRecordNoOrReportNo(obj, dto);
|
|
this.updateRecordNoOrReportNo(obj, dto);
|
|
//------编辑时记录表编号或报告单编号为Null的重新生成------
|
|
//------编辑时记录表编号或报告单编号为Null的重新生成------
|
|
- if(!this.judgingParameters(dto)){
|
|
|
|
- this.reBuildNumber(obj, dto);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+// if (!this.judgingParameters(dto)) {
|
|
|
|
+// this.reBuildNumber(obj, dto);
|
|
|
|
+// }
|
|
//------保存实体表数据、试验记录信息、生成PDF------
|
|
//------保存实体表数据、试验记录信息、生成PDF------
|
|
this.submitTrialData(obj, dto);
|
|
this.submitTrialData(obj, dto);
|
|
|
|
|
|
@@ -1164,31 +1167,30 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
//------关联新增设备使用记录信息------
|
|
//------关联新增设备使用记录信息------
|
|
this.trialDeviceUseService.addDeviceUseInfo(dto, obj.getId());
|
|
this.trialDeviceUseService.addDeviceUseInfo(dto, obj.getId());
|
|
}
|
|
}
|
|
-
|
|
|
|
// ---- 修改样品单号信息 --------
|
|
// ---- 修改样品单号信息 --------
|
|
- if(dto!=null && Func.isNotEmpty(dto.getEntrustId())){
|
|
|
|
|
|
+ if (dto != null && Func.isNotEmpty(dto.getEntrustId())) {
|
|
//修改项目节点基础信息
|
|
//修改项目节点基础信息
|
|
- jdbcTemplate.update("update u_entrust_info set sample_status=4 where id ='"+dto.getEntrustId()+"'");
|
|
|
|
|
|
+ jdbcTemplate.update("update u_entrust_info set sample_status=4 where id ='" + dto.getEntrustId() + "'");
|
|
}
|
|
}
|
|
String[] strings = dto.getTableType().split(",");
|
|
String[] strings = dto.getTableType().split(",");
|
|
- if(StringUtils.isNotEmpty(dto.getRecordAutoNumber())||StringUtils.isNotEmpty(dto.getReportAutoNumber())){
|
|
|
|
- if (dto.getOldRecordNumber()!=null&&dto.getOldRecordNumber().equals(dto.getRecordNo())||dto.getOldReportNumber()!=null&&dto.getOldReportNumber().equals(dto.getReportNo())) {
|
|
|
|
- if(strings.length==1){
|
|
|
|
- if(strings[0].equals("1")){
|
|
|
|
- if(StringUtils.isNotEmpty(dto.getRecordAutoNumber())){
|
|
|
|
- trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),4,dto.getId(),dto.getRecordAutoNumber());
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getRecordAutoNumber()) || StringUtils.isNotEmpty(dto.getReportAutoNumber())) {
|
|
|
|
+ if (dto.getOldRecordNumber() != null && dto.getOldRecordNumber().equals(dto.getRecordNo()) || dto.getOldReportNumber() != null && dto.getOldReportNumber().equals(dto.getReportNo())) {
|
|
|
|
+ if (strings.length == 1) {
|
|
|
|
+ if (strings[0].equals("1")) {
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getRecordAutoNumber())) {
|
|
|
|
+ trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()), 4, dto.getId(), dto.getRecordAutoNumber());
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- if(StringUtils.isNotEmpty(dto.getReportAutoNumber())){
|
|
|
|
- trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),5,dto.getId(),dto.getReportAutoNumber());
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getReportAutoNumber())) {
|
|
|
|
+ trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()), 5, dto.getId(), dto.getReportAutoNumber());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- if(StringUtils.isNotEmpty(dto.getRecordAutoNumber())){
|
|
|
|
- trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),4,dto.getId(),dto.getRecordAutoNumber());
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getRecordAutoNumber())) {
|
|
|
|
+ trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()), 4, dto.getId(), dto.getRecordAutoNumber());
|
|
}
|
|
}
|
|
- if(StringUtils.isNotEmpty(dto.getReportAutoNumber())){
|
|
|
|
- trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()),5,dto.getId(),dto.getReportAutoNumber());
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getReportAutoNumber())) {
|
|
|
|
+ trialNumberRuleService.checkSave(Long.valueOf(dto.getProjectId()), 5, dto.getId(), dto.getReportAutoNumber());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1198,53 +1200,55 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
|
|
|
/**
|
|
/**
|
|
* 取到传入的表单中的报告编号或者记录编号 修改记录表中相应字段的值
|
|
* 取到传入的表单中的报告编号或者记录编号 修改记录表中相应字段的值
|
|
|
|
+ *
|
|
* @param obj
|
|
* @param obj
|
|
* @param dto
|
|
* @param dto
|
|
*/
|
|
*/
|
|
private void updateRecordNoOrReportNo(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
|
|
private void updateRecordNoOrReportNo(TrialSelfInspectionRecord obj, TrialSelfInspectionRecordDTO dto) {
|
|
- JSONArray dataArray = dto.getDataInfo().getJSONArray("orderList");
|
|
|
|
- //获取第一张表的数据 编号以第一张表为准
|
|
|
|
- List<JSONObject> dataList = dataArray.toJavaList(JSONObject.class);
|
|
|
|
- // 根据 type 字段进行分组
|
|
|
|
- Map<String, List<JSONObject>> groupedByType = dataList.stream()
|
|
|
|
- .collect(Collectors.groupingBy(jsonObject -> jsonObject.getString("type")));
|
|
|
|
- for (Map.Entry<String, List<JSONObject>> entry : groupedByType.entrySet()) {
|
|
|
|
- List<JSONObject> jsonObjects = groupedByType.get(entry.getKey());
|
|
|
|
- JSONObject jsonObject = jsonObjects.get(0);
|
|
|
|
- if(entry.getKey().equals("2")&&jsonObjects.size()>1){
|
|
|
|
- jsonObject = jsonObjects.get(1);
|
|
|
|
- }
|
|
|
|
- String pkeyId = jsonObject.getString("pkeyId");
|
|
|
|
- String sql = "select * from m_wbs_tree_private where p_key_id =" + pkeyId;
|
|
|
|
- WbsTreePrivate table = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
|
- String fileUrl = table.getHtmlUrl();
|
|
|
|
- try {
|
|
|
|
- InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
|
- String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
|
- htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
|
|
- Document doc = Jsoup.parse(htmlString);
|
|
|
|
- // 查找所有具有 placeholderxx 属性的元素
|
|
|
|
- //表类型 1,9=记录表 2,10=报告单
|
|
|
|
- if(table.getTableType() == 9 || table.getTableType() == 1){
|
|
|
|
- //记录表 以第一张表为准
|
|
|
|
- this.updateRecordNoOrReportNo(dto, jsonObject, doc, "记录编 号:", "record_no");
|
|
|
|
- this.updateRecordNoOrReportNo(dto, jsonObject, doc, "记录编号:", "record_no");
|
|
|
|
- }else if(table.getTableType() == 10 || table.getTableType() == 2){
|
|
|
|
- //报告单
|
|
|
|
- this.updateRecordNoOrReportNo(dto,jsonObject,doc,"报告编号:","report_no");
|
|
|
|
- // :不一样 一个中文一个英文
|
|
|
|
- this.updateRecordNoOrReportNo(dto,jsonObject,doc,"报告编号:","report_no");
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error(e.getMessage());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ JSONArray dataArray = dto.getDataInfo().getJSONArray("orderList");
|
|
|
|
+ //获取第一张表的数据 编号以第一张表为准
|
|
|
|
+ List<JSONObject> dataList = dataArray.toJavaList(JSONObject.class);
|
|
|
|
+ // 根据 type 字段进行分组
|
|
|
|
+ Map<String, List<JSONObject>> groupedByType = dataList.stream()
|
|
|
|
+ .collect(Collectors.groupingBy(jsonObject -> jsonObject.getString("type")));
|
|
|
|
+ for (Map.Entry<String, List<JSONObject>> entry : groupedByType.entrySet()) {
|
|
|
|
+ List<JSONObject> jsonObjects = groupedByType.get(entry.getKey());
|
|
|
|
+ JSONObject jsonObject = jsonObjects.get(0);
|
|
|
|
+ if (entry.getKey().equals("2") && jsonObjects.size() > 1) {
|
|
|
|
+ jsonObject = jsonObjects.get(1);
|
|
|
|
+ }
|
|
|
|
+ String pkeyId = jsonObject.getString("pkeyId");
|
|
|
|
+ String sql = "select * from m_wbs_tree_private where p_key_id =" + pkeyId;
|
|
|
|
+ WbsTreePrivate table = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreePrivate.class));
|
|
|
|
+ String fileUrl = table.getHtmlUrl();
|
|
|
|
+ try {
|
|
|
|
+ InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
|
|
|
|
+ String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
|
+ htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
|
|
+ Document doc = Jsoup.parse(htmlString);
|
|
|
|
+ // 查找所有具有 placeholderxx 属性的元素
|
|
|
|
+ //表类型 1,9=记录表 2,10=报告单
|
|
|
|
+ if (table.getTableType() == 9 || table.getTableType() == 1) {
|
|
|
|
+ //记录表 以第一张表为准
|
|
|
|
+ this.updateRecordNoOrReportNo(dto, jsonObject, doc, "记录编 号:", "record_no");
|
|
|
|
+ this.updateRecordNoOrReportNo(dto, jsonObject, doc, "记录编号:", "record_no");
|
|
|
|
+ } else if (table.getTableType() == 10 || table.getTableType() == 2) {
|
|
|
|
+ //报告单
|
|
|
|
+ this.updateRecordNoOrReportNo(dto, jsonObject, doc, "报告编号:", "report_no");
|
|
|
|
+ // :不一样 一个中文一个英文
|
|
|
|
+ this.updateRecordNoOrReportNo(dto, jsonObject, doc, "报告编号:", "report_no");
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 判断入参中用户是否自己手动填写了 报告编号或者记录编号
|
|
* 判断入参中用户是否自己手动填写了 报告编号或者记录编号
|
|
|
|
+ *
|
|
* @param dto
|
|
* @param dto
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -1263,20 +1267,20 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
Document doc = Jsoup.parse(htmlString);
|
|
Document doc = Jsoup.parse(htmlString);
|
|
//可能出现的几种情况 4种情况 记录编 号: 记录编号: 报告编号: 报告编号: 编号:
|
|
//可能出现的几种情况 4种情况 记录编 号: 记录编号: 报告编号: 报告编号: 编号:
|
|
Elements elementsWithPlaceholderxx = doc.select("[placeholderxx='记录编 号:']");
|
|
Elements elementsWithPlaceholderxx = doc.select("[placeholderxx='记录编 号:']");
|
|
- if(elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null){
|
|
|
|
|
|
+ if (elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) {
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='记录编号:']");
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='记录编号:']");
|
|
- if(elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null){
|
|
|
|
|
|
+ if (elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) {
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='报告编号:']");
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='报告编号:']");
|
|
- if(elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null){
|
|
|
|
|
|
+ if (elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) {
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='报告编号:']");
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='报告编号:']");
|
|
- if(elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null){
|
|
|
|
|
|
+ if (elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) {
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='编号:']");
|
|
elementsWithPlaceholderxx = doc.select("[placeholderxx='编号:']");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//没找到直接返回false
|
|
//没找到直接返回false
|
|
- if(elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null){
|
|
|
|
|
|
+ if (elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) {
|
|
log.error("方法:private boolean JudgingParameters(TrialSelfInspectionRecordDTO dto)中 未找到元素");
|
|
log.error("方法:private boolean JudgingParameters(TrialSelfInspectionRecordDTO dto)中 未找到元素");
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -1284,9 +1288,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
String key = first.attr("id");
|
|
String key = first.attr("id");
|
|
//记录编号或者报告编号的值
|
|
//记录编号或者报告编号的值
|
|
String recordOrReportNo = jsonObject.getString(key);
|
|
String recordOrReportNo = jsonObject.getString(key);
|
|
- if(recordOrReportNo != null || "".equals(recordOrReportNo)){
|
|
|
|
|
|
+ if (recordOrReportNo != null || "".equals(recordOrReportNo)) {
|
|
return true;
|
|
return true;
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -1298,31 +1302,32 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
|
|
|
/**
|
|
/**
|
|
* 修改记录编号或者报告编号的值
|
|
* 修改记录编号或者报告编号的值
|
|
|
|
+ *
|
|
* @param dto
|
|
* @param dto
|
|
* @param jsonObject
|
|
* @param jsonObject
|
|
* @param doc
|
|
* @param doc
|
|
* @param value
|
|
* @param value
|
|
* @param fileVlue
|
|
* @param fileVlue
|
|
*/
|
|
*/
|
|
- private void updateRecordNoOrReportNo(TrialSelfInspectionRecord dto,JSONObject jsonObject,Document doc,String value, String fileVlue) {
|
|
|
|
- Elements elementsWithPlaceholderxx = doc.select("[placeholderxx="+value+"]");
|
|
|
|
- if((elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) && value.equals("报告编号:")){
|
|
|
|
|
|
+ private void updateRecordNoOrReportNo(TrialSelfInspectionRecord dto, JSONObject jsonObject, Document doc, String value, String fileVlue) {
|
|
|
|
+ Elements elementsWithPlaceholderxx = doc.select("[placeholderxx=" + value + "]");
|
|
|
|
+ if ((elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) && value.equals("报告编号:")) {
|
|
//特殊情况
|
|
//特殊情况
|
|
value = "编号:";
|
|
value = "编号:";
|
|
- elementsWithPlaceholderxx = doc.select("[placeholderxx="+value+"]");
|
|
|
|
|
|
+ elementsWithPlaceholderxx = doc.select("[placeholderxx=" + value + "]");
|
|
}
|
|
}
|
|
- if(elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null){
|
|
|
|
|
|
+ if (elementsWithPlaceholderxx.size() == 0 || elementsWithPlaceholderxx == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
Element first = elementsWithPlaceholderxx.first();
|
|
Element first = elementsWithPlaceholderxx.first();
|
|
String key = first.attr("id");
|
|
String key = first.attr("id");
|
|
//记录编号或者报告编号的值
|
|
//记录编号或者报告编号的值
|
|
String recordOrReportNo = jsonObject.getString(key);
|
|
String recordOrReportNo = jsonObject.getString(key);
|
|
- if(!"".equals(recordOrReportNo) && !(recordOrReportNo == null)){
|
|
|
|
- String updateSql = "update u_trial_self_inspection_record set " + fileVlue +"='" + recordOrReportNo + "' where id='" + dto.getId()+"'";
|
|
|
|
- if(fileVlue.equals("record_no")){
|
|
|
|
- dto.setRecordNo(recordOrReportNo);
|
|
|
|
- }else {
|
|
|
|
|
|
+ if (!"".equals(recordOrReportNo) && !(recordOrReportNo == null)) {
|
|
|
|
+ String updateSql = "update u_trial_self_inspection_record set " + fileVlue + "='" + recordOrReportNo + "' where id='" + dto.getId() + "'";
|
|
|
|
+ if (fileVlue.equals("record_no")) {
|
|
|
|
+ dto.setRecordNo(recordOrReportNo);
|
|
|
|
+ } else {
|
|
dto.setReportNo(recordOrReportNo);
|
|
dto.setReportNo(recordOrReportNo);
|
|
}
|
|
}
|
|
jdbcTemplate.execute(updateSql);
|
|
jdbcTemplate.execute(updateSql);
|
|
@@ -1375,7 +1380,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
for (int i = 0; i < dataArray.size(); i++) {
|
|
for (int i = 0; i < dataArray.size(); i++) {
|
|
JSONObject jsonObject = dataArray.getJSONObject(i);
|
|
JSONObject jsonObject = dataArray.getJSONObject(i);
|
|
String type = jsonObject.getString("type");
|
|
String type = jsonObject.getString("type");
|
|
- if(ObjectUtil.isEmpty(type)){
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(type)) {
|
|
throw new RuntimeException("请点击表单后再进行保存");
|
|
throw new RuntimeException("请点击表单后再进行保存");
|
|
}
|
|
}
|
|
if (type.equals("1")) {
|
|
if (type.equals("1")) {
|
|
@@ -1397,37 +1402,37 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
updateSql = getUpdateSql(dto, pdfURL, listPdf, snowId, "record_pdf_url", 2, "report_pdf_url");
|
|
updateSql = getUpdateSql(dto, pdfURL, listPdf, snowId, "record_pdf_url", 2, "report_pdf_url");
|
|
} else {
|
|
} else {
|
|
//一起保存的数据 只改变pdf_url
|
|
//一起保存的数据 只改变pdf_url
|
|
- this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).set(TrialSelfInspectionRecord::getTaskStatus,"未上报").eq(TrialSelfInspectionRecord::getId, dto.getId()));
|
|
|
|
|
|
+ this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).set(TrialSelfInspectionRecord::getTaskStatus, "未上报").eq(TrialSelfInspectionRecord::getId, dto.getId()));
|
|
}
|
|
}
|
|
if (ObjectUtil.isNotEmpty(updateSql)) {
|
|
if (ObjectUtil.isNotEmpty(updateSql)) {
|
|
jdbcTemplate.execute(updateSql);
|
|
jdbcTemplate.execute(updateSql);
|
|
}
|
|
}
|
|
- } else if (pdfURL!=null&&pdfURL.startsWith("500")) {
|
|
|
|
- pdfURL=pdfURL.substring(3);
|
|
|
|
|
|
+ } else if (pdfURL != null && pdfURL.startsWith("500")) {
|
|
|
|
+ pdfURL = pdfURL.substring(3);
|
|
throw new ServiceException(pdfURL);
|
|
throw new ServiceException(pdfURL);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@NotNull
|
|
@NotNull
|
|
- private String getUpdateSql(TrialSelfInspectionRecordDTO dto, String pdfURL, String listPdf, Long snowId,String param1,int type,String param2) {
|
|
|
|
|
|
+ private String getUpdateSql(TrialSelfInspectionRecordDTO dto, String pdfURL, String listPdf, Long snowId, String param1, int type, String param2) {
|
|
String updateSql;
|
|
String updateSql;
|
|
- String sqlForAntherPDF = "SELECT "+param1+ " from u_trial_self_inspection_record where id = " + dto.getId() + " and is_deleted = 0";
|
|
|
|
|
|
+ String sqlForAntherPDF = "SELECT " + param1 + " from u_trial_self_inspection_record where id = " + dto.getId() + " and is_deleted = 0";
|
|
String AntherPDFUrl = jdbcTemplate.queryForObject(sqlForAntherPDF, new SingleColumnRowMapper<String>(String.class));
|
|
String AntherPDFUrl = jdbcTemplate.queryForObject(sqlForAntherPDF, new SingleColumnRowMapper<String>(String.class));
|
|
- if(ObjectUtil.isNotEmpty(AntherPDFUrl)){
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(AntherPDFUrl)) {
|
|
//合并后保存 把报告单合并在前面
|
|
//合并后保存 把报告单合并在前面
|
|
- if(type == 1){
|
|
|
|
|
|
+ if (type == 1) {
|
|
FileUtils.mergePdfPublicMethods(Arrays.asList(AntherPDFUrl, pdfURL), listPdf);
|
|
FileUtils.mergePdfPublicMethods(Arrays.asList(AntherPDFUrl, pdfURL), listPdf);
|
|
- }else {
|
|
|
|
- FileUtils.mergePdfPublicMethods(Arrays.asList(pdfURL,AntherPDFUrl), listPdf);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ FileUtils.mergePdfPublicMethods(Arrays.asList(pdfURL, AntherPDFUrl), listPdf);
|
|
}
|
|
}
|
|
|
|
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(snowId + ".pdf", listPdf);
|
|
BladeFile bladeFile = this.newIOSSClient.uploadFile(snowId + ".pdf", listPdf);
|
|
- updateSql = "update u_trial_self_inspection_record set pdf_url = '" + bladeFile.getLink() + "',"+param2+ "= '"+ pdfURL + "' ,task_status='未上报' where id='" + dto.getId()+"'";
|
|
|
|
|
|
+ updateSql = "update u_trial_self_inspection_record set pdf_url = '" + bladeFile.getLink() + "'," + param2 + "= '" + pdfURL + "' ,task_status='未上报' where id='" + dto.getId() + "'";
|
|
//合并后更新queryInfo表的pdfurl
|
|
//合并后更新queryInfo表的pdfurl
|
|
String updateForQurtyInfo = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify='" + dto.getType() + "' and wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "' ";
|
|
String updateForQurtyInfo = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify='" + dto.getType() + "' and wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "' ";
|
|
jdbcTemplate.execute(updateForQurtyInfo);
|
|
jdbcTemplate.execute(updateForQurtyInfo);
|
|
- }else {
|
|
|
|
- updateSql = "update u_trial_self_inspection_record set "+param2+" = '"+ pdfURL + "' ,task_status='未上报' where id='" + dto.getId()+"'";
|
|
|
|
|
|
+ } else {
|
|
|
|
+ updateSql = "update u_trial_self_inspection_record set " + param2 + " = '" + pdfURL + "' ,task_status='未上报' where id='" + dto.getId() + "'";
|
|
}
|
|
}
|
|
return updateSql;
|
|
return updateSql;
|
|
}
|
|
}
|
|
@@ -1451,16 +1456,16 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
|
|
|
|
//取样信息
|
|
//取样信息
|
|
List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectList(Wrappers.<TrialSampleInfo>lambdaQuery().in(TrialSampleInfo::getId, ids));
|
|
List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectList(Wrappers.<TrialSampleInfo>lambdaQuery().in(TrialSampleInfo::getId, ids));
|
|
- List<String> samplingLocations = trialSampleInfos.stream().map(TrialSampleInfo::getSamplingLocation).filter(string -> string !=null && !string.isEmpty()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> samplingLocations = trialSampleInfos.stream().map(TrialSampleInfo::getSamplingLocation).filter(string -> string != null && !string.isEmpty()).collect(Collectors.toList());
|
|
String samplingLocation = org.apache.commons.lang.StringUtils.join(samplingLocations, "、");
|
|
String samplingLocation = org.apache.commons.lang.StringUtils.join(samplingLocations, "、");
|
|
|
|
|
|
- List<String> calculationUnits = trialSampleInfos.stream().map(TrialSampleInfo::getCalculationUnit).filter(string -> string !=null && !string.isEmpty()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> calculationUnits = trialSampleInfos.stream().map(TrialSampleInfo::getCalculationUnit).filter(string -> string != null && !string.isEmpty()).collect(Collectors.toList());
|
|
String calculationUnit = org.apache.commons.lang.StringUtils.join(calculationUnits, "、");
|
|
String calculationUnit = org.apache.commons.lang.StringUtils.join(calculationUnits, "、");
|
|
|
|
|
|
- List<String> specificationNumbers = trialSampleInfos.stream().map(TrialSampleInfo::getSpecificationNumber).filter(string -> string !=null && !string.isEmpty()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> specificationNumbers = trialSampleInfos.stream().map(TrialSampleInfo::getSpecificationNumber).filter(string -> string != null && !string.isEmpty()).collect(Collectors.toList());
|
|
String specificationNumber = org.apache.commons.lang.StringUtils.join(specificationNumbers, "、");
|
|
String specificationNumber = org.apache.commons.lang.StringUtils.join(specificationNumbers, "、");
|
|
|
|
|
|
- List<String> specificationModels = trialSampleInfos.stream().map(TrialSampleInfo::getSpecificationModel).filter(string -> string !=null && !string.isEmpty()).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> specificationModels = trialSampleInfos.stream().map(TrialSampleInfo::getSpecificationModel).filter(string -> string != null && !string.isEmpty()).collect(Collectors.toList());
|
|
String specificationModel = org.apache.commons.lang.StringUtils.join(specificationModels, "、");
|
|
String specificationModel = org.apache.commons.lang.StringUtils.join(specificationModels, "、");
|
|
|
|
|
|
//更新
|
|
//更新
|
|
@@ -1568,7 +1573,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
|
|
|
|
- maxRecordNo = recordNos.size()+"";
|
|
|
|
|
|
+ maxRecordNo = recordNos.size() + "";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1591,7 +1596,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
- maxReportNo = reportNos.size()+"";
|
|
|
|
|
|
+ maxReportNo = reportNos.size() + "";
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1644,7 +1649,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
- maxRecordNo = recordNos.size()+"";
|
|
|
|
|
|
+ maxRecordNo = recordNos.size() + "";
|
|
}
|
|
}
|
|
|
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
@@ -1684,7 +1689,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
- maxReportNo = reportNos.size()+"";
|
|
|
|
|
|
+ maxReportNo = reportNos.size() + "";
|
|
}
|
|
}
|
|
|
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
@@ -1704,8 +1709,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
//提前构建记录或者报告编号 供用户保存前提交时使用(新增保存前显示系统引用的记录编号或者报告编号)
|
|
//提前构建记录或者报告编号 供用户保存前提交时使用(新增保存前显示系统引用的记录编号或者报告编号)
|
|
- public HashMap<String,String> buildNumberView(TrialSelfInspectionRecordDTO dto) {
|
|
|
|
|
|
+ public HashMap<String, String> buildNumberView(TrialSelfInspectionRecordDTO dto) {
|
|
StringSPUtils spUtils = new StringSPUtils();
|
|
StringSPUtils spUtils = new StringSPUtils();
|
|
List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId(), dto.getType());
|
|
List<TrialSelfInspectionRecord> result = baseMapper.selectAll(dto.getNodeId(), dto.getContractId(), dto.getType());
|
|
List<TrialSelfInspectionRecord> trialSelfInspectionRecords = result.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
List<TrialSelfInspectionRecord> trialSelfInspectionRecords = result.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
@@ -1731,7 +1737,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
|
|
|
|
- maxRecordNo = recordNos.size()+"";
|
|
|
|
|
|
+ maxRecordNo = recordNos.size() + "";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1754,7 +1760,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
- maxReportNo = reportNos.size()+"";
|
|
|
|
|
|
+ maxReportNo = reportNos.size() + "";
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1768,9 +1774,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
//记录表
|
|
//记录表
|
|
if (StringUtils.isNotEmpty(maxRecordNo)) {
|
|
if (StringUtils.isNotEmpty(maxRecordNo)) {
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
- stringStringHashMap.put("type","记录表");
|
|
|
|
|
|
+ stringStringHashMap.put("type", "记录表");
|
|
if (trialSelfInspectionRecord != null) {
|
|
if (trialSelfInspectionRecord != null) {
|
|
- stringStringHashMap.put("valueStr",trialSelfInspectionRecord.getRecordNo());
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getRecordNo());
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
String str1 = "JL" +
|
|
String str1 = "JL" +
|
|
@@ -1778,16 +1784,16 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
"-" + year +
|
|
"-" + year +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + maxRecordNo;
|
|
"-" + maxRecordNo;
|
|
- stringStringHashMap.put("valueStr",str1);
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", str1);
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
|
|
|
|
//报告单
|
|
//报告单
|
|
if (StringUtils.isNotEmpty(maxReportNo)) {
|
|
if (StringUtils.isNotEmpty(maxReportNo)) {
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
- stringStringHashMap.put("type","报告单");
|
|
|
|
|
|
+ stringStringHashMap.put("type", "报告单");
|
|
if (trialSelfInspectionRecord != null) {
|
|
if (trialSelfInspectionRecord != null) {
|
|
- stringStringHashMap.put("valueStr",trialSelfInspectionRecord.getReportNo());
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getReportNo());
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
String str2 = "BG" +
|
|
String str2 = "BG" +
|
|
@@ -1795,7 +1801,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
"-" + year +
|
|
"-" + year +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + maxReportNo;
|
|
"-" + maxReportNo;
|
|
- stringStringHashMap.put("valueStr",str2);
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", str2);
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1821,7 +1827,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
- maxRecordNo = recordNos.size()+"";
|
|
|
|
|
|
+ maxRecordNo = recordNos.size() + "";
|
|
}
|
|
}
|
|
|
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
@@ -1832,9 +1838,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
//记录表
|
|
//记录表
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
- stringStringHashMap.put("type","记录表");
|
|
|
|
|
|
+ stringStringHashMap.put("type", "记录表");
|
|
if (trialSelfInspectionRecord != null) {
|
|
if (trialSelfInspectionRecord != null) {
|
|
- stringStringHashMap.put("valueStr",trialSelfInspectionRecord.getRecordNo());
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getRecordNo());
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
String str1 = "JL" +
|
|
String str1 = "JL" +
|
|
@@ -1842,7 +1848,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
"-" + year +
|
|
"-" + year +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + maxRecordNo;
|
|
"-" + maxRecordNo;
|
|
- stringStringHashMap.put("valueStr",str1);
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", str1);
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1868,7 +1874,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
throw new ServiceException("当前编号已达到最大值9999,操作失败");
|
|
}*/
|
|
}*/
|
|
- maxReportNo = reportNos.size()+"";
|
|
|
|
|
|
+ maxReportNo = reportNos.size() + "";
|
|
}
|
|
}
|
|
|
|
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
WbsTreePrivate wbsTreePrivate = wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(String.valueOf(dto.getNodeId()))).stream().findAny().orElse(null);
|
|
@@ -1879,9 +1885,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
} else {
|
|
} else {
|
|
//报告单
|
|
//报告单
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
|
- stringStringHashMap.put("type","报告单");
|
|
|
|
|
|
+ stringStringHashMap.put("type", "报告单");
|
|
if (trialSelfInspectionRecord != null) {
|
|
if (trialSelfInspectionRecord != null) {
|
|
- stringStringHashMap.put("valueStr",trialSelfInspectionRecord.getReportNo());
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", trialSelfInspectionRecord.getReportNo());
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
String str2 = "BG" +
|
|
String str2 = "BG" +
|
|
@@ -1889,7 +1895,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
"-" + year +
|
|
"-" + year +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + spUtils.getStringSP(wbsTreePrivate.getNodeName().trim()) +
|
|
"-" + maxReportNo;
|
|
"-" + maxReportNo;
|
|
- stringStringHashMap.put("valueStr",str2);
|
|
|
|
|
|
+ stringStringHashMap.put("valueStr", str2);
|
|
return stringStringHashMap;
|
|
return stringStringHashMap;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1976,17 +1982,16 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
if (informationQuery != null) {
|
|
if (informationQuery != null) {
|
|
List<String> pdfList = new ArrayList<>();
|
|
List<String> pdfList = new ArrayList<>();
|
|
//------自检------
|
|
//------自检------
|
|
|
|
+ if (informationQuery.getPdfTrialUrl() != null) {
|
|
|
|
+ //如果当前存在第三方、外委的pdf,那么拼接
|
|
|
|
+ pdfList.add(informationQuery.getPdfTrialUrl());
|
|
|
|
+ }
|
|
if (dto.getType().equals(1)) {
|
|
if (dto.getType().equals(1)) {
|
|
- if (informationQuery.getPdfTrialUrl() != null) {
|
|
|
|
- //如果当前存在第三方、外委的pdf,那么拼接
|
|
|
|
- pdfList.add(informationQuery.getPdfTrialUrl());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//自检pdf
|
|
//自检pdf
|
|
List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
|
|
List<TrialSelfInspectionRecord> trialSelfInspectionRecords = baseMapper.selectList(Wrappers.<TrialSelfInspectionRecord>lambdaQuery()
|
|
- .select(TrialSelfInspectionRecord::getPdfUrl,TrialSelfInspectionRecord::getContractId,TrialSelfInspectionRecord::getId,TrialSelfInspectionRecord::getType)
|
|
|
|
|
|
+ .select(TrialSelfInspectionRecord::getPdfUrl, TrialSelfInspectionRecord::getContractId, TrialSelfInspectionRecord::getId, TrialSelfInspectionRecord::getType)
|
|
.in(TrialSelfInspectionRecord::getId, Func.toLongList(dto.getIds())));
|
|
.in(TrialSelfInspectionRecord::getId, Func.toLongList(dto.getIds())));
|
|
- if(trialSelfInspectionRecords.size()>0){
|
|
|
|
|
|
+ if (trialSelfInspectionRecords.size() > 0) {
|
|
for (TrialSelfInspectionRecord record : trialSelfInspectionRecords) {
|
|
for (TrialSelfInspectionRecord record : trialSelfInspectionRecords) {
|
|
String pdf = this.getMergePdfToTrialNew(record.getContractId(), record.getId(), record.getType());
|
|
String pdf = this.getMergePdfToTrialNew(record.getContractId(), record.getId(), record.getType());
|
|
pdfList.add(pdf);
|
|
pdfList.add(pdf);
|
|
@@ -1996,11 +2001,6 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
// pdfList.addAll(pdfURLs);
|
|
// pdfList.addAll(pdfURLs);
|
|
//------第三方、外委------
|
|
//------第三方、外委------
|
|
} else if (dto.getType().equals(2) || dto.getType().equals(3)) {
|
|
} else if (dto.getType().equals(2) || dto.getType().equals(3)) {
|
|
- if (informationQuery.getPdfTrialUrl() != null) {
|
|
|
|
- //如果当前存在试验自检的pdf,那么拼接
|
|
|
|
- pdfList.add(informationQuery.getPdfTrialUrl());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
//第三方、外委pdf
|
|
//第三方、外委pdf
|
|
List<TrialDetectionData> trialDetectionData = trialDetectionDataService.getBaseMapper().selectList(Wrappers.<TrialDetectionData>lambdaQuery().in(TrialDetectionData::getId, Func.toLongList(dto.getIds())));
|
|
List<TrialDetectionData> trialDetectionData = trialDetectionDataService.getBaseMapper().selectList(Wrappers.<TrialDetectionData>lambdaQuery().in(TrialDetectionData::getId, Func.toLongList(dto.getIds())));
|
|
List<String> pdfURLs = new ArrayList<>();
|
|
List<String> pdfURLs = new ArrayList<>();
|
|
@@ -2015,6 +2015,24 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
pdfList.addAll(pdfURLs);
|
|
pdfList.addAll(pdfURLs);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //成渝自检
|
|
|
|
+ if (dto.getType().equals(11)) {
|
|
|
|
+ List<TrialCyFinishTestReport> trialCyFinishTestReports = trialCyFinishTestReportService.getBaseMapper().selectList(Wrappers.<TrialCyFinishTestReport>lambdaQuery().in(TrialCyFinishTestReport::getTaskId, Func.toLongList(dto.getIds())));
|
|
|
|
+ trialCyFinishTestReports.forEach(f -> {
|
|
|
|
+ if (StringUtils.isNotBlank(f.getAssembleFile())) {
|
|
|
|
+ pdfList.add(f.getAssembleFile());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ } else if (dto.getType().equals(12) || dto.getType().equals(13)) {
|
|
|
|
+ List<TrialCyThirdReport> trialCyThirdReports = trialCyThirdReportService.getBaseMapper().selectList(Wrappers.<TrialCyThirdReport>lambdaQuery().in(TrialCyThirdReport::getId, Func.toLongList(dto.getIds())));
|
|
|
|
+ trialCyThirdReports.forEach(f -> {
|
|
|
|
+ if (StringUtils.isNotBlank(f.getAssembleFile())) {
|
|
|
|
+ pdfList.add(f.getAssembleFile());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
if (pdfList.size() > 0) {
|
|
if (pdfList.size() > 0) {
|
|
//合并试验自检、第三方、外委的pdf
|
|
//合并试验自检、第三方、外委的pdf
|
|
List<String> collect = pdfList.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
List<String> collect = pdfList.stream().filter(Objects::nonNull).collect(Collectors.toList());
|
|
@@ -2113,7 +2131,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
@Override
|
|
@Override
|
|
public R getSamplePdfUrl(String id, String contrctId) {
|
|
public R getSamplePdfUrl(String id, String contrctId) {
|
|
try {
|
|
try {
|
|
- String pdf = this.getMergePdfToTrial(Func.toLong(contrctId), Func.toLong(id));
|
|
|
|
|
|
+ String pdf = this.getMergePdfToTrial(Func.toLong(contrctId), Func.toLong(id));
|
|
return R.data(pdf);
|
|
return R.data(pdf);
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
@@ -2185,28 +2203,28 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
if (entrustInfo != null && info == null && oldTrialSampleInfo != null) {
|
|
if (entrustInfo != null && info == null && oldTrialSampleInfo != null) {
|
|
if (entrustInfo.getSampleId() != null && entrustInfo.getSampleId().equals(oldTrialSampleInfo.getId())) {
|
|
if (entrustInfo.getSampleId() != null && entrustInfo.getSampleId().equals(oldTrialSampleInfo.getId())) {
|
|
record.setEntrustId(null);
|
|
record.setEntrustId(null);
|
|
- baseInfo.setEntrustId( null);
|
|
|
|
|
|
+ baseInfo.setEntrustId(null);
|
|
baseInfo.setEntrustNo(null);
|
|
baseInfo.setEntrustNo(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- boolean a=true;
|
|
|
|
- boolean b=true;
|
|
|
|
|
|
+ boolean a = true;
|
|
|
|
+ boolean b = true;
|
|
record.setBaseInfo(JSON.toJSONString(baseInfo));
|
|
record.setBaseInfo(JSON.toJSONString(baseInfo));
|
|
if (oldRecord == null) {
|
|
if (oldRecord == null) {
|
|
- if(StringUtils.isNotEmpty(record.getRecordNo())){
|
|
|
|
- if(StringUtils.isNotEmpty(record.getRecordNo())){
|
|
|
|
- a= trialNumberRuleService.checkTrialNumberIsExist(record.getRecordNo(), 4, record.getContractId());
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(record.getRecordNo())) {
|
|
|
|
+ if (StringUtils.isNotEmpty(record.getRecordNo())) {
|
|
|
|
+ a = trialNumberRuleService.checkTrialNumberIsExist(record.getRecordNo(), 4, record.getContractId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(StringUtils.isNotEmpty(record.getRecordNo())){
|
|
|
|
- if(StringUtils.isNotEmpty(record.getReportNo())){
|
|
|
|
- b= trialNumberRuleService.checkTrialNumberIsExist(record.getReportNo(), 5, record.getContractId());
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(record.getRecordNo())) {
|
|
|
|
+ if (StringUtils.isNotEmpty(record.getReportNo())) {
|
|
|
|
+ b = trialNumberRuleService.checkTrialNumberIsExist(record.getReportNo(), 5, record.getContractId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(!a){
|
|
|
|
|
|
+ if (!a) {
|
|
throw new ServiceException("记录编号已存在");
|
|
throw new ServiceException("记录编号已存在");
|
|
}
|
|
}
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new ServiceException("报告编号已存在");
|
|
throw new ServiceException("报告编号已存在");
|
|
}
|
|
}
|
|
this.save(record);
|
|
this.save(record);
|
|
@@ -2231,9 +2249,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
if (StringUtils.isNotBlank(samplingLocation) || StringUtils.isNotBlank(calculationUnit) || StringUtils.isNotBlank(specificationNumber) || StringUtils.isNotBlank(specificationModel)) {
|
|
if (StringUtils.isNotBlank(samplingLocation) || StringUtils.isNotBlank(calculationUnit) || StringUtils.isNotBlank(specificationNumber) || StringUtils.isNotBlank(specificationModel)) {
|
|
this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
|
|
this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
|
|
.set(StringUtils.isNotBlank(samplingLocation), TrialSelfInspectionRecord::getSamplingLocation, samplingLocation)
|
|
.set(StringUtils.isNotBlank(samplingLocation), TrialSelfInspectionRecord::getSamplingLocation, samplingLocation)
|
|
- .set(StringUtils.isNotBlank(calculationUnit),TrialSelfInspectionRecord::getCompany, calculationUnit)
|
|
|
|
- .set(StringUtils.isNotBlank(specificationNumber),TrialSelfInspectionRecord::getSpecificationNumber, specificationNumber)
|
|
|
|
- .set(StringUtils.isNotBlank(specificationModel),TrialSelfInspectionRecord::getSpecificationModel, specificationModel)
|
|
|
|
|
|
+ .set(StringUtils.isNotBlank(calculationUnit), TrialSelfInspectionRecord::getCompany, calculationUnit)
|
|
|
|
+ .set(StringUtils.isNotBlank(specificationNumber), TrialSelfInspectionRecord::getSpecificationNumber, specificationNumber)
|
|
|
|
+ .set(StringUtils.isNotBlank(specificationModel), TrialSelfInspectionRecord::getSpecificationModel, specificationModel)
|
|
.eq(TrialSelfInspectionRecord::getId, record.getId()));
|
|
.eq(TrialSelfInspectionRecord::getId, record.getId()));
|
|
}
|
|
}
|
|
if (entrustInfo == null) {
|
|
if (entrustInfo == null) {
|
|
@@ -2248,9 +2266,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// ---- 修改样品单号信息 --------
|
|
// ---- 修改样品单号信息 --------
|
|
- if(entrustInfo != null){
|
|
|
|
|
|
+ if (entrustInfo != null) {
|
|
//修改项目节点基础信息
|
|
//修改项目节点基础信息
|
|
- jdbcTemplate.update("update u_entrust_info set sample_status=4 where id ='"+entrustInfo.getId()+"'");
|
|
|
|
|
|
+ jdbcTemplate.update("update u_entrust_info set sample_status=4 where id ='" + entrustInfo.getId() + "'");
|
|
if (entrustInfo.getSampleId() != null) {
|
|
if (entrustInfo.getSampleId() != null) {
|
|
TrialSampleInfo sampleInfo = trialSampleInfoMapper.selectById(entrustInfo.getSampleId());
|
|
TrialSampleInfo sampleInfo = trialSampleInfoMapper.selectById(entrustInfo.getSampleId());
|
|
if (sampleInfo != null) {
|
|
if (sampleInfo != null) {
|
|
@@ -2269,9 +2287,9 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
if (StringUtils.isNotBlank(samplingLocation) || StringUtils.isNotBlank(calculationUnit) || StringUtils.isNotBlank(specificationNumber) || StringUtils.isNotBlank(specificationModel)) {
|
|
if (StringUtils.isNotBlank(samplingLocation) || StringUtils.isNotBlank(calculationUnit) || StringUtils.isNotBlank(specificationNumber) || StringUtils.isNotBlank(specificationModel)) {
|
|
this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
|
|
this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate()
|
|
.set(StringUtils.isNotBlank(samplingLocation), TrialSelfInspectionRecord::getSamplingLocation, samplingLocation)
|
|
.set(StringUtils.isNotBlank(samplingLocation), TrialSelfInspectionRecord::getSamplingLocation, samplingLocation)
|
|
- .set(StringUtils.isNotBlank(calculationUnit),TrialSelfInspectionRecord::getCompany, calculationUnit)
|
|
|
|
- .set(StringUtils.isNotBlank(specificationNumber),TrialSelfInspectionRecord::getSpecificationNumber, specificationNumber)
|
|
|
|
- .set(StringUtils.isNotBlank(specificationModel),TrialSelfInspectionRecord::getSpecificationModel, specificationModel)
|
|
|
|
|
|
+ .set(StringUtils.isNotBlank(calculationUnit), TrialSelfInspectionRecord::getCompany, calculationUnit)
|
|
|
|
+ .set(StringUtils.isNotBlank(specificationNumber), TrialSelfInspectionRecord::getSpecificationNumber, specificationNumber)
|
|
|
|
+ .set(StringUtils.isNotBlank(specificationModel), TrialSelfInspectionRecord::getSpecificationModel, specificationModel)
|
|
.eq(TrialSelfInspectionRecord::getId, record.getId()));
|
|
.eq(TrialSelfInspectionRecord::getId, record.getId()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2286,19 +2304,19 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
|
|
List<Long> collect = trialSampleInfoList.stream().map(TrialSampleInfo::getId).collect(Collectors.toList());
|
|
List<Long> collect = trialSampleInfoList.stream().map(TrialSampleInfo::getId).collect(Collectors.toList());
|
|
recordDTO.setSampleIds(org.apache.commons.lang.StringUtils.join(collect, ","));
|
|
recordDTO.setSampleIds(org.apache.commons.lang.StringUtils.join(collect, ","));
|
|
recordDTO.setNodeId(dto.getNodeId());
|
|
recordDTO.setNodeId(dto.getNodeId());
|
|
- recordDTO.setTrialUserName(AuthUtil.getUserName());
|
|
|
|
|
|
+ recordDTO.setTrialUserName(AuthUtil.getNickName());
|
|
this.trialDeviceUseService.addDeviceUseInfo(recordDTO, record.getId());
|
|
this.trialDeviceUseService.addDeviceUseInfo(recordDTO, record.getId());
|
|
}
|
|
}
|
|
- if(dto.getOldRecordNumber()!=null&&dto.getOldRecordNumber().equals(dto.getRecordNo())){
|
|
|
|
- if(StringUtils.isNotEmpty(dto.getRecordAutoNumber())){
|
|
|
|
- trialNumberRuleService.checkSave(dto.getContractId(),4,record.getId(),dto.getRecordAutoNumber());
|
|
|
|
- }
|
|
|
|
|
|
+ if (dto.getOldRecordNumber() != null && dto.getOldRecordNumber().equals(dto.getRecordNo())) {
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getRecordAutoNumber())) {
|
|
|
|
+ trialNumberRuleService.checkSave(dto.getContractId(), 4, record.getId(), dto.getRecordAutoNumber());
|
|
}
|
|
}
|
|
- if(dto.getOldReportNumber()!=null&&dto.getOldReportNumber().equals(dto.getReportNo())){
|
|
|
|
- if(StringUtils.isNotEmpty(dto.getReportAutoNumber())){
|
|
|
|
- trialNumberRuleService.checkSave(dto.getContractId(),5,record.getId(),dto.getReportAutoNumber());
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ if (dto.getOldReportNumber() != null && dto.getOldReportNumber().equals(dto.getReportNo())) {
|
|
|
|
+ if (StringUtils.isNotEmpty(dto.getReportAutoNumber())) {
|
|
|
|
+ trialNumberRuleService.checkSave(dto.getContractId(), 5, record.getId(), dto.getReportAutoNumber());
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
return record.getId();
|
|
return record.getId();
|
|
}
|
|
}
|