|
@@ -71,7 +71,6 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
71
|
71
|
@Override
|
72
|
72
|
public List<BusinessNoticeReceive> queryByExample(Integer pageNum, Integer pageSize,
|
73
|
73
|
BusinessNoticeReceive businessNoticeReceive,String cktzd,String lyflag) {
|
74
|
|
- // TODO Auto-generated method stub
|
75
|
74
|
|
76
|
75
|
BusinessNoticeReceiveExample example = new BusinessNoticeReceiveExample();
|
77
|
76
|
Criteria createCriteria = example.createCriteria();
|
|
@@ -133,7 +132,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
133
|
132
|
//审批通过的
|
134
|
133
|
if(businessNoticeReceive.getAuditState() != null){
|
135
|
134
|
if(businessNoticeReceive.getAuditState().equals(14)){ //未审批结束的
|
136
|
|
- createCriteria.andAuditStateNotEqualTo(5);//5是审批结束的
|
|
135
|
+ createCriteria.andAuditStateNotEqualTo(6);//6是入库性质转变单审批结束的
|
137
|
136
|
}else{
|
138
|
137
|
createCriteria.andAuditStateEqualTo(businessNoticeReceive.getAuditState());
|
139
|
138
|
}
|
|
@@ -334,63 +333,83 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
334
|
333
|
} else {
|
335
|
334
|
businessNoticeReceive.setIsSheet(0);
|
336
|
335
|
}
|
|
336
|
+ //businessNoticeReceive.setHzqlsxzdm(3052);//商品粮 转后,划转后粮食性质
|
|
337
|
+ businessNoticeReceive.setLsxzzbdh(jsonObject.getString("tzdid"));//粮食性质转变单单号
|
|
338
|
+ //SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
|
339
|
+ //businessNoticeReceive.setHzrq(new Date());//划转时间
|
|
340
|
+ //businessNoticeReceive.setIsSheet(0);//是性质转变单
|
|
341
|
+
|
|
342
|
+ String lsyqsl = jsonObject.getString("lsyqsl");
|
|
343
|
+ businessNoticeReceive.setCount(lsyqsl); //计划数量(吨)
|
|
344
|
+ //businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
|
|
345
|
+
|
|
346
|
+ businessNoticeReceive.setInApplication(1); //启用
|
|
347
|
+ businessNoticeReceive.setIsNotice(0);//0是可以引用的通知单
|
|
348
|
+ businessNoticeReceive.setAuditState(5);//下达未审批
|
|
349
|
+ businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
|
|
350
|
+ //businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
|
|
351
|
+ businessNoticeReceiveMapper.insert(businessNoticeReceive);
|
337
|
352
|
} else {//出库类型
|
338
|
353
|
//根据仓房、货位、orgId获取粮食品种等信息
|
339
|
354
|
Map<String, Object> map = feignAgileService.getDateByChHwh(orgId, houseId, wareHouseId);
|
340
|
355
|
logger.info("根据orgId="+orgId+",houseId="+houseId+",warehouseId="+wareHouseId+" 获取到的库存数据如下:");
|
341
|
356
|
logger.info(map+"");
|
342
|
|
- grainAttribute = (Integer) map.get("hwxz"); //粮油性质
|
343
|
|
- grainKind = (Integer) map.get("pz"); //品种
|
344
|
|
- Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
|
345
|
|
- Integer grainGrade = (Integer) map.get("dj"); //等级
|
346
|
|
- String inputTime = map.get("rq")+""; //入库时间
|
347
|
|
- Integer scnf = Integer.parseInt(map.get("scnf")+"");
|
348
|
|
- Double kcsl = (Double) map.get("kcsl");//千克
|
349
|
|
- Date date = null;
|
350
|
|
- if(inputTime!=null){
|
351
|
|
- date = ParameterUtil.string2datetime(inputTime);
|
352
|
|
- businessNoticeReceive.setInputTime(date);//入库时间
|
353
|
|
- }
|
354
|
|
- businessNoticeReceive.setProductiveYear(scnf);//生产年份
|
355
|
|
- businessNoticeReceive.setGrainAnnual(scnf);//收获年度
|
356
|
|
-
|
357
|
|
- Integer grainProducingArea = (Integer) map.get("gb"); //产地
|
358
|
|
-
|
359
|
|
- businessNoticeReceive.setGrainKind(grainKind); //品种
|
360
|
|
- businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
|
361
|
|
- businessNoticeReceive.setGrainGrade(grainGrade); //等级
|
362
|
|
- businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
|
363
|
|
- businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
|
364
|
|
-
|
365
|
|
- /**
|
366
|
|
- * 库存数量转化为吨
|
367
|
|
- */
|
368
|
|
- BigDecimal s = new BigDecimal(1000);
|
369
|
|
- BigDecimal kcslBig = new BigDecimal(kcsl);
|
370
|
|
- BigDecimal kcslKg = kcslBig.divide(s);
|
371
|
|
-
|
372
|
|
- businessNoticeReceive.setLssl(kcslKg.toString());//库存数量
|
373
|
|
-
|
374
|
|
- businessNoticeReceive.setHzqlsxzdm(3052);//商品粮 转后,划转后粮食性质
|
375
|
|
- businessNoticeReceive.setLsxzzbdh(jsonObject.getString("tzdid"));//粮食性质转变单单号
|
376
|
|
- //SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
377
|
|
- businessNoticeReceive.setHzrq(new Date());//划转时间
|
378
|
|
- businessNoticeReceive.setIsSheet(0);//是性质转变单
|
|
357
|
+ if (null != map && !"0".equals(map.get("hwxz").toString())) {
|
|
358
|
+ grainAttribute = (Integer) map.get("hwxz"); //粮油性质
|
|
359
|
+ grainKind = (Integer) map.get("pz"); //品种
|
|
360
|
+ Integer grainDetailKind = (Integer) map.get("mxpz"); //明细品种
|
|
361
|
+ Integer grainGrade = (Integer) map.get("dj"); //等级
|
|
362
|
+ String inputTime = map.get("rq")+""; //入库时间
|
|
363
|
+ Integer scnf = Integer.parseInt(map.get("scnf")+"");
|
|
364
|
+ Double kcsl = (Double) map.get("kcsl");//千克
|
|
365
|
+ Date date = null;
|
|
366
|
+ if(inputTime!=null){
|
|
367
|
+ date = ParameterUtil.string2datetime(inputTime);
|
|
368
|
+ businessNoticeReceive.setInputTime(date);//入库时间
|
|
369
|
+ }
|
|
370
|
+ businessNoticeReceive.setProductiveYear(scnf);//生产年份
|
|
371
|
+ businessNoticeReceive.setGrainAnnual(scnf);//收获年度
|
|
372
|
+
|
|
373
|
+ Integer grainProducingArea = (Integer) map.get("gb"); //产地
|
|
374
|
+
|
|
375
|
+ businessNoticeReceive.setGrainKind(grainKind); //品种
|
|
376
|
+ businessNoticeReceive.setGrainDetailKind(grainDetailKind); //明细品种
|
|
377
|
+ businessNoticeReceive.setGrainGrade(grainGrade); //等级
|
|
378
|
+ businessNoticeReceive.setGrainAttribute(grainAttribute); //粮油性质
|
|
379
|
+ businessNoticeReceive.setGrainProducingArea(grainProducingArea);//产地
|
|
380
|
+
|
|
381
|
+ /**
|
|
382
|
+ * 库存数量转化为吨
|
|
383
|
+ */
|
|
384
|
+ BigDecimal s = new BigDecimal(1000);
|
|
385
|
+ BigDecimal kcslBig = new BigDecimal(kcsl);
|
|
386
|
+ BigDecimal kcslKg = kcslBig.divide(s);
|
|
387
|
+
|
|
388
|
+ businessNoticeReceive.setLssl(kcslKg.toString());//库存数量
|
|
389
|
+
|
|
390
|
+ businessNoticeReceive.setHzqlsxzdm(3052);//商品粮 转后,划转后粮食性质
|
|
391
|
+ businessNoticeReceive.setLsxzzbdh(jsonObject.getString("tzdid"));//粮食性质转变单单号
|
|
392
|
+ //SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
|
393
|
+ businessNoticeReceive.setHzrq(new Date());//划转时间
|
|
394
|
+ businessNoticeReceive.setIsSheet(0);//是性质转变单
|
|
395
|
+
|
|
396
|
+ String lsyqsl = jsonObject.getString("lsyqsl");
|
|
397
|
+ businessNoticeReceive.setCount(lsyqsl); //计划数量(吨)
|
|
398
|
+ businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
|
|
399
|
+
|
|
400
|
+ businessNoticeReceive.setInApplication(1); //启用
|
|
401
|
+ businessNoticeReceive.setIsNotice(0);//0是可以引用的通知单
|
|
402
|
+ businessNoticeReceive.setAuditState(0);//下达未审批
|
|
403
|
+ businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
|
|
404
|
+ //businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
|
|
405
|
+ businessNoticeReceiveMapper.insert(businessNoticeReceive);
|
|
406
|
+ } else {
|
|
407
|
+ modelMap.put("msg", "根据所传信息没有查到对应库存信息");
|
|
408
|
+ modelMap.put("status", "error");
|
|
409
|
+ }
|
379
|
410
|
}
|
380
|
|
- String lsyqsl = jsonObject.getString("lsyqsl");
|
381
|
|
- businessNoticeReceive.setCount(lsyqsl); //计划数量(吨)
|
382
|
|
- businessNoticeReceive.setOutgoingPeriod(jsonObject.getString("ckqx")); //出库期限(日期格式)
|
383
|
|
-
|
384
|
|
- businessNoticeReceive.setInApplication(1); //启用
|
385
|
|
- businessNoticeReceive.setIsNotice(0);//0是可以引用的通知单
|
386
|
|
- businessNoticeReceive.setAuditState(0);//下达未审批
|
387
|
|
- businessNoticeReceive.setReceiveTime(new Date());//接收数据的时间
|
388
|
|
- //businessNoticeReceive.setSfzswtzd("0"); //接收通知单菜单不展示该数据
|
389
|
|
- businessNoticeReceiveMapper.insert(businessNoticeReceive);
|
390
|
|
-
|
391
|
411
|
}
|
392
|
|
-
|
393
|
|
- }else{
|
|
412
|
+ } else {
|
394
|
413
|
modelMap.put("msg", "cfbm编码为空");
|
395
|
414
|
modelMap.put("status", "error");
|
396
|
415
|
}
|
|
@@ -477,7 +496,6 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
477
|
496
|
|
478
|
497
|
@Override
|
479
|
498
|
public void audit(BusinessNoticeReceive receiveNotice, Integer userId, String realName,String orgName,String content) {
|
480
|
|
- // TODO Auto-generated method stub
|
481
|
499
|
|
482
|
500
|
//businessApproval.setContent(jsonUserInfo.getString("realName") + "提交"); //提交人
|
483
|
501
|
|
|
@@ -534,37 +552,12 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
534
|
552
|
businessApprovalService.add(businessApproval);
|
535
|
553
|
|
536
|
554
|
//必须是入库,库级和市级都审批完成,并且不是通知单,只是性质转变单
|
537
|
|
- if ("5".equals(receiveNotice.getAuditState().toString()) && "1".equals(receiveNotice.getIsNotice().toString()) && "0".equals(receiveNotice.getIsSheet().toString()) && "1".equals(receiveNotice.getCrktype())) {
|
538
|
|
- //转储成功后把信息给市平台
|
539
|
|
- //retSptMeagess(receiveNotice);
|
540
|
|
- try {
|
541
|
|
- Map<String, Object> sysCodeMap = new HashMap<>();
|
542
|
|
- sysCodeMap.put("orgId", 10);
|
543
|
|
- sysCodeMap.put("sCode", "xzzzxxts");
|
544
|
|
- Map<String, Object> resultMap = businessNoticeReceiveMapper.getSysCodeUrl(sysCodeMap);
|
545
|
|
- String path = "";
|
546
|
|
- if (null != resultMap) {
|
547
|
|
- path = resultMap.get("s_val").toString();
|
548
|
|
- }
|
549
|
|
- if (null != receiveNotice.getCblx() && null != receiveNotice.getYsid()) {
|
550
|
|
-
|
551
|
|
- //组装请求参数
|
552
|
|
- Map<String, String> params = new HashMap<>();
|
553
|
|
- params.put("crklx", receiveNotice.getCblx());
|
554
|
|
- params.put("ysid", receiveNotice.getYsid());
|
555
|
|
-
|
556
|
|
- logger.info("给给市平台发送性质转变成功通知信息:"+params.toString());
|
557
|
|
- logger.info("给给市平台发送性质转变成功通知信息地址是:"+path);
|
558
|
|
-
|
559
|
|
- //给市平台发送请求
|
560
|
|
- String result = HTTPUtils.doPost(path, params);
|
561
|
|
-
|
562
|
|
- //保存推送合同引用状态的消息和返回结果
|
563
|
|
- systemOutsideDataService.addlogger("xzzzxx_result", params.toString(), result);
|
564
|
|
- }
|
565
|
|
- } catch (Exception e) {
|
566
|
|
- e.printStackTrace();
|
567
|
|
- }
|
|
555
|
+ if ("5".equals(receiveNotice.getAuditState().toString())
|
|
556
|
+ && "1".equals(receiveNotice.getIsNotice().toString())
|
|
557
|
+ && "0".equals(receiveNotice.getIsSheet().toString())
|
|
558
|
+ && "1".equals(receiveNotice.getCrktype())) {
|
|
559
|
+
|
|
560
|
+ retSptMeagess(receiveNotice);
|
568
|
561
|
}
|
569
|
562
|
}
|
570
|
563
|
|
|
@@ -576,7 +569,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
576
|
569
|
|
577
|
570
|
|
578
|
571
|
/**
|
579
|
|
- * 给给市平台发送性质转变成功通知
|
|
572
|
+ * 给给市平台发送性质转变单审批完成的通知
|
580
|
573
|
* @param receiveNotice
|
581
|
574
|
*/
|
582
|
575
|
@Override
|
|
@@ -585,14 +578,8 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
585
|
578
|
|
586
|
579
|
//获取请求的URL地址
|
587
|
580
|
try {
|
588
|
|
- Map<String, Object> sysCodeMap = new HashMap<>();
|
589
|
|
- sysCodeMap.put("orgId", 10);
|
590
|
|
- sysCodeMap.put("sCode", "xzzzxxts");
|
591
|
|
- Map<String, Object> resultMap = businessNoticeReceiveMapper.getSysCodeUrl(sysCodeMap);
|
592
|
|
- String path = "";
|
593
|
|
- if (null != resultMap) {
|
594
|
|
- path = resultMap.get("s_val").toString();
|
595
|
|
- }
|
|
581
|
+ String path = sysCodeService.getSVal(10, "xzzzxxts");
|
|
582
|
+ System.out.println("查到的配置接口数据是:"+path);
|
596
|
583
|
if (null != receiveNotice.getCblx() && null != receiveNotice.getYsid()) {
|
597
|
584
|
|
598
|
585
|
//组装请求参数
|
|
@@ -627,7 +614,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
627
|
614
|
Object[] parameters = new Object[11];
|
628
|
615
|
parameters[0] = receiveNotice.getOrgId() + "";
|
629
|
616
|
parameters[1] = receiveNotice.getGrainKind() + "";
|
630
|
|
- //parameters[2] = null;//明细品种
|
|
617
|
+ parameters[2] = receiveNotice.getGrainDetailKind()+"";//明细品种
|
631
|
618
|
parameters[3] = receiveNotice.getHouseId() + "";
|
632
|
619
|
if (StringUtils.isNotBlank(receiveNotice.getWareHouseId()+"")) {//粮仓
|
633
|
620
|
parameters[4] = receiveNotice.getWareHouseId() + "";
|
|
@@ -635,10 +622,16 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
635
|
622
|
parameters[4] = receiveNotice.getHouseId() + "";//油罐
|
636
|
623
|
}
|
637
|
624
|
parameters[5] = receiveNotice.getHzqlsxzdm() + "";//变更后粮油性质
|
638
|
|
- parameters[6] = receiveNotice.getGrainAttribute() + "";//变更前粮油性质x
|
639
|
|
- parameters[7] = Integer.parseInt(receiveNotice.getLssl())*1000 + "";//数量
|
|
625
|
+ parameters[6] = receiveNotice.getGrainAttribute() + "";//变更前粮油性质
|
|
626
|
+ /**
|
|
627
|
+ * 库存数量转化为公斤
|
|
628
|
+ */
|
|
629
|
+ BigDecimal s = new BigDecimal(1000);
|
|
630
|
+ BigDecimal kcslBig = new BigDecimal(receiveNotice.getLssl());
|
|
631
|
+ BigDecimal kcslKg = kcslBig.multiply(s);
|
|
632
|
+ parameters[7] = kcslKg.toString();//数量
|
640
|
633
|
parameters[8] = receiveNotice.getLsxzzbdh(); //文件号(性质转变单号)
|
641
|
|
- //parameters[9] = null;//损益原因
|
|
634
|
+ parameters[9] = "入库性质转变单";//损益原因
|
642
|
635
|
parameters[10] = 1 + ""; //1:新增;2:修改;3:删除
|
643
|
636
|
|
644
|
637
|
String crkurl = depotSystemFeignService.getUrl(receiveNotice.getOrgId().toString(), "2");
|
|
@@ -856,8 +849,20 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
856
|
849
|
//把对应的粮情卡所挂载的粮食性质改为储备粮
|
857
|
850
|
updateQualitycheckHwxz(obj);
|
858
|
851
|
|
859
|
|
- boolean flag = restLsxz(obj.getId());
|
860
|
|
- System.out.println("性质转变单调用出入库接口结果:"+flag);
|
|
852
|
+ Map<String, Object> kcmap = null;
|
|
853
|
+ if (null == obj.getWareHouseId()) {
|
|
854
|
+ kcmap = feignAgileService.getDateByChHwh(obj.getOrgId(), obj.getHouseId(), obj.getHouseId());
|
|
855
|
+ logger.info("根据orgId="+obj.getOrgId()+",houseId="+obj.getHouseId()+",warehouseId="+obj.getHouseId()+" 获取到的库存数据如下:");
|
|
856
|
+ } else {
|
|
857
|
+ kcmap = feignAgileService.getDateByChHwh(obj.getOrgId(), obj.getHouseId(), obj.getWareHouseId());
|
|
858
|
+ logger.info("根据orgId="+obj.getOrgId()+",houseId="+obj.getHouseId()+",warehouseId="+obj.getWareHouseId()+" 获取到的库存数据如下:");
|
|
859
|
+ }
|
|
860
|
+ logger.info(kcmap+"");
|
|
861
|
+ //如果转前性质跟当前库存的性质一致,那就转储,否则不发送转储指令
|
|
862
|
+ if (null != kcmap && !obj.getHzqlsxzdm().toString().equals(kcmap.get("hwxz").toString())) {
|
|
863
|
+ boolean flag = restLsxz(obj.getId());
|
|
864
|
+ System.out.println("性质转变单调用出入库接口结果:"+flag);
|
|
865
|
+ }
|
861
|
866
|
}
|
862
|
867
|
}
|
863
|
868
|
|