Pārlūkot izejas kodu

在数量管理列表查询方法中多返回了一个值

fanxw 4 gadi atpakaļ
vecāks
revīzija
d412f8769c

+ 5 - 0
pom.xml

@@ -93,6 +93,11 @@
93
 			<scope>test</scope>
93
 			<scope>test</scope>
94
 		</dependency>
94
 		</dependency>
95
 		<dependency>
95
 		<dependency>
96
+		      <groupId>org.apache.poi</groupId>
97
+		      <artifactId>poi</artifactId>
98
+		      <version>3.9</version>
99
+		</dependency>
100
+		<dependency>
96
 			<groupId>org.apache.poi</groupId>
101
 			<groupId>org.apache.poi</groupId>
97
 			<artifactId>poi-ooxml</artifactId>
102
 			<artifactId>poi-ooxml</artifactId>
98
 			<version>3.9</version>
103
 			<version>3.9</version>

+ 19 - 0
src/main/java/com/chinaitop/agile/controller/KcswController.java

@@ -9,6 +9,8 @@ import java.util.List;
9
 import java.util.Map;
9
 import java.util.Map;
10
 
10
 
11
 import javax.annotation.Resource;
11
 import javax.annotation.Resource;
12
+import javax.servlet.http.HttpServletRequest;
13
+import javax.servlet.http.HttpServletResponse;
12
 
14
 
13
 import org.apache.commons.lang.ObjectUtils;
15
 import org.apache.commons.lang.ObjectUtils;
14
 import org.apache.commons.lang3.StringUtils;
16
 import org.apache.commons.lang3.StringUtils;
@@ -117,6 +119,23 @@ public class KcswController {
117
 		}
119
 		}
118
     	return pageInfo;
120
     	return pageInfo;
119
     }
121
     }
