Browse Source

fix数据源切换、项目成本预算

LLL 1 year ago
parent
commit
6afc2073fb
21 changed files with 116 additions and 141 deletions
  1. 3 3
      jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  2. 28 46
      module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/aspect/TargetDataSourceAspect.java
  3. 3 0
      module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/config/DataSourceConfig.java
  4. 4 0
      module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/enums/DataSourceType.java
  5. 0 43
      module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/manage/DataSourceManagement.java
  6. 0 2
      module_kzks/src/main/java/org/jeecg/modules/kyBgInfo/mapper/KyBgInfoMapper.java
  7. 1 6
      module_kzks/src/main/java/org/jeecg/modules/kyTaskInfo/mapper/KyTaskInfoMapper.java
  8. 3 5
      module_kzks/src/main/java/org/jeecg/modules/mesInfo/mapper/MesInfoMapper.java
  9. 1 6
      module_kzks/src/main/java/org/jeecg/modules/mesInfoInstallationcost/mapper/MesInfoInstallationcostMapper.java
  10. 1 4
      module_kzks/src/main/java/org/jeecg/modules/mesInfoInstallationcost/service/IMesInfoInstallationcostService.java
  11. 3 0
      module_kzks/src/main/java/org/jeecg/modules/mesInfoInstallationcost/service/impl/MesInfoInstallationcostServiceImpl.java
  12. 3 7
      module_kzks/src/main/java/org/jeecg/modules/projectCost/mapper/ProjectCostMapper.java
  13. 2 4
      module_kzks/src/main/java/org/jeecg/modules/projectCost/mapper/xml/ProjectCostMapper.xml
  14. 28 3
      module_kzks/src/main/java/org/jeecg/modules/projectCostHuiji/controller/ProjectCostHuijiController.java
  15. 0 2
      module_kzks/src/main/java/org/jeecg/modules/projectCostHuiji/mapper/ProjectCostHuijiMapper.java
  16. 12 0
      module_kzks/src/main/java/org/jeecg/modules/projectCostHuiji/mapper/xml/ProjectCostHuijiMapper.xml
  17. 4 0
      module_kzks/src/main/java/org/jeecg/modules/projectCostYs/mapper/KzksProjectCostYsMapper.java
  18. 3 0
      module_kzks/src/main/java/org/jeecg/modules/projectCostYs/service/IKzksProjectCostYsService.java
  19. 11 0
      module_kzks/src/main/java/org/jeecg/modules/projectCostYs/service/impl/KzksProjectCostYsServiceImpl.java
  20. 3 5
      module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/mapper/WzOutboundOrderBMapper.java
  21. 3 5
      module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/mapper/WzOutboundOrderHMapper.java

+ 3 - 3
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@@ -135,9 +135,9 @@ spring:
           password: itdm-boot@2023
           driver-class-name: com.mysql.cj.jdbc.Driver
         slave:  # 第二个数据源
-          url: jdbc:mysql://152.136.206.27:3306/kezhikeshiceshi?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
-          username: itdm-boot
-          password: itdm-boot@2023
+          url: jdbc:mysql://119.3.168.55:3306/look?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
+          username: root
+          password: 302201
           driver-class-name: com.mysql.cj.jdbc.Driver
 #          username: root
 #          password: 302201

+ 28 - 46
module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/aspect/TargetDataSourceAspect.java

@@ -1,13 +1,12 @@
 package org.jeecg.modules.dataSourceSwitch.aspect;
 
 import lombok.extern.slf4j.Slf4j;
