Commit 72f1b511 by 邓实川

企业套餐剩余数量bug修复

parent 6bf8ef69
...@@ -11,6 +11,7 @@ import java.util.ArrayList; ...@@ -11,6 +11,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import javax.transaction.Transactional; import javax.transaction.Transactional;
...@@ -78,30 +79,21 @@ public class QyzxBusinessController { ...@@ -78,30 +79,21 @@ public class QyzxBusinessController {
.selectList(new LambdaQueryWrapper<QyzxRemainingQuantity>().eq(QyzxRemainingQuantity::getIsDelete, 0) .selectList(new LambdaQueryWrapper<QyzxRemainingQuantity>().eq(QyzxRemainingQuantity::getIsDelete, 0)
.eq(QyzxRemainingQuantity::getOrgCode, userBean.getOrgCode()) .eq(QyzxRemainingQuantity::getOrgCode, userBean.getOrgCode())
.eq(QyzxRemainingQuantity::getPmid, 1).select(QyzxRemainingQuantity::getRemainder)); .eq(QyzxRemainingQuantity::getPmid, 1).select(QyzxRemainingQuantity::getRemainder));
Integer remainder1 = null; Integer sum1 = qyzxRemainingQuantitys1.stream()
for (QyzxRemainingQuantity qyzxRemainingQuantity : qyzxRemainingQuantitys1) { .collect(Collectors.summingInt(QyzxRemainingQuantity::getRemainder));
remainder1 = qyzxRemainingQuantity.getRemainder();
if (qyzxRemainingQuantitys1.size() > 1) {
remainder1 += remainder1;
}
}
List<QyzxRemainingQuantity> qyzxRemainingQuantitys2 = QyzxRemainingQuantity.builder().build() List<QyzxRemainingQuantity> qyzxRemainingQuantitys2 = QyzxRemainingQuantity.builder().build()
.selectList(new LambdaQueryWrapper<QyzxRemainingQuantity>().eq(QyzxRemainingQuantity::getIsDelete, 0) .selectList(new LambdaQueryWrapper<QyzxRemainingQuantity>().eq(QyzxRemainingQuantity::getIsDelete, 0)
.eq(QyzxRemainingQuantity::getOrgCode, userBean.getOrgCode()) .eq(QyzxRemainingQuantity::getOrgCode, userBean.getOrgCode())
.eq(QyzxRemainingQuantity::getPmid, 2).select(QyzxRemainingQuantity::getRemainder)); .eq(QyzxRemainingQuantity::getPmid, 2).select(QyzxRemainingQuantity::getRemainder));
Integer remainder2 = null; Integer sum2 = qyzxRemainingQuantitys2.stream()
for (QyzxRemainingQuantity qyzxRemainingQuantity : qyzxRemainingQuantitys2) { .collect(Collectors.summingInt(QyzxRemainingQuantity::getRemainder));
remainder2 = qyzxRemainingQuantity.getRemainder();
if (qyzxRemainingQuantitys2.size() > 1) {
remainder2 += remainder2;
}
}
Map<String, Object> map1 = new HashMap<String, Object>(); Map<String, Object> map1 = new HashMap<String, Object>();
map1.put("message", remainder1); map1.put("message", sum1);
Map<String, Object> map2 = new HashMap<String, Object>(); Map<String, Object> map2 = new HashMap<String, Object>();
map2.put("contract", remainder2); map2.put("contract", sum2);
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
list.add(map1); list.add(map1);
...@@ -114,8 +106,9 @@ public class QyzxBusinessController { ...@@ -114,8 +106,9 @@ public class QyzxBusinessController {
public Result<List<QyzxPayContent>> getPayListwithContract(@CurrentUser UserBean userBean) { public Result<List<QyzxPayContent>> getPayListwithContract(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build() List<QyzxPayContent> list = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 1).select( .selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 1).select(
QyzxPayContent::getContent, QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice, QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice,
QyzxPayContent::getSpecification, QyzxPayContent::getExpiration)); QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification,
QyzxPayContent::getExpiration));
return ResultUtil.data(list, "获取成功"); return ResultUtil.data(list, "获取成功");
} }
...@@ -124,8 +117,9 @@ public class QyzxBusinessController { ...@@ -124,8 +117,9 @@ public class QyzxBusinessController {
public Result<List<QyzxPayContent>> getPayListWithMsg(@CurrentUser UserBean userBean) { public Result<List<QyzxPayContent>> getPayListWithMsg(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build() List<QyzxPayContent> list = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 2).select( .selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 2).select(
QyzxPayContent::getContent, QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice, QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice,
QyzxPayContent::getSpecification, QyzxPayContent::getExpiration)); QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification,
QyzxPayContent::getExpiration));
return ResultUtil.data(list, "获取成功"); return ResultUtil.data(list, "获取成功");
} }
...@@ -134,8 +128,9 @@ public class QyzxBusinessController { ...@@ -134,8 +128,9 @@ public class QyzxBusinessController {
public Result<List<QyzxPayContent>> getPayListWithSystem(@CurrentUser UserBean userBean) { public Result<List<QyzxPayContent>> getPayListWithSystem(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build() List<QyzxPayContent> list = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3).select( .selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3).select(
QyzxPayContent::getContent, QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice, QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice,
QyzxPayContent::getSpecification, QyzxPayContent::getExpiration)); QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification,
QyzxPayContent::getExpiration));
return ResultUtil.data(list, "获取成功"); return ResultUtil.data(list, "获取成功");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment