From 253672d6c5b7725b3ba8859cfd5768e2c95a887e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 17 五月 2024 16:55:53 +0800
Subject: [PATCH] 提交一把
---
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 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 4228f5b..84e20a6 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());
@@ -234,8 +238,9 @@
.lambda()
.eq(SolutionWorktype::getSolutionId,solutions.getId())
);
- if(Constants.equalsObject(solutions.getType(),Constants.ONE) ){
+ if(Constants.equalsObject(model.getType(),Constants.ONE) ){
if (solutions.getFanganFile()!=null && StringUtils.isNotBlank(solutions.getFanganFile().getFileurl())){
+
multifileMapper.update(null,new UpdateWrapper<Multifile>().lambda()
.set(Multifile::getIsdeleted,Constants.ONE)
.set(Multifile::getEditDate,solutions.getEditDate())
@@ -243,6 +248,7 @@
.eq(Multifile::getObjId,solutions.getId())
.eq(Multifile::getIsdeleted,Constants.ZERO)
.eq(Multifile::getObjType,Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey()));
+
Multifile file = solutions.getFanganFile();
file.setIsdeleted(Constants.ZERO);
file.setCreateDate(solutions.getEditDate());
@@ -368,12 +374,13 @@
if(solutions.getDataType() == null){
solutions.setDataType(Constants.TWO);
}
+ QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
if(Constants.equalsObject(user.getType(),Constants.TWO)){
//濡傛灉鏄垹闄�
- solutions.setShopId(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()+"))") ;
}
- QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
-
return solutionsMapper.selectList(wrapper);
}
--
Gitblit v1.9.3