From f55d6c3c4f13e1564899d3c88cbe698537aefcf9 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 18 六月 2024 10:21:42 +0800
Subject: [PATCH] sssssssssss
---
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java | 41 ++++++++++++++++++++++++++++++-----------
1 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
index 07d3cf7..0fb0948 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -71,7 +71,11 @@
)>Constants.ZERO){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"淇濋櫓鏂规鍚嶇О宸插瓨鍦�");
}
-
+ solutions.setCanAdd(Constants.formatIntegerNum(solutions.getCanAdd()));
+ solutions.setCanReduce(Constants.formatIntegerNum(solutions.getCanReduce()));
+ solutions.setCanChangeUnit(Constants.formatIntegerNum(solutions.getCanChangeUnit()));
+ solutions.setAddValidDays(Constants.formatIntegerNum(solutions.getAddValidDays()));
+ solutions.setDelValidDays(Constants.formatIntegerNum(solutions.getDelValidDays()));
solutions.setIsdeleted(Constants.ZERO);
solutions.setCreator(user.getId());
solutions.setCreateDate(new Date());
@@ -373,8 +377,9 @@
QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
if(Constants.equalsObject(user.getType(),Constants.TWO)){
//濡傛灉鏄垹闄�
-
- wrapper.lambda().exists("select c.id from company_solution c left join solutions d on c.solution_id=d.id where c.isdeleted=0 and d.base_id=solutions.base_id and c.shop_id="+user.getCompanyId());//璁剧疆鏃犳晥璁块棶
+// wrapper.lambda().exists("select c.id from company_solution c left join solutions d on c.solution_id=d.id where c.isdeleted=0 and d.base_id=solutions.base_id and c.shop_id="+user.getCompanyId());//璁剧疆鏃犳晥璁块棶
+ wrapper.apply("((solutions.type=0 and exists(select cs.id from company_solution cs left join solutions s on cs.solution_id=s.id where cs.isdeleted=0 and s.base_id=solutions.base_id and cs.shop_id="+user.getCompanyId()+")) or (" +
+ "solutions.type=1 and solutions.shop_id="+user.getCompanyId()+"))") ;
}
return solutionsMapper.selectList(wrapper);
}
@@ -483,13 +488,14 @@
if (pageWrap.getModel().getBaseId() != null) {
queryWrapper.eq(Solutions::getBaseId, pageWrap.getModel().getBaseId());
}
- for(PageWrap.SortData sortData: pageWrap.getSorts()) {
- if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
- queryWrapper.orderByDesc(sortData.getProperty());
- } else {
- queryWrapper.orderByAsc(sortData.getProperty());
- }
- }
+ queryWrapper.orderByDesc(Solutions::getCreateDate);
+// for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+// if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+// queryWrapper.orderByDesc(sortData.getProperty());
+// } else {
+// queryWrapper.orderByAsc(sortData.getProperty());
+// }
+// }
PageData<Solutions> pageData = PageData.from(solutionsJoinMapper.selectJoinPage(page,Solutions.class, queryWrapper));
return pageData;
@@ -541,7 +547,7 @@
.eq(Company::getStatus,Constants.ZERO)
.eq(Insurance::getIsdeleted,Constants.ZERO)
.eq(Insurance::getStatus,Constants.ZERO)
- .orderByAsc(Solutions::getSortnum)
+ .orderByDesc(Solutions::getCreateDate)
);
return solutionsList;
}
@@ -580,5 +586,18 @@
}
+ @Override
+ public BigDecimal testSolutionAddMoney(Integer id, BigDecimal fee, Date start,Date end,Date newDate,Date newEndTime){
+ return Constants.addFee(solutionsMapper.selectById(id),fee,start,end,newDate,newEndTime);
+ }
+ @Override
+ public BigDecimal testSolutionReduceMoney(Integer id, BigDecimal fee, Date start,Date end,Date reduceStartTime,Date reduceEndTime){
+ return Constants.reduceFee(solutionsMapper.selectById(id),fee,start,end,reduceStartTime,reduceEndTime);
+ }
+
+ @Override
+ public BigDecimal testSolutionProduceMoney(Integer id, BigDecimal fee, Date start,Date end,Date produceStart){
+ return Constants.produceFee(solutionsMapper.selectById(id),fee,start,end,produceStart);
+ }
}
--
Gitblit v1.9.3