From a9ca0823ab8f33ca85abebcf6ec4a8da235adb49 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 30 一月 2024 14:36:49 +0800
Subject: [PATCH] 开发业务接口

---
 server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 45 insertions(+), 1 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 d46df3d..ce9af65 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
@@ -14,6 +14,7 @@
 import com.doumee.dao.business.join.SolutionWorktypeJoinMapper;
 import com.doumee.dao.business.join.SolutionsJoinMapper;
 import com.doumee.dao.business.model.*;
+import com.doumee.service.business.CompanyService;
 import com.doumee.service.business.SolutionsService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -185,6 +186,7 @@
         );
         solutionsMapper.update(null,new UpdateWrapper<Solutions>()
                 .lambda()
+                .ne(Solutions::getId,newModel.getId())
                 .eq(Solutions::getBaseId,solutions.getId())
                 .eq(Solutions::getDataType,Constants.TWO)
                 .set(Solutions::getDataType,Constants.ONE)
@@ -259,7 +261,9 @@
     @Override
     public List<Solutions> findList(Solutions solutions) {
         solutions.setIsdeleted(Constants.ZERO);
-        solutions.setDataType(Constants.TWO);
+        if(solutions.getDataType() == null){
+            solutions.setDataType(Constants.TWO);
+        }
         QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);
         return solutionsMapper.selectList(wrapper);
     }
@@ -373,6 +377,7 @@
             }
         }
         PageData<Solutions> pageData = PageData.from(solutionsJoinMapper.selectJoinPage(page,Solutions.class, queryWrapper));
+
         return pageData;
     }
     @Override
@@ -404,6 +409,45 @@
         return PageData.from(solutionsMapper.selectPage(page, queryWrapper));
     }
 
+
+    @Override
+    public List<Solutions> findListForCompany() {
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+        List<Solutions> solutionsList = solutionsJoinMapper.selectJoinList(Solutions.class,new MPJLambdaWrapper<Solutions>()
+                        .selectAll(Solutions.class)
+                .leftJoin(CompanySolution.class,CompanySolution::getSolutionBaseId,Solutions::getId)
+                .eq(Solutions::getIsdeleted,Constants.ZERO)
+                .eq(Solutions::getDataType,Constants.TWO)
+                .eq(CompanySolution::getIsdeleted,Constants.ZERO)
+                .eq(CompanySolution::getCompanyId,user.getCompanyId())
+                .orderByAsc(Solutions::getSortnum)
+        );
+
+//        solutionsList.forEach(i->{
+//            //淇濋櫓鏃堕棿鍗曚綅 涓� 鏈�灏忔姇淇濆懆鏈熸椂闂村崟浣� 瑙勫垯鐩稿悓 鎴栬�� 鏈�灏忔姇淇濆懆鏈熸椂闂村崟浣� 瑙勫垯涓� 澶╂椂 榛樿閲戦
+//            if(i.getTimeUnit().equals(i.getInsureCycleUnit())||i.getInsureCycleUnit().equals(Constants.ZERO)){
+//                i.setCyclePrice(i.getPrice());
+//            }else{
+//                if(i.getInsureCycleUnit().equals(Constants.ONE)){
+//                    //鏈�灏忔姇淇濆懆鏈熸椂闂村崟浣嶄负鍗婃湀
+//                    i.setCyclePrice(i.getPrice().multiply(new BigDecimal(15)));
+//                }else if(i.getInsureCycleUnit().equals(Constants.TWO)){
+//                    //鏈�灏忔姇淇濆懆鏈熸椂闂村崟浣嶄负鏈� 鍒欒绠楀綋鏈堝灏戝ぉ
+//                    if( ){
+//
+//                    }
+//                }
+//            }
+//        });
+        return solutionsList;
+    }
+
+
+
+
+
+
+
     @Override
     public long count(Solutions solutions) {
         QueryWrapper<Solutions> wrapper = new QueryWrapper<>(solutions);

--
Gitblit v1.9.3