浏览代码

项目成本——材料费明细

LLL 1 年之前
父节点
当前提交
4ed53ec86d

+ 56 - 34
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/controller/WzOutboundOrderHController.java

@@ -1,42 +1,31 @@
 package org.jeecg.modules.wzOutboundOrder.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.wzOutboundOrder.entity.WzOutboundOrderH;
-import org.jeecg.modules.wzOutboundOrder.service.IWzOutboundOrderHService;
-
 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.wzOutboundOrder.entity.WzOutboundOrderH;
+import org.jeecg.modules.wzOutboundOrder.service.IWzOutboundOrderBService;
+import org.jeecg.modules.wzOutboundOrder.service.IWzOutboundOrderHService;
+import org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBDetailListVO;
 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.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
  * @Description: 物资出库单
  * @Author: jeecg-boot
  * @Date:   2023-08-17
@@ -49,7 +38,40 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 public class WzOutboundOrderHController extends JeecgController<WzOutboundOrderH, IWzOutboundOrderHService> {
 	@Autowired
 	private IWzOutboundOrderHService wzOutboundOrderHService;
-	
+	@Autowired
+	private IWzOutboundOrderBService bService;
+
+
+	 /**
+	  * 材料费详情
+	  */
+	 @ApiOperation(value="项目成本——材料费详情", notes="项目成本——材料费详情")
+	 @GetMapping(value = "/getCLFList")
+	 public List<WzOutboundOrderBDetailListVO> getCLFList(String taskno) {
+
+		 List<WzOutboundOrderBDetailListVO> bList = new ArrayList<>();
+
+	 	QueryWrapper<WzOutboundOrderH> wrapper = new QueryWrapper<>();
+	 	wrapper.eq("rwh",taskno);
+	 	List<WzOutboundOrderH> list =wzOutboundOrderHService.list(wrapper);
+	 	List<WzOutboundOrderH> list1 = new ArrayList<>();
+	 	if (!list.isEmpty()) {
+			for (WzOutboundOrderH h:list){
+				//出库单号对应的物料单数量
+				Integer count = bService.getckDetailDataCountByCkdh(h.getCkdh());
+				if(count>5000) continue;
+				list1.add(h);
+				System.out.println(count);
+			}
+			if(!list1.isEmpty()){
+				List<String> list2 = list1.stream().map(i->i.getCkdh()).collect(Collectors.toList());
+				bList = bService.wzDetailList(list2);
+			}
+		}
+
+	 	return bList;
+	 }
+
 	/**
 	 * 分页列表查询
 	 *
@@ -71,7 +93,7 @@ public class WzOutboundOrderHController extends JeecgController<WzOutboundOrderH
 		IPage<WzOutboundOrderH> pageList = wzOutboundOrderHService.page(page, queryWrapper);
 		return Result.OK(pageList);
 	}
-	
+
 	/**
 	 *   添加
 	 *
@@ -86,7 +108,7 @@ public class WzOutboundOrderHController extends JeecgController<WzOutboundOrderH
 		wzOutboundOrderHService.save(wzOutboundOrderH);
 		return Result.OK("添加成功!");
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -101,7 +123,7 @@ public class WzOutboundOrderHController extends JeecgController<WzOutboundOrderH
 		wzOutboundOrderHService.updateById(wzOutboundOrderH);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -116,7 +138,7 @@ public class WzOutboundOrderHController extends JeecgController<WzOutboundOrderH
 		wzOutboundOrderHService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -131,7 +153,7 @@ public class WzOutboundOrderHController extends JeecgController<WzOutboundOrderH
 		this.wzOutboundOrderHService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *

+ 4 - 10
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/entity/WzOutboundOrderB.java

@@ -1,22 +1,16 @@
 package org.jeecg.modules.wzOutboundOrder.entity;
 
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.util.Date;
-import java.math.BigDecimal;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import lombok.Data;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.jeecg.common.aspect.annotation.Dict;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.io.Serializable;
 
 /**
  * @Description: 物资出库明细

+ 11 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/mapper/WzOutboundOrderBMapper.java

@@ -3,8 +3,10 @@ package org.jeecg.modules.wzOutboundOrder.mapper;
 import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.wzOutboundOrder.entity.WzOutboundOrderB;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBDetailListVO;
 
 /**
  * @Description: 物资出库明细
@@ -14,4 +16,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface WzOutboundOrderBMapper extends BaseMapper<WzOutboundOrderB> {
 
+    /**查出库单号对应的物料单数量*/
+    @Select("select count(1) from wz_outbound_order_b where ckdh = #{ckdh}")
+    public Integer getckDetailDataCountByCkdh(String ckdh);
+
+    /**
+     * 根据出库单号集合查询物资出库明细
+     */
+    public List<WzOutboundOrderBDetailListVO> wzDetailList(@Param("ckDetailList") List<String> ckDetailList);
+
 }

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

