Commit 72f1b511 by 邓实川

企业套餐剩余数量bug修复

parent 6bf8ef69
......@@ -11,6 +11,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.transaction.Transactional;
......@@ -78,30 +79,21 @@ public class QyzxBusinessController {
.selectList(new LambdaQueryWrapper<QyzxRemainingQuantity>().eq(QyzxRemainingQuantity::getIsDelete, 0)
.eq(QyzxRemainingQuantity::getOrgCode, userBean.getOrgCode())
.eq(QyzxRemainingQuantity::getPmid, 1).select(QyzxRemainingQuantity::getRemainder));
Integer remainder1 = null;
for (QyzxRemainingQuantity qyzxRemainingQuantity : qyzxRemainingQuantitys1) {
remainder1 = qyzxRemainingQuantity.getRemainder();
if (qyzxRemainingQuantitys1.size() > 1) {
remainder1 += remainder1;
}
}
Integer sum1 = qyzxRemainingQuantitys1.stream()
.collect(Collectors.summingInt(QyzxRemainingQuantity::getRemainder));
List<QyzxRemainingQuantity> qyzxRemainingQuantitys2 = QyzxRemainingQuantity.builder().build()
.selectList(new LambdaQueryWrapper<QyzxRemainingQuantity>().eq(QyzxRemainingQuantity::getIsDelete, 0)
.eq(QyzxRemainingQuantity::getOrgCode, userBean.getOrgCode())
.eq(QyzxRemainingQuantity::getPmid, 2).select(QyzxRemainingQuantity::getRemainder));
Integer remainder2 = null;
for (QyzxRemainingQuantity qyzxRemainingQuantity : qyzxRemainingQuantitys2) {
remainder2 = qyzxRemainingQuantity.getRemainder();
if (qyzxRemainingQuantitys2.size() > 1) {
remainder2 += remainder2;
}
}
Integer sum2 = qyzxRemainingQuantitys2.stream()
.collect(Collectors.summingInt(QyzxRemainingQuantity::getRemainder));
Map<String, Object> map1 = new HashMap<String, Object>();
map1.put("message", remainder1);
map1.put("message", sum1);
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.add(map1);
......@@ -114,8 +106,9 @@ public class QyzxBusinessController {
public Result<List<QyzxPayContent>> getPayListwithContract(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 1).select(
QyzxPayContent::getContent, QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice,
QyzxPayContent::getSpecification, QyzxPayContent::getExpiration));
QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice,
QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification,
QyzxPayContent::getExpiration));
return ResultUtil.data(list, "获取成功");
}
......@@ -124,8 +117,9 @@ public class QyzxBusinessController {
public Result<List<QyzxPayContent>> getPayListWithMsg(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 2).select(
QyzxPayContent::getContent, QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice,
QyzxPayContent::getSpecification, QyzxPayContent::getExpiration));
QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice,
QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification,
QyzxPayContent::getExpiration));
return ResultUtil.data(list, "获取成功");
}
......@@ -134,8 +128,9 @@ public class QyzxBusinessController {
public Result<List<QyzxPayContent>> getPayListWithSystem(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3).select(
QyzxPayContent::getContent, QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice,
QyzxPayContent::getSpecification, QyzxPayContent::getExpiration));
QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice,
QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification,
QyzxPayContent::getExpiration));
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