-import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Before;
 import org.aspectj.lang.annotation.Pointcut;
 import org.aspectj.lang.reflect.MethodSignature;
 import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.entity.SwitchDataSource;
 import org.jeecg.modules.dataSourceSwitch.manage.DataSourceManagement;
 import org.jeecg.modules.dataSourceSwitch.service.ISwitchDataSourceService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,38 +26,32 @@ public class TargetDataSourceAspect {
     public void dsPointCut() {
     }
 
-    @Before("dsPointCut()")
-    public void around(JoinPoint point) throws Throwable {
+    @Around("dsPointCut()")
+    public Object around(ProceedingJoinPoint point) throws Throwable {
 
-        DataSourceManagement.flag.set("MASTER");
+        String dataSourceType = DataSourceManagement.getDataSourceType();
+        log.info("原数据源为:"+dataSourceType);
+//        DataSourceManagement.setDataSourceType("MASTER");
         Integer type = switchDataSourceService.getType();
 
         TargetDataSource annotation = null;
-        Class<? extends Object> target = point.getTarget().getClass();
-        if(target.isAnnotationPresent(TargetDataSource.class)){
-            // 判断类上是否标注着注解
-            annotation = target.getAnnotation(TargetDataSource.class);
-            log.info("类上标注了注解");
+        Class<? extends Object> target = point.getTarget().getClass();//获得当前访问的class
 
-            if ("SLAVE".equals(annotation.value().name())){
-                if(type != null && type == 1){
-                    DataSourceManagement.flag.set(annotation.value().name());
-                    log.info("type == 1==========================="+type+annotation.value().name()+"========================");
-                }
+        if(target.isAnnotationPresent(TargetDataSource.class)){ // 判断是否存在@注解
+            annotation = target.getAnnotation(TargetDataSource.class);// 判断类上是否标注着注解
+            log.info("类上标注了注解,type="+type);
+
+            if ("SLAVE".equals(annotation.value().name()) && type != null && type == 1){
+                DataSourceManagement.setDataSourceType(annotation.value().name());
             }
-            log.info(annotation.value().name()+type);
         }else{
-            Method method = ((MethodSignature) point.getSignature()).getMethod();
-            if(method.isAnnotationPresent(TargetDataSource.class)){
-                // 判断方法上是否标注着注解,如果类和方法上都没有标注,则报错
+            Method method = ((MethodSignature) point.getSignature()).getMethod();// 得到访问的方法对象
+            if(method.isAnnotationPresent(TargetDataSource.class)){// 判断方法上是否标注着注解,如果类和方法上都没有标注,则报错
                 annotation = method.getAnnotation(TargetDataSource.class);
-                log.info("方法上标注了注解");
+                log.info("方法上标注了注解,type="+type);
 
-                if ("SLAVE".equals(annotation.value().name())){
-                    if(type != null && type == 1){
-                        DataSourceManagement.flag.set(annotation.value().name());
-                        log.info("type == 1==========================="+type+annotation.value().name()+"========================");
-                    }
+                if ("SLAVE".equals(annotation.value().name()) && type != null && type == 1){
+                    DataSourceManagement.setDataSourceType(annotation.value().name());// 取出注解中的数据源名
                 }
                 log.info(annotation.value().name()+type);
             }else{
@@ -67,27 +60,16 @@ public class TargetDataSourceAspect {
             }
         }
 
+        try
+        {
+            return point.proceed();
+        }
+        finally
+        {
+            // 销毁数据源 在执行方法之后
+            DataSourceManagement.clearDataSourceType();
+        }
 
-
-//        if ("SLAVE".equals(annotation.value().name())){
-//            if(type != null && type == 1){
-//                DataSourceManagement.flag.set(annotation.value().name());
-//                System.out.println("type == 1==========================="+type+annotation.value().name()+"========================");
-//            }
-//        }
-//        System.out.println(annotation.value().name()+type);
-
-//        // 切换数据源 0主数据源,1其他数据源
-//        Integer type = switchDataSourceService.getType();
-////        SwitchDataSource switchDataSource = switchDataSourceService.getById(1);
-////        Integer type = Integer.valueOf(switchDataSource.getType());
-//        if (type != null && type == 0) {
-//            DataSourceManagement.flag.set("MASTER");
-//            System.out.println("type == 0==========================="+type+"MASTER========================");
-//        } else if (type != null && type == 1) {
-//            DataSourceManagement.flag.set(annotation.value().name());
-//            System.out.println("type == 1==========================="+type+annotation.value().name()+"========================");
-//        }
     }
 
 }

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/config/DataSourceConfig.java

@@ -8,6 +8,9 @@ import org.springframework.context.annotation.Configuration;
 
 import javax.sql.DataSource;
 
+/**
+ * 数据源
+ */
 @Configuration
 public class DataSourceConfig {
 

+ 4 - 0
module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/enums/DataSourceType.java

@@ -1,5 +1,9 @@
 package org.jeecg.modules.dataSourceSwitch.enums;
 
+
+/**
+ * 数据源
+ */
 public enum DataSourceType {
 
     /**

+ 0 - 43
module_kzks/src/main/java/org/jeecg/modules/dataSourceSwitch/manage/DataSourceManagement.java

@@ -1,43 +0,0 @@
-package org.jeecg.modules.dataSourceSwitch.manage;
-
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
-import org.springframework.context.annotation.Primary;
-import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import javax.sql.DataSource;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@Primary
-@Component
-public class DataSourceManagement extends AbstractRoutingDataSource {
-
-    public static ThreadLocal<String> flag = new ThreadLocal<>();
-
-    @Resource
-    private DataSource master;
-
-    @Resource
-    private DataSource slave;
-
-    public DataSourceManagement(){
-        flag.set(DataSourceType.MASTER.name());
-    }
-
-    @Override
-    protected Object determineCurrentLookupKey() {
-        return flag.get();
-    }
-
-    @Override
-    public void afterPropertiesSet() {
-        Map<Object,Object> targetDataSource = new ConcurrentHashMap<>();
-        targetDataSource.put(DataSourceType.MASTER.name(),master);
-        targetDataSource.put(DataSourceType.SLAVE.name(),slave);
-        super.setTargetDataSources(targetDataSource);
-        super.setDefaultTargetDataSource(master);
-        super.afterPropertiesSet();
-    }
-}

+ 0 - 2
module_kzks/src/main/java/org/jeecg/modules/kyBgInfo/mapper/KyBgInfoMapper.java

@@ -3,8 +3,6 @@ package org.jeecg.modules.kyBgInfo.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.kyBgInfo.entity.KyBgInfo;
 import org.jeecg.modules.kyBgInfo.vo.KyBgInfoDetailListVO;
 

+ 1 - 6
module_kzks/src/main/java/org/jeecg/modules/kyTaskInfo/mapper/KyTaskInfoMapper.java

@@ -1,13 +1,8 @@
 package org.jeecg.modules.kyTaskInfo.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Select;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.kyTaskInfo.entity.KyTaskInfo;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * @Description: ky_task_info

+ 3 - 5
module_kzks/src/main/java/org/jeecg/modules/mesInfo/mapper/MesInfoMapper.java

@@ -1,15 +1,13 @@
 package org.jeecg.modules.mesInfo.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.mesInfo.entity.MesInfo;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.mesInfo.vo.MesInfoDetailListVO;
 
+import java.util.List;
+
 /**
  * @Description: mes装机信息卡
  * @Author: jeecg-boot

+ 1 - 6
module_kzks/src/main/java/org/jeecg/modules/mesInfoInstallationcost/mapper/MesInfoInstallationcostMapper.java

@@ -1,12 +1,7 @@
 package org.jeecg.modules.mesInfoInstallationcost.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
-import org.jeecg.modules.mesInfoInstallationcost.entity.MesInfoInstallationcost;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.mesInfoInstallationcost.entity.MesInfoInstallationcost;
 
 /**
  * @Description: mes_info_installationcost

+ 1 - 4
module_kzks/src/main/java/org/jeecg/modules/mesInfoInstallationcost/service/IMesInfoInstallationcostService.java

@@ -1,9 +1,7 @@
 package org.jeecg.modules.mesInfoInstallationcost.service;
 
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
-import org.jeecg.modules.mesInfoInstallationcost.entity.MesInfoInstallationcost;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.mesInfoInstallationcost.entity.MesInfoInstallationcost;
 
 /**
  * @Description: mes_info_installationcost
@@ -11,7 +9,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @Date:   2023-08-22
  * @Version: V1.0
  */
-@TargetDataSource(value = DataSourceType.SLAVE)
 public interface IMesInfoInstallationcostService extends IService<MesInfoInstallationcost> {
 
 }

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/mesInfoInstallationcost/service/impl/MesInfoInstallationcostServiceImpl.java

@@ -1,5 +1,7 @@
 package org.jeecg.modules.mesInfoInstallationcost.service.impl;
 
+import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
+import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.mesInfoInstallationcost.entity.MesInfoInstallationcost;
 import org.jeecg.modules.mesInfoInstallationcost.mapper.MesInfoInstallationcostMapper;
 import org.jeecg.modules.mesInfoInstallationcost.service.IMesInfoInstallationcostService;
@@ -13,6 +15,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  * @Date:   2023-08-22
  * @Version: V1.0
  */
+@TargetDataSource(value = DataSourceType.SLAVE)
 @Service
 public class MesInfoInstallationcostServiceImpl extends ServiceImpl<MesInfoInstallationcostMapper, MesInfoInstallationcost> implements IMesInfoInstallationcostService {
 

+ 3 - 7
module_kzks/src/main/java/org/jeecg/modules/projectCost/mapper/ProjectCostMapper.java

@@ -1,16 +1,12 @@
 package org.jeecg.modules.projectCost.mapper;
 
-import java.math.BigDecimal;
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.projectCost.entity.ProjectCost;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.projectCost.vo.ProjectCostVO;
 
+import java.util.List;
+
 /**
  * @Description: 项目成本
  * @Author: jeecg-boot

+ 2 - 4
module_kzks/src/main/java/org/jeecg/modules/projectCost/mapper/xml/ProjectCostMapper.xml

@@ -9,10 +9,9 @@
                c.clf ,c.zyf,c.swf,c.wxf,c.rldlf,c.gdzczj,c.gzjlwf,c.glf,IFNULL(c.zjcb,m.value) AS zjcb,c.lbsy ,
                c.workhour,c.zrbm,c.jycsid,c.jycs ,c.hxzxid,c. hxzxname ,c.tasktype,c.AuditPrice,c.iflag,c.Brief,
                c.reftaskno,c.pcCode,c.bcCode,c.blCode,c.BusinessMan,c.sjgs,c.scgs,c.status,c.proportion,
-               ys.clys, ys.wxys, 2 as ji
+               2 as ji
         from kzks_project_cost c
         left join mes_info_installationcost m on  m.taskno = #{taskno}
-        left join kzks_project_cost_ys ys on ys.taskno = #{taskno}
         where c.taskno = #{taskno} order by status
     </select>
 
@@ -23,10 +22,9 @@
                c.clf ,c.zyf,c.swf,c.wxf,c.rldlf,c.gdzczj,c.gzjlwf,c.glf,IFNULL(c.zjcb,m.value) AS zjcb,c.lbsy ,
                c.workhour,c.zrbm,c.jycsid,c.jycs ,c.hxzxid,c. hxzxname ,c.tasktype,c.AuditPrice,c.iflag,c.Brief,
                c.reftaskno,c.pcCode,c.bcCode,c.blCode,c.BusinessMan,c.sjgs,c.scgs,c.status,c.proportion,
-               ys.clys, ys.wxys, 2 as ji
+               2 as ji
         from kzks_project_cost c
                  left join mes_info_installationcost m on m.taskno = c.taskno
-                 left join kzks_project_cost_ys ys on ys.taskno = c.taskno
         where c.reftaskno = #{taskno} order by taskno ,status
     </select>
 

+ 28 - 3
module_kzks/src/main/java/org/jeecg/modules/projectCostHuiji/controller/ProjectCostHuijiController.java

@@ -18,15 +18,19 @@ import org.jeecg.modules.projectCostHuiji.entity.ProjectCostHuiji;
 import org.jeecg.modules.projectCostHuiji.service.IProjectCostHuijiService;
 import org.jeecg.modules.projectCostHuiji.vo.ProjectCostHuijiListVO;
 import org.jeecg.modules.projectCostHuiji.vo.ProjectCostHuijiSumVO;
+import org.jeecg.modules.projectCostYs.entity.KzksProjectCostYs;
+import org.jeecg.modules.projectCostYs.service.IKzksProjectCostYsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
 /**
@@ -49,6 +53,9 @@ public class ProjectCostHuijiController extends JeecgController<ProjectCostHuiji
 	@Autowired
 	@SuppressWarnings("all")
 	private IMesInfoInstallationcostService mesInfoInstallationcostService;
+	@Autowired
+	@SuppressWarnings("all")
+	private IKzksProjectCostYsService costYsService;
 
 	@ApiOperation(value="111111111111")
 	@GetMapping(value = "/children1")
@@ -94,15 +101,33 @@ public class ProjectCostHuijiController extends JeecgController<ProjectCostHuiji
 		QueryWrapper<ProjectCostHuiji> queryWrapper = QueryGenerator.initQueryWrapper(projectCostHuiji, req.getParameterMap());
 		Page<ProjectCostHuiji> page = new Page<ProjectCostHuiji>(pageNo, pageSize);
 		Page<ProjectCostHuiji> pageList = projectCostHuijiService.page(page, queryWrapper);
-		if(pageList != null ){
+		if(pageList != null ){//costYsService
 			List<ProjectCostHuijiListVO> list=pageList.getRecords().stream().map(i -> {
 
 				List<ProjectCostVO> children1 = costService.costListByTaskNoMain(i.getTaskno()); //主任务及批产的主任务
 				List<ProjectCostVO> children2 = costService.costListByTaskNoSub(i.getTaskno()); //子任务及批产的子任务
 
+				List<ProjectCostVO> children3 = children1.stream().map(x->{
+					KzksProjectCostYs ys = costYsService.selectYSByTaskno(x.getTaskno());
+					if(ys!=null){
+						if(ys.getClys()!=null) x.setClys(ys.getClys());
+						if(ys.getWxys()!=null) x.setWxys(ys.getWxys());
+					}
+					return x;
+				}).collect(Collectors.toList());
+
+				List<ProjectCostVO> children4 = children2.stream().map(x->{
+					KzksProjectCostYs ys = costYsService.selectYSByTaskno(x.getTaskno());
+					if(ys!=null){
+						if(ys.getClys()!=null) x.setClys(ys.getClys());
+						if(ys.getWxys()!=null) x.setWxys(ys.getWxys());
+					}
+					return x;
+				}).collect(Collectors.toList());
+
 				List<ProjectCostVO> children =new ArrayList<>();
-				children.addAll(children1);
-				children.addAll(children2);
+				children.addAll(children3);
+				children.addAll(children4);
 
 				return ProjectCostHuijiConvert.INSTANCE.toHuijiListVO(i,children,1);
 

+ 0 - 2
module_kzks/src/main/java/org/jeecg/modules/projectCostHuiji/mapper/ProjectCostHuijiMapper.java

@@ -2,8 +2,6 @@ package org.jeecg.modules.projectCostHuiji.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.projectCostHuiji.entity.ProjectCostHuiji;
 
 import java.util.List;

+ 12 - 0
module_kzks/src/main/java/org/jeecg/modules/projectCostHuiji/mapper/xml/ProjectCostHuijiMapper.xml

@@ -21,6 +21,18 @@
         <where>
             <if test="taskno != null  and taskno != ''">and taskno = #{taskno}</if>
             <if test="taskname != null  and taskname != ''">and taskname like concat('%', #{taskname}, '%')</if>
+
+            <if test="xhname != null  and xhname != ''">and xhname = #{xhname}</if>
+            <if test="yzjdname != null  and yzjdname != ''">and yzjdname = #{yzjdname}</if>
+            <if test="tasktype != null  and tasktype != ''">and tasktype = #{tasktype}</if>
+            <if test="auditprice != null  and auditprice != ''">and AuditPrice = #{auditprice}</if>
+            <if test="iflag != null  and iflag != ''">and iflag = #{iflag}</if>
+            <if test="processpercent != null  and processpercent != ''">and processPercent = #{processpercent}</if>
+
+            <if test="costPercent != null  and costPercent != ''">and cost_percent = #{costPercent}</if>
+            <if test="businessman != null  and businessman != ''">and BusinessMan = #{businessman}</if>
+            <if test="jycs != null  and jycs != ''">and taskno = #{jycs}</if>
+            <if test="pccode != null  and pccode != ''">and pcCode = #{pccode}</if>
         </where>
     </select>
 

+ 4 - 0
module_kzks/src/main/java/org/jeecg/modules/projectCostYs/mapper/KzksProjectCostYsMapper.java

@@ -16,6 +16,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface KzksProjectCostYsMapper extends BaseMapper<KzksProjectCostYs> {
 
+    /**根据任务号查询预算*/
+    @Select("select clys, wxys from kzks_project_cost_ys where taskno = #{taskno}")
+    public KzksProjectCostYs selectYSByTaskno(String taskno);
+
     /**修改该任务号的材料预算及外协预算*/
     @Select("update kzks_project_cost_ys set clys = #{clys}, wxys = #{wxys} where taskno = #{taskno}")
     public void updateYS(BigDecimal clys, BigDecimal wxys, String taskno);

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/projectCostYs/service/IKzksProjectCostYsService.java

@@ -11,4 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IKzksProjectCostYsService extends IService<KzksProjectCostYs> {
 
+    /**根据任务号查询预算*/
+    public KzksProjectCostYs selectYSByTaskno(String taskno);
+
 }

+ 11 - 0
module_kzks/src/main/java/org/jeecg/modules/projectCostYs/service/impl/KzksProjectCostYsServiceImpl.java

@@ -1,8 +1,10 @@
 package org.jeecg.modules.projectCostYs.service.impl;
 
+import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.projectCostYs.entity.KzksProjectCostYs;
 import org.jeecg.modules.projectCostYs.mapper.KzksProjectCostYsMapper;
 import org.jeecg.modules.projectCostYs.service.IKzksProjectCostYsService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -16,4 +18,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class KzksProjectCostYsServiceImpl extends ServiceImpl<KzksProjectCostYsMapper, KzksProjectCostYs> implements IKzksProjectCostYsService {
 
+    @Autowired
+    @SuppressWarnings("all")
+    private KzksProjectCostYsMapper costYsMapper;
+
+    /**根据任务号查询预算*/
+    public KzksProjectCostYs selectYSByTaskno(String taskno){
+     return costYsMapper.selectYSByTaskno(taskno);
+    }
+
 }

+ 3 - 5
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/mapper/WzOutboundOrderBMapper.java

@@ -1,16 +1,14 @@
 package org.jeecg.modules.wzOutboundOrder.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.wzOutboundOrder.entity.WzOutboundOrderB;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBDetailListVO;
 import org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBWLBMListVO;
 
+import java.util.List;
+
 /**
  * @Description: 物资出库明细
  * @Author: jeecg-boot

+ 3 - 5
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/mapper/WzOutboundOrderHMapper.java

@@ -1,13 +1,11 @@
 package org.jeecg.modules.wzOutboundOrder.mapper;
 
-import java.util.List;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
-import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
-import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
 import org.jeecg.modules.wzOutboundOrder.entity.WzOutboundOrderH;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
 
 /**
  * @Description: 物资出库单