@@ -3,6 +3,7 @@ package org.jeecg.modules.wzOutboundOrder.mapper;
 import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.wzOutboundOrder.entity.WzOutboundOrderH;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
@@ -14,4 +15,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface WzOutboundOrderHMapper extends BaseMapper<WzOutboundOrderH> {
 
+    /**根据任务号查询出库单号集合*/
+    @Select("select h.ckdh from wz_outbound_order_h h where h.rwh = #{taskNo}")
+    public List<String> getCKDHList(@Param("taskNo") String taskNo);
+
 }

+ 17 - 1
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/mapper/xml/WzOutboundOrderBMapper.xml

@@ -2,4 +2,20 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.wzOutboundOrder.mapper.WzOutboundOrderBMapper">
 
-</mapper>
+    <resultMap id="WzOutboundOrderBDetailListVO" type="org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBDetailListVO" >
+        <result column="ckdh" property="ckdh" jdbcType="VARCHAR"/>
+        <result column="cgdj" property="cgdj" jdbcType="VARCHAR"/>
+        <result column="nbdj" property="nbdj" jdbcType="VARCHAR"/>
+        <result column="sfzsl" property="sfzsl" jdbcType="VARCHAR"/>
+    </resultMap>
+
+
+    <!-- 根据出库单号集合查询物资出库明细 -->
+    <select id="wzDetailList" resultMap="WzOutboundOrderBDetailListVO">
+        select ckdh, cgdj, nbdj, sfzsl from wz_outbound_order_b where ckdh in
+        <foreach collection="ckDetailList" index="index" item="id" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </select>
+
+</mapper>

+ 13 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/service/IWzOutboundOrderBService.java

@@ -1,7 +1,11 @@
 package org.jeecg.modules.wzOutboundOrder.service;
 
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.wzOutboundOrder.entity.WzOutboundOrderB;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBDetailListVO;
+
+import java.util.List;
 
 /**
  * @Description: 物资出库明细
@@ -11,4 +15,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IWzOutboundOrderBService extends IService<WzOutboundOrderB> {
 
+    /**查出库单号对应的物料单数量*/
+    public Integer getckDetailDataCountByCkdh(String ckdh);
+
+    /**
+     * 根据出库单号集合查询物资出库明细
+     */
+    public List<WzOutboundOrderBDetailListVO> wzDetailList(@Param("ckDetailList") List<String> ckDetailList);
+
+
 }

+ 21 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/service/impl/WzOutboundOrderBServiceImpl.java

@@ -1,12 +1,17 @@
 package org.jeecg.modules.wzOutboundOrder.service.impl;
 
+import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.wzOutboundOrder.entity.WzOutboundOrderB;
 import org.jeecg.modules.wzOutboundOrder.mapper.WzOutboundOrderBMapper;
 import org.jeecg.modules.wzOutboundOrder.service.IWzOutboundOrderBService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBDetailListVO;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.List;
+
 /**
  * @Description: 物资出库明细
  * @Author: jeecg-boot
@@ -16,4 +21,20 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class WzOutboundOrderBServiceImpl extends ServiceImpl<WzOutboundOrderBMapper, WzOutboundOrderB> implements IWzOutboundOrderBService {
 
+    @Autowired
+    @SuppressWarnings("all")
+    private WzOutboundOrderBMapper bMapper;
+
+    /**查出库单号对应的物料单数量*/
+    public Integer getckDetailDataCountByCkdh(String ckdh){
+        return bMapper.getckDetailDataCountByCkdh(ckdh);
+    }
+
+    /**
+     * 根据出库单号集合查询物资出库明细
+     */
+    public List<WzOutboundOrderBDetailListVO> wzDetailList(@Param("ckDetailList") List<String> ckDetailList){
+        return bMapper.wzDetailList(ckDetailList);
+    }
+
 }

+ 30 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrder/vo/WzOutboundOrderBDetailListVO.java

@@ -0,0 +1,30 @@
+package org.jeecg.modules.wzOutboundOrder.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+import java.io.Serializable;
+
+@Data
+public class WzOutboundOrderBDetailListVO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**出库单号*/
+    @Excel(name = "出库单号", width = 15)
+    @ApiModelProperty(value = "出库单号")
+    private java.lang.String ckdh;
+    /**采购单价*/
+    @Excel(name = "采购单价", width = 15)
+    @ApiModelProperty(value = "采购单价")
+    private java.math.BigDecimal cgdj;
+    /**内部单价*/
+    @Excel(name = "内部单价", width = 15)
+    @ApiModelProperty(value = "内部单价")
+    private java.math.BigDecimal nbdj;
+    /**实发主数量*/
+    @Excel(name = "实发主数量", width = 15)
+    @ApiModelProperty(value = "实发主数量")
+    private java.math.BigDecimal sfzsl;
+
+}