|
@@ -130,12 +130,13 @@ public class JsDistributionServiceImpl extends ServiceImpl<JsDistributionMapper,
|
|
|
@Override
|
|
|
public PaginationUtil.PageResult<JsProduction> productionPage(Integer pageNum, Integer pageSize, String startTime, String endTime, String animalCertNo) {
|
|
|
QueryWrapper<JsDistribution> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq(StringUtils.isNotEmpty(animalCertNo), "animal_cert_no", animalCertNo).groupBy("purchaser_name");
|
|
|
+ queryWrapper.eq(StringUtils.isNotEmpty(animalCertNo), "animal_cert_no", animalCertNo).groupBy("supplier_name,purchaser_name");
|
|
|
if ("".equals(startTime) || null == startTime) {
|
|
|
|
|
|
} else {
|
|
|
queryWrapper.between("distribution_time", startTime + " 00:00:00", endTime + " 23:59:59");
|
|
|
}
|
|
|
+ queryWrapper.orderByDesc("distribution_time");
|
|
|
List<JsDistribution> jsDistributions = distributionMapper.selectList(queryWrapper);
|
|
|
List<JsProduction> productions = new ArrayList<>();
|
|
|
for (JsDistribution jsDistribution : jsDistributions) {
|
|
@@ -161,9 +162,9 @@ public class JsDistributionServiceImpl extends ServiceImpl<JsDistributionMapper,
|
|
|
}
|
|
|
List<ProductionVo> list = new ArrayList<>();
|
|
|
if ("".equals(startTime) || null == startTime) {
|
|
|
- list = distributionMapper.getAllList(jsDistribution.getPurchaserName(), null, null);
|
|
|
+ list = distributionMapper.getAllList1(jsDistribution.getPurchaserName(), null, null,jsDistribution.getSupplierName());
|
|
|
} else {
|
|
|
- list = distributionMapper.getAllList(jsDistribution.getPurchaserName(), startTime + " 00:00:00", endTime + " 23:59:59");
|
|
|
+ list = distributionMapper.getAllList1(jsDistribution.getPurchaserName(), startTime + " 00:00:00", endTime + " 23:59:59",jsDistribution.getSupplierName());
|
|
|
}
|
|
|
jsProduction.setProductionVos(list);
|
|
|
productions.add(jsProduction);
|
|
@@ -173,13 +174,19 @@ public class JsDistributionServiceImpl extends ServiceImpl<JsDistributionMapper,
|
|
|
|
|
|
@Override
|
|
|
public AjaxResult editProduce(JsProduceCode jsProduceCode) {
|
|
|
- String oneCode = jsProduceCode.getOneCode();
|
|
|
QueryWrapper<JsProduceCode> queryWrapper1 = new QueryWrapper<>();
|
|
|
- queryWrapper1.eq("one_code", oneCode);
|
|
|
- JsProduceCode jsProduceCode1 = produceCodeMapper.selectOne(queryWrapper1);
|
|
|
- jsProduceCode1.setAnimalCert(jsProduceCode.getAnimalCert());
|
|
|
- jsProduceCode1.setMeatCert(jsProduceCode.getMeatCert());
|
|
|
- produceCodeMapper.updateById(jsProduceCode1);
|
|
|
+ queryWrapper1.eq("purchaser_name",jsProduceCode.getPurchaserName()).eq("supplier_name",jsProduceCode.getSupplierName());
|
|
|
+ List<JsProduceCode> jsProduceCodes = produceCodeMapper.selectList(queryWrapper1);
|
|
|
+ for (JsProduceCode produceCode : jsProduceCodes) {
|
|
|
+ if ("".equals(produceCode.getAnimalCert()) || null == produceCode.getAnimalCert()) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ produceCode.setAnimalCert(jsProduceCode.getAnimalCert());
|
|
|
+ produceCode.setMeatCert(jsProduceCode.getMeatCert());
|
|
|
+ produceCodeMapper.updateById(produceCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
return success();
|
|
|
}
|
|
|
}
|