|
|
@ -5,7 +5,6 @@ import cn.hutool.core.io.IoUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.deepoove.poi.XWPFTemplate; |
|
|
|
import com.deepoove.poi.XWPFTemplate; |
|
|
@ -13,6 +12,7 @@ import com.deepoove.poi.config.Configure; |
|
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; |
|
|
|
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
import digital.laboratory.platform.common.feign.RemoteWord2PDFService; |
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
import digital.laboratory.platform.common.oss.service.OssFile; |
|
|
|
|
|
|
|
import digital.laboratory.platform.reagent.dto.BalanceWeighingDTO; |
|
|
|
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO; |
|
|
|
import digital.laboratory.platform.reagent.dto.StandardMaterialApplicationDTO; |
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
import digital.laboratory.platform.reagent.entity.*; |
|
|
|
import digital.laboratory.platform.reagent.mapper.StandardMaterialApplicationMapper; |
|
|
|
import digital.laboratory.platform.reagent.mapper.StandardMaterialApplicationMapper; |
|
|
@ -24,11 +24,9 @@ import feign.Response; |
|
|
|
import io.seata.spring.annotation.GlobalTransactional; |
|
|
|
import io.seata.spring.annotation.GlobalTransactional; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
import org.apache.commons.io.output.ByteArrayOutputStream; |
|
|
|
import org.apache.ibatis.annotations.Param; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.mock.web.MockMultipartFile; |
|
|
|
import org.springframework.mock.web.MockMultipartFile; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
@ -97,6 +95,7 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard |
|
|
|
referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation()); |
|
|
|
referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation()); |
|
|
|
referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation()); |
|
|
|
referenceMaterial.setLocation(standardMaterialApplicationDTO.getLocation()); |
|
|
|
referenceMaterial.setBoxId(standardMaterialApplicationDTO.getBoxId()); |
|
|
|
referenceMaterial.setBoxId(standardMaterialApplicationDTO.getBoxId()); |
|
|
|
|
|
|
|
referenceMaterial.setMass(referenceMaterial.getMass() - standardMaterialApplicationDTO.getPurposeAndQuantity()); |
|
|
|
//若无需归还,则证明标准物质/标准储备溶液已经使用完毕,删除记录即可
|
|
|
|
//若无需归还,则证明标准物质/标准储备溶液已经使用完毕,删除记录即可
|
|
|
|
if (standardMaterialApplicationDTO.getOutOfUse()) { |
|
|
|
if (standardMaterialApplicationDTO.getOutOfUse()) { |
|
|
|
|
|
|
|
|
|
|
@ -142,7 +141,7 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard |
|
|
|
SolutionUseForm one = solutionUseFormService.getOne(solutionUseFormLambdaQueryWrapper); |
|
|
|
SolutionUseForm one = solutionUseFormService.getOne(solutionUseFormLambdaQueryWrapper); |
|
|
|
//如果是标准储备溶液,则需补充完善标准储备溶液使用记录表的使用数量
|
|
|
|
//如果是标准储备溶液,则需补充完善标准储备溶液使用记录表的使用数量
|
|
|
|
if (one != null) { |
|
|
|
if (one != null) { |
|
|
|
one.setQuantityUsed(byId.getPurposeAndQuantity()); |
|
|
|
one.setQuantityUsed(byId.getPurposeAndQuantity().toString()); |
|
|
|
solutionUseFormService.updateById(one); |
|
|
|
solutionUseFormService.updateById(one); |
|
|
|
} |
|
|
|
} |
|
|
|
//
|
|
|
|
//
|
|
|
@ -210,10 +209,10 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard |
|
|
|
standardMaterialApplicationVO.setDateOfReturns(LocalDateTimeUtil.format(standardMaterialApplicationVO.getDateOfReturn(), "yyyy年MM月dd日")); |
|
|
|
standardMaterialApplicationVO.setDateOfReturns(LocalDateTimeUtil.format(standardMaterialApplicationVO.getDateOfReturn(), "yyyy年MM月dd日")); |
|
|
|
standardMaterialApplicationVO.setIndex(x.toString()); |
|
|
|
standardMaterialApplicationVO.setIndex(x.toString()); |
|
|
|
if (standardMaterialApplicationVO.getPurpose() == 0) { |
|
|
|
if (standardMaterialApplicationVO.getPurpose() == 0) { |
|
|
|
standardMaterialApplicationVO.setPurposeAndQuantity("案件," + standardMaterialApplicationVO.getPurposeAndQuantity()); |
|
|
|
standardMaterialApplicationVO.setPrintPurposeAndQuantity("案件," + standardMaterialApplicationVO.getPurposeAndQuantity()); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
standardMaterialApplicationVO.setPurposeAndQuantity("科研," + standardMaterialApplicationVO.getPurposeAndQuantity()); |
|
|
|
standardMaterialApplicationVO.setPrintPurposeAndQuantity("其他," + standardMaterialApplicationVO.getPurposeAndQuantity()); |
|
|
|
} |
|
|
|
} |
|
|
|
x++; |
|
|
|
x++; |
|
|
|
} |
|
|
|
} |
|
|
@ -293,6 +292,29 @@ public class StandardMaterialApplicationServiceImpl extends ServiceImpl<Standard |
|
|
|
return standardMaterialApplicationVO; |
|
|
|
return standardMaterialApplicationVO; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 天平称量
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
@GlobalTransactional |
|
|
|
|
|
|
|
public boolean getWeighingMass(List<BalanceWeighingDTO> balanceWeighingDTOList) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String referenceMaterialId = balanceWeighingDTOList.get(0).getReferenceMaterialId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<StandardMaterialApplication> standardMaterialApplications = this.list(Wrappers.<StandardMaterialApplication>query().eq("reference_material_id", referenceMaterialId).orderByDesc("create_time")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (standardMaterialApplications == null && standardMaterialApplications.size() == 0) { |
|
|
|
|
|
|
|
throw new RuntimeException(String.format("未查询到该标准物质的领用登记表!")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
StandardMaterialApplication standardMaterialApplication = standardMaterialApplications.get(0); |
|
|
|
|
|
|
|
//依次记录称量结果
|
|
|
|
|
|
|
|
for (BalanceWeighingDTO balanceWeighingDTO : balanceWeighingDTOList) { |
|
|
|
|
|
|
|
if (standardMaterialApplication.getPurposeAndQuantity() == 0) { |
|
|
|
|
|
|
|
standardMaterialApplication.setPurposeAndQuantity(balanceWeighingDTO.getWeighingMass().doubleValue()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
standardMaterialApplication.setPurposeAndQuantity(standardMaterialApplication.getPurposeAndQuantity() + balanceWeighingDTO.getWeighingMass().doubleValue()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this.updateById(standardMaterialApplication); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|