|
|
@@ -1,5 +1,18 @@
|
|
1
|
1
|
package com.chinaitop.depot.business.service.impl;
|
|
2
|
2
|
|
|
|
3
|
+import java.text.SimpleDateFormat;
|
|
|
4
|
+import java.util.Date;
|
|
|
5
|
+import java.util.HashMap;
|
|
|
6
|
+import java.util.List;
|
|
|
7
|
+import java.util.Map;
|
|
|
8
|
+
|
|
|
9
|
+import javax.annotation.Resource;
|
|
|
10
|
+
|
|
|
11
|
+import org.apache.commons.lang.ObjectUtils;
|
|
|
12
|
+import org.apache.commons.lang.StringUtils;
|
|
|
13
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
14
|
+import org.springframework.stereotype.Service;
|
|
|
15
|
+
|
|
3
|
16
|
import com.alibaba.fastjson.JSONObject;
|
|
4
|
17
|
import com.chinaitop.depot.business.mapper.BusinessNoticeReceiveMapper;
|
|
5
|
18
|
import com.chinaitop.depot.business.model.BusinessNoticeReceive;
|
|
|
@@ -9,19 +22,6 @@ import com.chinaitop.depot.business.service.FeignAgileService;
|
|
9
|
22
|
import com.chinaitop.depot.business.service.FeignBasicService;
|
|
10
|
23
|
import com.chinaitop.depot.business.service.ReceiveNoticeService;
|
|
11
|
24
|
import com.github.pagehelper.PageHelper;
|
|
12
|
|
-import org.apache.commons.lang.ObjectUtils;
|
|
13
|
|
-import org.apache.commons.lang.StringUtils;
|
|
14
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
15
|
|
-import org.springframework.stereotype.Service;
|
|
16
|
|
-
|
|
17
|
|
-import javax.annotation.Resource;
|
|
18
|
|
-import java.math.BigDecimal;
|
|
19
|
|
-
|
|
20
|
|
-import java.text.SimpleDateFormat;
|
|
21
|
|
-import java.util.Date;
|
|
22
|
|
-import java.util.HashMap;
|
|
23
|
|
-import java.util.List;
|
|
24
|
|
-import java.util.Map;
|
|
25
|
25
|
|
|
26
|
26
|
@Service
|
|
27
|
27
|
public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
|
|
@@ -191,6 +191,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
|
191
|
191
|
Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
|
|
192
|
192
|
Integer grainGrade = (Integer) map.get("dj"); //等级
|
|
193
|
193
|
String inputTime = map.get("rq")+""; //入库时间
|
|
|
194
|
+ Integer scnf = Integer.parseInt(map.get("scnf")+"");
|
|
194
|
195
|
Date date = null;
|
|
195
|
196
|
if(inputTime!=null){
|
|
196
|
197
|
//String year=String.format("%tY", inputTime);
|
|
|
@@ -198,16 +199,18 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
|
198
|
199
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
199
|
200
|
date = sdf.parse(inputTime);
|
|
200
|
201
|
// 获取String字符串中的年
|
|
201
|
|
- SimpleDateFormat y = new SimpleDateFormat("yyyy");
|
|
202
|
|
- System.out.println(y.format(date));
|
|
203
|
|
- String enumName = y.format(date);
|
|
204
|
|
-
|
|
205
|
|
- Integer parentId = 1004;
|
|
206
|
|
- Map<String, Object> basicMap = feignBasicService.getIdByNameAndParentId(parentId, enumName, null);//1004是生产年份的父ID
|
|
207
|
|
- Integer productiveYear = (Integer) basicMap.get("enumId");
|
|
208
|
|
- businessNoticeReceive.setProductiveYear(productiveYear);//生产年份
|
|
209
|
|
- businessNoticeReceive.setGrainAnnual(productiveYear);//收获年度
|
|
|
202
|
+ //SimpleDateFormat y = new SimpleDateFormat("yyyy");
|
|
|
203
|
+ //System.out.println(y.format(date));
|
|
|
204
|
+ //String enumName = y.format(date);
|
|
|
205
|
+
|
|
|
206
|
+ //Integer parentId = 1004;
|
|
|
207
|
+ //Map<String, Object> basicMap = feignBasicService.getIdByNameAndParentId(parentId, enumName, null);//1004是生产年份的父ID
|
|
|
208
|
+ //Integer productiveYear = (Integer) basicMap.get("enumId");
|
|
|
209
|
+
|
|
|
210
|
+ businessNoticeReceive.setInputTime(date);//入库时间
|
|
210
|
211
|
}
|
|
|
212
|
+ businessNoticeReceive.setProductiveYear(scnf);//生产年份
|
|
|
213
|
+ businessNoticeReceive.setGrainAnnual(scnf);//收获年度
|
|
211
|
214
|
|
|
212
|
215
|
Integer grainProducingArea = (Integer) map.get("gb"); //产地
|
|
213
|
216
|
|
|
|
@@ -215,15 +218,14 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
|
215
|
218
|
businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
|
|
216
|
219
|
businessNoticeReceive.setGrainGrade(grainGrade); //等级
|
|
217
|
220
|
businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
|
|
218
|
|
- businessNoticeReceive.setInputTime(date);//入库时间
|
|
219
|
221
|
businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
|
|
220
|
222
|
|
|
221
|
223
|
}
|
|
222
|
224
|
String lsyqsl = jsonObject.getString("lsyqsl");
|
|
223
|
|
- BigDecimal s = new BigDecimal(1000);
|
|
224
|
|
- BigDecimal sumjhsl = new BigDecimal(lsyqsl);
|
|
225
|
|
- BigDecimal sumCkslss = sumjhsl.multiply(s);
|
|
226
|
|
- String count = sumCkslss.toString(); //吨转化为公斤
|
|
|
225
|
+// BigDecimal s = new BigDecimal(1000);
|
|
|
226
|
+// BigDecimal sumjhsl = new BigDecimal(lsyqsl);
|
|
|
227
|
+// BigDecimal sumCkslss = sumjhsl.multiply(s);
|
|
|
228
|
+ //String count = sumCkslss.toString(); //吨转化为公斤
|
|
227
|
229
|
|
|
228
|
230
|
businessNoticeReceive.setCount(lsyqsl); //计划数量(吨)
|
|
229
|
231
|
businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
|