|
@@ -8,7 +8,6 @@ import com.ruoyi.app.domain.EntranceBatch;
|
|
import com.ruoyi.app.domain.HarmlessTreatment;
|
|
import com.ruoyi.app.domain.HarmlessTreatment;
|
|
import com.ruoyi.app.domain.Purchaser;
|
|
import com.ruoyi.app.domain.Purchaser;
|
|
import com.ruoyi.app.domain.Supplier;
|
|
import com.ruoyi.app.domain.Supplier;
|
|
-import com.ruoyi.app.domain.response.DrugCheckParam;
|
|
|
|
import com.ruoyi.app.mapper.*;
|
|
import com.ruoyi.app.mapper.*;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
@@ -20,17 +19,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.ruoyi.web.v2.v1.utils.PaginationUtil;
|
|
import com.ruoyi.web.v2.v1.utils.PaginationUtil;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
-import java.time.LocalDateTime;
|
|
|
|
|
|
+import java.time.ZoneId;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ruoyi.common.core.domain.AjaxResult.error;
|
|
import static com.ruoyi.common.core.domain.AjaxResult.error;
|
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
-import static com.ruoyi.common.utils.PageUtils.startPage;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -64,6 +61,7 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
@Autowired
|
|
@Autowired
|
|
private JsProduceCodeMapper produceCodeMapper;
|
|
private JsProduceCodeMapper produceCodeMapper;
|
|
|
|
|
|
|
|
+ @Transactional
|
|
@Override
|
|
@Override
|
|
public AjaxResult add(JsDrugCheck drugCheck) {
|
|
public AjaxResult add(JsDrugCheck drugCheck) {
|
|
EntranceBatch entranceBatch = entranceBatchMapper.selectEntranceBatchById(drugCheck.getEntranceBatchId().longValue());
|
|
EntranceBatch entranceBatch = entranceBatchMapper.selectEntranceBatchById(drugCheck.getEntranceBatchId().longValue());
|
|
@@ -80,6 +78,9 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
queryWrapper1.select(" IFNULL(sum(deal_amount),'0') dealAmount");
|
|
queryWrapper1.select(" IFNULL(sum(deal_amount),'0') dealAmount");
|
|
JsRestInspection restInspection = restInspectionMapper.selectOne(queryWrapper1);//静养病死病害数量
|
|
JsRestInspection restInspection = restInspectionMapper.selectOne(queryWrapper1);//静养病死病害数量
|
|
dealAmount = restInspection.getDealAmount();
|
|
dealAmount = restInspection.getDealAmount();
|
|
|
|
+ //新增加批次序列号字段,多个批次序列号使用逗号分割
|
|
|
|
+ drugCheck.setSeriesNoGroup(circles.stream().map(JsDivideCircle::getSeriesNo)
|
|
|
|
+ .collect(Collectors.joining(",")));
|
|
}
|
|
}
|
|
int amount = entranceBatch.getAmount() - dealAmount -
|
|
int amount = entranceBatch.getAmount() - dealAmount -
|
|
harmlessTreatment.getIllnessDeadAmount() - harmlessTreatment.getIllnessDiseaseAmount()
|
|
harmlessTreatment.getIllnessDeadAmount() - harmlessTreatment.getIllnessDiseaseAmount()
|
|
@@ -91,6 +92,7 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
return success();
|
|
return success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional
|
|
@Override
|
|
@Override
|
|
public AjaxResult edit(JsDrugCheck drugCheck) {
|
|
public AjaxResult edit(JsDrugCheck drugCheck) {
|
|
EntranceBatch entranceBatch = entranceBatchMapper.selectEntranceBatchById(drugCheck.getEntranceBatchId().longValue());
|
|
EntranceBatch entranceBatch = entranceBatchMapper.selectEntranceBatchById(drugCheck.getEntranceBatchId().longValue());
|
|
@@ -214,7 +216,7 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
|
|
|
|
drugAndProduce.setWeight(weight.toString());
|
|
drugAndProduce.setWeight(weight.toString());
|
|
drugAndProduce.setQualifiedAmountAfter((amount*2-number)/2.0);
|
|
drugAndProduce.setQualifiedAmountAfter((amount*2-number)/2.0);
|
|
- drugAndProduce.setCreateTime(entranceBatch.getEntranceTime());
|
|
|
|
|
|
+ drugAndProduce.setCreateTime(Date.from(entranceBatch.getEntranceTime().atZone(ZoneId.systemDefault()).toInstant()));
|
|
drugAndProduces.add(drugAndProduce);
|
|
drugAndProduces.add(drugAndProduce);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -237,7 +239,7 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
harmlessVo.setId(id);
|
|
harmlessVo.setId(id);
|
|
Supplier supplier = supplierMapper.selectSupplierById(entranceBatch.getSupplierId());
|
|
Supplier supplier = supplierMapper.selectSupplierById(entranceBatch.getSupplierId());
|
|
harmlessVo.setCargoOwner(supplier.getSupplierName());
|
|
harmlessVo.setCargoOwner(supplier.getSupplierName());
|
|
- harmlessVo.setCreateTime(entranceBatch.getEntranceTime());
|
|
|
|
|
|
+ harmlessVo.setCreateTime(Date.from(entranceBatch.getEntranceTime().atZone(ZoneId.systemDefault()).toInstant()));
|
|
HarmlessTreatment harmlessTreatment = harmlessTreatmentMapper.selectByEntraceBatchId(entranceBatch.getId());
|
|
HarmlessTreatment harmlessTreatment = harmlessTreatmentMapper.selectByEntraceBatchId(entranceBatch.getId());
|
|
if (ObjectUtil.isNotEmpty(harmlessTreatment)) {
|
|
if (ObjectUtil.isNotEmpty(harmlessTreatment)) {
|
|
harmlessVo.setDealReason(harmlessTreatment.getDealReason());
|
|
harmlessVo.setDealReason(harmlessTreatment.getDealReason());
|
|
@@ -275,7 +277,7 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
if (entranceBatchList.size() != 0) {
|
|
if (entranceBatchList.size() != 0) {
|
|
for (EntranceBatch entranceBatch : entranceBatchList) {
|
|
for (EntranceBatch entranceBatch : entranceBatchList) {
|
|
AdmissionVo admissionVo = new AdmissionVo();
|
|
AdmissionVo admissionVo = new AdmissionVo();
|
|
- admissionVo.setCreateTime(entranceBatch.getEntranceTime());
|
|
|
|
|
|
+ admissionVo.setCreateTime(Date.from(entranceBatch.getEntranceTime().atZone(ZoneId.systemDefault()).toInstant()));
|
|
admissionVo.setNum(entranceBatch.getId());
|
|
admissionVo.setNum(entranceBatch.getId());
|
|
Supplier supplier = supplierMapper.selectSupplierById(entranceBatch.getSupplierId());
|
|
Supplier supplier = supplierMapper.selectSupplierById(entranceBatch.getSupplierId());
|
|
admissionVo.setCargoOwner(supplier.getSupplierName());
|
|
admissionVo.setCargoOwner(supplier.getSupplierName());
|
|
@@ -390,7 +392,7 @@ public class JsDrugCheckServiceImpl extends ServiceImpl<JsDrugCheckMapper, JsDru
|
|
if (entranceBatchList.size() != 0) {
|
|
if (entranceBatchList.size() != 0) {
|
|
for (EntranceBatch entranceBatch : entranceBatchList) {
|
|
for (EntranceBatch entranceBatch : entranceBatchList) {
|
|
SummaryVo summaryVo = new SummaryVo();
|
|
SummaryVo summaryVo = new SummaryVo();
|
|
- summaryVo.setCreateTime(entranceBatch.getEntranceTime());
|
|
|
|
|
|
+ summaryVo.setCreateTime(Date.from(entranceBatch.getEntranceTime().atZone(ZoneId.systemDefault()).toInstant()));
|
|
summaryVo.setAmount(entranceBatch.getAmount());
|
|
summaryVo.setAmount(entranceBatch.getAmount());
|
|
QueryWrapper<JsDrugCheck> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<JsDrugCheck> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("entrance_batch_id", entranceBatch.getId());
|
|
queryWrapper.eq("entrance_batch_id", entranceBatch.getId());
|