LLL пре 1 година
родитељ
комит
cdaa7a333f

+ 13 - 27
module_kzks/src/main/java/org/jeecg/modules/projectChbSwf/controller/ProjectChbSwfController.java

@@ -1,40 +1,25 @@
 package org.jeecg.modules.projectChbSwf.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.projectChbSwf.entity.ProjectChbSwf;
-import org.jeecg.modules.projectChbSwf.service.IProjectChbSwfService;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.projectChbSwf.entity.ProjectChbSwf;
+import org.jeecg.modules.projectChbSwf.service.IProjectChbSwfService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.jeecg.common.aspect.annotation.AutoLog;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+import java.util.List;
 
  /**
  * @Description: 事务费
@@ -48,6 +33,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 @Slf4j
 public class ProjectChbSwfController extends JeecgController<ProjectChbSwf, IProjectChbSwfService> {
 	@Autowired
+	@SuppressWarnings("all")
 	private IProjectChbSwfService projectChbSwfService;
 
 	/**项目成本——事务费详情——根据任务号查询*/

+ 46 - 0
module_kzks/src/main/java/org/jeecg/modules/projectCost/controller/ProjectCostController.java

@@ -10,6 +10,7 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.projectChbSwf.entity.ProjectChbSwf;
 import org.jeecg.modules.projectCost.entity.ProjectCost;
 import org.jeecg.modules.projectCost.service.IProjectCostService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -18,8 +19,11 @@ 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.Objects;
 
 /**
  * @Description: 项目成本
@@ -36,6 +40,48 @@ public class ProjectCostController extends JeecgController<ProjectCost, IProject
 	@SuppressWarnings("all")
 	private IProjectCostService projectCostService;
 
+	/**项目成本——批产任务的各种费用详情——根据批产任务号查询*/
+	@ApiOperation("项目成本——批产任务的各种费用详情")
+	@GetMapping("/getPCCostDetailList")
+	public List<ProjectCost> getPCCostDetailList(String pccode, BigDecimal proportion){
+		List<ProjectCost> list = new ArrayList<>();
+		if(!Objects.equals(pccode,"") && !Objects.equals(proportion,"")){
+			list = projectCostService.getPCRWList(pccode);
+			for (ProjectCost cost : list){
+				cost = jisuan(cost,proportion);
+			}
+		}
+		return list;
+	}
+
+	public ProjectCost jisuan(ProjectCost cost,BigDecimal proportion){
+		if(cost.getOneIncome()!=null) cost.setOneIncome(cost.getOneIncome().multiply(proportion));
+		if(cost.getOneIncome()!=null) cost.setOneCost(cost.getOneCost().multiply(proportion));
+		if(cost.getOneProfit()!=null) cost.setOneProfit(cost.getOneProfit().multiply(proportion));
+		if(cost.getLre()!=null) cost.setLre(cost.getLre().multiply(proportion));
+		if(cost.getLrl()!=null) cost.setLrl(cost.getLrl().multiply(proportion));
+		if(cost.getEstimationcoat()!=null) cost.setEstimationcoat(cost.getEstimationcoat().multiply(proportion));
+		if(cost.getContractfpe()!=null) cost.setContractfpe(cost.getContractfpe().multiply(proportion));
+		if(cost.getTaskmoney()!=null) cost.setTaskmoney(cost.getTaskmoney().multiply(proportion));
+		if(cost.getZcb()!=null) cost.setZcb(cost.getZcb().multiply(proportion));
+		if(cost.getClf()!=null) cost.setClf(cost.getClf().multiply(proportion));
+		if(cost.getZyf()!=null) cost.setZyf(cost.getZyf().multiply(proportion));
+		if(cost.getSwf()!=null) cost.setSwf(cost.getSwf().multiply(proportion));
+		if(cost.getWxf()!=null) cost.setWxf(cost.getWxf().multiply(proportion));
+		if(cost.getRldlf()!=null) cost.setRldlf(cost.getRldlf().multiply(proportion));
+		if(cost.getGdzczj()!=null) cost.setGdzczj(cost.getGdzczj().multiply(proportion));
+		if(cost.getGzjlwf()!=null) cost.setGzjlwf(cost.getGzjlwf().multiply(proportion));
+		if(cost.getGlf()!=null) cost.setGlf(cost.getGlf().multiply(proportion));
+		if(cost.getZjcb()!=null) cost.setZjcb(cost.getZjcb().multiply(proportion));
+		if(cost.getLbsy()!=null) cost.setLbsy(cost.getLbsy().multiply(proportion));
+		if(cost.getWorkhour()!=null) cost.setWorkhour(cost.getWorkhour().multiply(proportion));
+		if(cost.getSjgs()!=null) cost.setSjgs(cost.getSjgs().multiply(proportion));
+		if(cost.getScgs()!=null) cost.setScgs(cost.getScgs().multiply(proportion));
+		if(cost.getClys()!=null) cost.setClys(cost.getClys().multiply(proportion));
+		if(cost.getWxys()!=null) cost.setWxys(cost.getWxys().multiply(proportion));
+		return cost;
+	}
+
 	/**
 	* 对比
 	*/

+ 3 - 0
module_kzks/src/main/java/org/jeecg/modules/projectCost/service/IProjectCostService.java

@@ -13,6 +13,9 @@ import java.util.List;
  */
 public interface IProjectCostService extends IService<ProjectCost> {
 
+    /**根据批产任务号查询项目成本(批产主任务和批产子任务)*/
+    public List<ProjectCost> getPCRWList(String pccode);
+
     /**根据任务号查询项目成本的主任务及组批后的主任务*/
     public List<ProjectCost> costListByTaskNoMain(String taskno);
 

+ 24 - 1
module_kzks/src/main/java/org/jeecg/modules/projectCost/service/impl/ProjectCostServiceImpl.java

@@ -1,12 +1,15 @@
 package org.jeecg.modules.projectCost.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
 import org.jeecg.modules.projectCost.entity.ProjectCost;
 import org.jeecg.modules.projectCost.mapper.ProjectCostMapper;
 import org.jeecg.modules.projectCost.service.IProjectCostService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -15,7 +18,6 @@ import java.util.List;
  * @Date:   2023-08-15
  * @Version: V1.0
  */
-//@DS(value = DataSourceSwitch.ds2)
 @Service
 public class ProjectCostServiceImpl extends ServiceImpl<ProjectCostMapper, ProjectCost> implements IProjectCostService {
 
@@ -23,13 +25,34 @@ public class ProjectCostServiceImpl extends ServiceImpl<ProjectCostMapper, Proje
     @SuppressWarnings("all")
     private ProjectCostMapper projectCostMapper;
 
+    /**根据批产任务号查询项目成本(批产主任务和批产子任务)*/
+    public List<ProjectCost> getPCRWList(String pccode){
+        List<ProjectCost> list = new ArrayList<>();
+
+        QueryWrapper<ProjectCost> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("taskno",pccode);
+        List<ProjectCost> list1 = projectCostMapper.selectList(queryWrapper);
+
+        queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("reftaskno",pccode);
+        List<ProjectCost> list2 = projectCostMapper.selectList(queryWrapper);
+
+        list.addAll(list1);
+        list.addAll(list2);
+        return list;
+    }
+
     /**根据任务号查询项目成本的主任务及组批后的主任务
      * */
+    // 将注解标注在方法上,表示此方法使用数据源2
+    @TargetDataSource()
     public List<ProjectCost> costListByTaskNoMain(String taskno){
         return projectCostMapper.costListByTaskNoMain(taskno);
     }
 
     /**根据任务号查询项目成本的子任务及组批后的子任务*/
+    // 将注解标注在方法上,表示此方法使用数据源2
+    @TargetDataSource()
     public List<ProjectCost> costListByTaskNoSub(String taskno){
         return projectCostMapper.costListByTaskNoSub(taskno);
     }