122
+	
123
+	@RequestMapping(value="/importList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
124
+    @ApiOperation(value="导出库存数量数据为Excel", notes = "")
125
+	@ApiImplicitParams({
126
+        @ApiImplicitParam(name = "kcswStr", value = "条件集合", paramType = "query"),
127
+        @ApiImplicitParam(name = "order", value = "排序方式", paramType = "query")
128
+	})
129
+    public List<DataKcglKcswDefault> importList(HttpServletRequest request, HttpServletResponse response, String kcswStr, String order){
130
+    	List<DataKcglKcswDefault> list = null;
131
+		try {
132
+			System.out.println("0000");
133
+			list = kcswService.importList(request, response, kcswStr, order);
134
+		} catch (Exception e) {
135
+			e.printStackTrace();
136
+		}
137
+    	return list;
138
+    }
120
 
139
 
121
     @RequestMapping(value="/getHouseOrWareList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
140
     @RequestMapping(value="/getHouseOrWareList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
122
     @ApiOperation(value="获取仓房或者货位", notes = "仓房或者货位")
141
     @ApiOperation(value="获取仓房或者货位", notes = "仓房或者货位")

+ 20 - 0
src/main/java/com/chinaitop/agile/feignService/BasicStorehouseFeignService.java

@@ -0,0 +1,20 @@
1
+package com.chinaitop.agile.feignService;
2
+
3
+import org.springframework.cloud.openfeign.FeignClient;
4
+import org.springframework.http.MediaType;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RequestMethod;
7
+import org.springframework.web.bind.annotation.RequestParam;
8
+
9
+@FeignClient(value = "depot-basic")
10
+public interface BasicStorehouseFeignService {
11
+
12
+	/**
13
+	 * 获取一条仓房数据
14
+	 * @param id 仓房ID
15
+	 * @param orgId 单位ID
16
+	 * @return
17
+	 */
18
+	@RequestMapping(value = "/Storehouse/findByStorehouse", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
19
+	String getStorehouse(@RequestParam("id") Integer id, @RequestParam("orgId") Integer orgId);
20
+}

+ 19 - 0
src/main/java/com/chinaitop/agile/feignService/BasicWarehouseFeignService.java

@@ -0,0 +1,19 @@
1
+package com.chinaitop.agile.feignService;
2
+
3
+import org.springframework.cloud.openfeign.FeignClient;
4
+import org.springframework.http.MediaType;
5
+import org.springframework.web.bind.annotation.RequestMapping;
6
+import org.springframework.web.bind.annotation.RequestMethod;
7
+import org.springframework.web.bind.annotation.RequestParam;
8
+
9
+@FeignClient(value = "depot-basic")
10
+public interface BasicWarehouseFeignService {
11
+
12
+	/**
13
+	 * 获取一条货位数据
14
+	 * @param id 仓房ID
15
+	 * @return
16
+	 */
17
+	@RequestMapping(value = "/Warehouse/findByWarehouse", produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
18
+	String getWarehouse(@RequestParam("id") Integer id);
19
+}

+ 9 - 9
src/main/java/com/chinaitop/agile/mapper/DataKcglKcswDefaultMapper.xml

@@ -553,7 +553,7 @@
553
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
553
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
554
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
554
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
555
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
555
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
556
-             where flt.zbxmc = '402882e87318022e017318de2267003a'
556
+             where flt.zbxmc = '2784'
557
 			 <if test="orgId != null">
557
 			 <if test="orgId != null">
558
             	and jyxx.unitid = #{orgId} 
558
             	and jyxx.unitid = #{orgId} 
559
 		     </if>
559
 		     </if>
@@ -593,7 +593,7 @@
593
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
593
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
594
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
594
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
595
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
595
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
596
-             where flt.zbxmc = '402882e87318022e017318e3c62c0046'
596
+             where flt.zbxmc = '2786'
597
 			 <if test="orgId != null">
597
 			 <if test="orgId != null">
598
             	and jyxx.unitid=#{orgId} 
598
             	and jyxx.unitid=#{orgId} 
599
 		     </if>
599
 		     </if>
@@ -613,7 +613,7 @@
613
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
613
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
614
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
614
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
615
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
615
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
616
-             where flt.zbxmc = '402882e87318022e017318e5a5290052'
616
+             where flt.zbxmc = '402882e87318022e017318e43b61004a'
617
 			 <if test="orgId != null">
617
 			 <if test="orgId != null">
618
             	and jyxx.unitid = #{orgId} 
618
             	and jyxx.unitid = #{orgId} 
619
 		     </if>
619
 		     </if>
@@ -778,7 +778,7 @@
778
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
778
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
779
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
779
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
780
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
780
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
781
-             where flt.zbxmc = '402882e87318022e017318fe508e006e'
781
+             where flt.zbxmc = '2792'
782
 			 <if test="orgId != null">
782
 			 <if test="orgId != null">
783
             	and jyxx.unitid = #{orgId} 
783
             	and jyxx.unitid = #{orgId} 
784
 		     </if>
784
 		     </if>
@@ -808,7 +808,7 @@
808
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
808
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
809
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
809
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
810
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
810
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
811
-             where flt.zbxmc = '402882e87318022e01731900802d0075'
811
+             where flt.zbxmc = '2794'
812
 			 <if test="orgId != null">
812
 			 <if test="orgId != null">
813
             	and jyxx.unitid=#{orgId} 
813
             	and jyxx.unitid=#{orgId} 
814
 		     </if>
814
 		     </if>
@@ -1013,7 +1013,7 @@
1013
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1013
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1014
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1014
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1015
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1015
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1016
-             where flt.zbxmc = '402882e87318022e01731918602c008f'
1016
+             where flt.zbxmc = '2813'
1017
 			 <if test="orgId != null">
1017
 			 <if test="orgId != null">
1018
             	and jyxx.unitid = #{orgId} 
1018
             	and jyxx.unitid = #{orgId} 
1019
 		     </if>
1019
 		     </if>
@@ -1043,7 +1043,7 @@
1043
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1043
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1044
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1044
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1045
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1045
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1046
-             where flt.zbxmc = '402882e87318022e0173191bbf210095'
1046
+             where flt.zbxmc = '2814'
1047
 			 <if test="orgId != null">
1047
 			 <if test="orgId != null">
1048
             	and jyxx.unitid = #{orgId} 
1048
             	and jyxx.unitid = #{orgId} 
1049
 		     </if>
1049
 		     </if>
@@ -1248,7 +1248,7 @@
1248
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1248
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1249
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1249
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1250
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1250
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1251
-             where flt.zbxmc = '402882e87318022e01731923801700a5'
1251
+             where flt.zbxmc = '2802'
1252
 			 <if test="orgId != null">
1252
 			 <if test="orgId != null">
1253
             	and jyxx.unitid=#{orgId} 
1253
             	and jyxx.unitid=#{orgId} 
1254
 		     </if>
1254
 		     </if>
@@ -1278,7 +1278,7 @@
1278
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1278
              from (select * from (select *,row_number() over(partition by BizNo order by 1) rn
1279
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1279
               from data_crkyw_jyxx_default)t1 where t1.rn = 1) jyxx
1280
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1280
              left join data_crkyw_jyxx_flt_001 flt on jyxx.DataID = flt.maindataid
1281
-             where flt.zbxmc = '402882e87318022e0173192531d700ab'
1281
+             where flt.zbxmc = '2805'
1282
 			 <if test="orgId != null">
1282
 			 <if test="orgId != null">
1283
             	and jyxx.unitid = #{orgId} 
1283
             	and jyxx.unitid = #{orgId} 
1284
 		     </if>
1284
 		     </if>

+ 13 - 0
src/main/java/com/chinaitop/agile/service/KcswService.java

@@ -7,6 +7,9 @@ import com.github.pagehelper.PageInfo;
7
 import java.util.List;
7
 import java.util.List;
8
 import java.util.Map;
8
 import java.util.Map;
9
 
9
 
10
+import javax.servlet.http.HttpServletRequest;
11
+import javax.servlet.http.HttpServletResponse;
12
+
10
 public interface KcswService {
13
 public interface KcswService {
11
 	/**
14
 	/**
12
 	 * 粮食品种柱状图
15
 	 * 粮食品种柱状图
@@ -120,4 +123,14 @@ public interface KcswService {
120
 	 * @throws Exception
123
 	 * @throws Exception
121
 	 */
124
 	 */
122
 	PageInfo<DataKcglKcswDefault> queryYYSSL(Integer pageNum, Integer pageSize, String kcswStr, String order) throws Exception;
125
 	PageInfo<DataKcglKcswDefault> queryYYSSL(Integer pageNum, Integer pageSize, String kcswStr, String order) throws Exception;
126
+
127
+	/**
128
+	 * 导出库存数量数据为Excel
129
+	 * 
130
+	 * @param kcswStr
131
+	 * @param order
132
+	 * @return
133
+	 * @throws Exception
134
+	 */
135
+	List<DataKcglKcswDefault> importList(HttpServletRequest request, HttpServletResponse response, String kcswStr, String order) throws Exception;
123
 }
136
 }

+ 167 - 1
src/main/java/com/chinaitop/agile/service/impl/KcswServiceImpl.java

@@ -2,6 +2,8 @@ package com.chinaitop.agile.service.impl;
2
 
2
 
3
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
4
 import com.chinaitop.agile.feignService.BasicEnumFeignService;
4
 import com.chinaitop.agile.feignService.BasicEnumFeignService;
5
+import com.chinaitop.agile.feignService.BasicStorehouseFeignService;
6
+import com.chinaitop.agile.feignService.BasicWarehouseFeignService;
5
 import com.chinaitop.agile.mapper.DataKcglFcbgzDefaultMapper;
7
 import com.chinaitop.agile.mapper.DataKcglFcbgzDefaultMapper;
6
 import com.chinaitop.agile.mapper.DataKcglKcswDefaultMapper;
8
 import com.chinaitop.agile.mapper.DataKcglKcswDefaultMapper;
7
 import com.chinaitop.agile.mapper.DataKcglXckcDefaultMapper;
9
 import com.chinaitop.agile.mapper.DataKcglXckcDefaultMapper;
@@ -15,9 +17,21 @@ import com.github.pagehelper.PageHelper;
15
 import com.github.pagehelper.PageInfo;
17
 import com.github.pagehelper.PageInfo;
16
 
18
 
17
 import org.apache.commons.lang.ObjectUtils;
19
 import org.apache.commons.lang.ObjectUtils;
20
+import org.apache.poi.hssf.usermodel.HSSFCell;
21
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
22
+import org.apache.poi.hssf.usermodel.HSSFFont;
23
+import org.apache.poi.hssf.usermodel.HSSFRow;
24
+import org.apache.poi.hssf.usermodel.HSSFSheet;
25
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
26
+import org.apache.poi.ss.usermodel.Font;
18
 import org.springframework.stereotype.Service;
27
 import org.springframework.stereotype.Service;
19
 
28
 
20
 import javax.annotation.Resource;
29
 import javax.annotation.Resource;
30
+import javax.servlet.http.HttpServletRequest;
31
+import javax.servlet.http.HttpServletResponse;
32
+
33
+import java.io.BufferedOutputStream;
34
+import java.io.OutputStream;
21
 import java.math.BigDecimal;
35
 import java.math.BigDecimal;
22
 import java.math.RoundingMode;
36
 import java.math.RoundingMode;
23
 import java.text.DecimalFormat;
37
 import java.text.DecimalFormat;
@@ -36,6 +50,10 @@ public class KcswServiceImpl implements KcswService{
36
 	private DataKcglFcbgzDefaultService fcbgzService;
50
 	private DataKcglFcbgzDefaultService fcbgzService;
37
 	@Resource
51
 	@Resource
38
 	private BasicEnumFeignService basicEnumFeignService;
52
 	private BasicEnumFeignService basicEnumFeignService;
53
+	@Resource
54
+	private BasicStorehouseFeignService basicStorehouseFeignService;
55
+	@Resource
56
+	private BasicWarehouseFeignService basicWarehouseFeignService;
39
 
57
 
40
 	public Map<String, Object> queryByExample(Integer orgId) {
58
 	public Map<String, Object> queryByExample(Integer orgId) {
41
 		/* 返回数据对象 */
59
 		/* 返回数据对象 */
@@ -424,7 +442,7 @@ public class KcswServiceImpl implements KcswService{
424
 		pageInfo = new PageInfo<DataKcglKcswDefault>(list);
442
 		pageInfo = new PageInfo<DataKcglKcswDefault>(list);
425
 
443
 
426
 		/* 2、查询对应仓房的生产年份,ZJ是自检要做判断 */
444
 		/* 2、查询对应仓房的生产年份,ZJ是自检要做判断 */
427
-		if (!order.equals("ZJ") && null != pageInfo.getList() && pageInfo.getList().size() > 0) {
445
+		if (!"ZJ".equals(order) && null != pageInfo.getList() && pageInfo.getList().size() > 0) {
428
 			for (DataKcglKcswDefault kcswobj : pageInfo.getList()) {
446
 			for (DataKcglKcswDefault kcswobj : pageInfo.getList()) {
429
 				DataKcglFcbgzDefaultExample fcbgz_example = new DataKcglFcbgzDefaultExample();
447
 				DataKcglFcbgzDefaultExample fcbgz_example = new DataKcglFcbgzDefaultExample();
430
 				DataKcglFcbgzDefaultExample.Criteria fcbgz_criteria = fcbgz_example.createCriteria();
448
 				DataKcglFcbgzDefaultExample.Criteria fcbgz_criteria = fcbgz_example.createCriteria();
@@ -437,6 +455,7 @@ public class KcswServiceImpl implements KcswService{
437
 				if (null != fcbgz_list && fcbgz_list.size() > 0) {
455
 				if (null != fcbgz_list && fcbgz_list.size() > 0) {
438
 					int scnf = Integer.parseInt(ObjectUtils.toString(fcbgz_list.get(0).getScnf(), "0"));
456
 					int scnf = Integer.parseInt(ObjectUtils.toString(fcbgz_list.get(0).getScnf(), "0"));
439
 					kcswobj.setScnf(scnf);
457
 					kcswobj.setScnf(scnf);
458
+					kcswobj.setCjsj(fcbgz_list.get(0).getCjsj());
440
 				}
459
 				}
441
 				/* 3、查询这个仓房的已验收数量和未验收数量 */
460
 				/* 3、查询这个仓房的已验收数量和未验收数量 */
442
 				map.put("orgId", kcsw.getUnitid());
461
 				map.put("orgId", kcsw.getUnitid());
@@ -467,4 +486,151 @@ public class KcswServiceImpl implements KcswService{
467
 
486
 
468
 		return pageInfo;
487
 		return pageInfo;
469
 	}
488
 	}
489
+
490
+	@Override
491
+	public List<DataKcglKcswDefault> importList(HttpServletRequest request, HttpServletResponse response, String kcswStr, String order) throws Exception {
492
+		List<DataKcglKcswDefault> list = null;
493
+		
494
+		String orgInfo = ObjectUtils.toString(request.getSession().getAttribute("orgInfo"),"");
495
+		JSONObject org = null;
496
+		String orgName = "";
497
+		if (null != orgInfo && !"".equals(orgInfo)) {
498
+			org = JSONObject.parseObject(orgInfo);
499
+			orgName = org.get("orgName") == null?"":org.get("orgName").toString();
500
+		}
501
+
502
+		HSSFWorkbook workbook = new HSSFWorkbook();
503
+		//创建一个Excel表单,参数为sheet的名字
504
+		HSSFSheet sheet = workbook.createSheet("库存数量统计");
505
+
506
+		//创建表头
507
+        setKcslTitle(workbook, sheet);
508
+        
509
+        PageInfo<DataKcglKcswDefault> pageInfo = queryYYSSL(null, null, kcswStr, order);
510
+        list = pageInfo.getList();
511
+        
512
+        int rowNum = 1;
513
+        DataKcglKcswDefault serviceVo = null;
514
+        for (int i = 0; i < list.size(); i++) {
515
+        	serviceVo = list.get(i);
516
+            HSSFRow row = sheet.createRow(rowNum);
517
+            row.createCell(0).setCellValue(i++);
518
+            row.createCell(1).setCellValue(orgName);
519
+            row.createCell(2).setCellValue(getStorehouse(serviceVo.getCh(), Integer.parseInt(serviceVo.getUnitid())));
520
+            row.createCell(3).setCellValue(getWarehouse(serviceVo.getHwh()));
521
+            row.createCell(4).setCellValue(getEnum(Integer.parseInt(serviceVo.getPz())));
522
+            row.createCell(5).setCellValue(getEnum(Integer.parseInt(serviceVo.getHwxz())));
523
+            row.createCell(6).setCellValue(serviceVo.getKcsl()/1000);
524
+            row.createCell(7).setCellValue(serviceVo.getRksl()/1000);
525
+            row.createCell(8).setCellValue(serviceVo.getWyssl()/1000);
526
+            row.createCell(9).setCellValue(getEnum(serviceVo.getScnf()));
527
+            rowNum++;
528
+        }
529
+        String fileName = "库存数量统计.xlsx";
530
+        //清空response
531
+        response.reset();
532
+        //设置response的Header
533
+        response.addHeader("Content-Disposition", "attachment;filename="+ fileName);
534
+        OutputStream os = new BufferedOutputStream(response.getOutputStream());
535
+
536
+        response.setContentType("application/vnd.ms-excel;charset=gb2312");
537
+        //将excel写入到输出流中
538
+        workbook.write(os);
539
+        os.flush();
540
+        os.close();
541
+		
542
+		return null;
543
+	}
544
+
545
+	public void setKcslTitle(HSSFWorkbook workbook, HSSFSheet sheet) {
546
+		HSSFRow row = sheet.createRow(0);
547
+        //设置数据所在列的宽度,setColumnWidth的第二个参数要乘以256,这个参数的单位是1/256个字符宽度
548
+        sheet.setColumnWidth(0, 5*256);
549
+        sheet.setColumnWidth(1, 10*256);
550
+        sheet.setColumnWidth(2, 10*256);
551
+        sheet.setColumnWidth(3, 10*256);
552
+        sheet.setColumnWidth(4, 10*256);
553
+        sheet.setColumnWidth(5, 10*256);
554
+        sheet.setColumnWidth(6, 10*256);
555
+        sheet.setColumnWidth(7, 10*256);
556
+        sheet.setColumnWidth(8, 10*256);
557
+        sheet.setColumnWidth(9, 10*256);
558
+
559
+        HSSFCellStyle style = workbook.createCellStyle();
560
+        HSSFFont font = workbook.createFont();
561
+        font.setBoldweight(Font.BOLDWEIGHT_BOLD);
562
+        style.setFont(font);
563
+
564
+        HSSFCell cell = null;
565
+
566
+        cell = row.createCell(0);
567
+        cell.setCellValue("序号");
568
+        cell.setCellStyle(style);
569
+        
570
+        cell = row.createCell(1);
571
+        cell.setCellValue("储存库点");
572
+        cell.setCellStyle(style);
573
+        
574
+        cell = row.createCell(2);
575
+        cell.setCellValue("仓房名称");
576
+        cell.setCellStyle(style);
577
+        
578
+        cell = row.createCell(3);
579
+        cell.setCellValue("货位名称");
580
+        cell.setCellStyle(style);
581
+        
582
+        cell = row.createCell(4);
583
+        cell.setCellValue("粮油品种");
584
+        cell.setCellStyle(style);
585
+        
586
+        cell = row.createCell(5);
587
+        cell.setCellValue("粮油性质");
588
+        cell.setCellStyle(style);
589
+        
590
+        cell = row.createCell(6);
591
+        cell.setCellValue("库存数量(吨)");
592
+        cell.setCellStyle(style);
593
+        
594
+        cell = row.createCell(7);
595
+        cell.setCellValue("已验收数量(吨)");
596
+        cell.setCellStyle(style);
597
+        
598
+        cell = row.createCell(8);
599
+        cell.setCellValue("未验收数量(吨)");
600
+        cell.setCellStyle(style);
601
+        
602
+        cell = row.createCell(9);
603
+        cell.setCellValue("收获年度");
604
+        cell.setCellStyle(style);
605
+	}
606
+
607
+	public String getEnum(Integer enumid) {
608
+		String strResult = basicEnumFeignService.getEnumData(enumid);
609
+		String enumname = "";
610
+		if (null != strResult && !"".equals(strResult)) {
611
+			JSONObject enum_obj = JSONObject.parseObject(strResult);
612
+			enumname = enum_obj.get("enumname")+"";
613
+		}
614
+		return enumname;
615
+	}
616
+
617
+	public String getStorehouse(Integer id, Integer orgId) {
618
+		String strResult = basicStorehouseFeignService.getStorehouse(id, orgId);
619
+		String storehouseName = "";
620
+		if (null != strResult && !"".equals(strResult)) {
621
+			JSONObject enum_obj = JSONObject.parseObject(strResult);
622
+			storehouseName = enum_obj.get("storehouseName")+"";
623
+		}
624
+		return storehouseName;
625
+	}
626
+
627
+	public String getWarehouse(Integer id) {
628
+		String strResult = basicWarehouseFeignService.getWarehouse(id);
629
+		String warehouseName = "";
630
+		if (null != strResult && !"".equals(strResult)) {
631
+			JSONObject enum_obj = JSONObject.parseObject(strResult);
632
+			warehouseName = enum_obj.get("warehouseName")+"";
633
+		}
634
+		return warehouseName;
635
+	}
470
 }
636
 }