|
@@ -532,12 +532,56 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
532
|
532
|
|
533
|
533
|
//必须是入库,并且不是通知单,只是性质转变单
|
534
|
534
|
if ("1".equals(receiveNotice.getIsNotice()) && "1".equals(receiveNotice.getIsSheet()) && "1".equals(receiveNotice.getCrktype())) {
|
535
|
|
- restLsxz(receiveNotice.getId());
|
|
535
|
+ boolean flag = restLsxz(receiveNotice.getId());
|
|
536
|
+
|
|
537
|
+ if (flag) {
|
|
538
|
+ //转储成功后把信息给市平台
|
|
539
|
+ retSptMeagess(receiveNotice);
|
|
540
|
+ }
|
536
|
541
|
}
|
537
|
542
|
}
|
538
|
543
|
|
539
|
|
- public void restLsxz(Integer id) {
|
540
|
|
- /* 先调用出入库接口生成转储的业务的台账信息,生成失败不可保存转储数据***start */
|
|
544
|
+ /**
|
|
545
|
+ * 给给市平台发送性质转变成功通知
|
|
546
|
+ * @param receiveNotice
|
|
547
|
+ */
|
|
548
|
+ @Override
|
|
549
|
+ public void retSptMeagess(BusinessNoticeReceive receiveNotice) {
|
|
550
|
+ String result = "";
|
|
551
|
+
|
|
552
|
+ //获取请求的URL地址
|
|
553
|
+ String path;
|
|
554
|
+ try {
|
|
555
|
+ path = sysCodeService.getSVal(10, "xzzzxxts");
|
|
556
|
+ if (null != receiveNotice.getCblx() && null != receiveNotice.getYsid()) {
|
|
557
|
+
|
|
558
|
+ //组装请求参数
|
|
559
|
+ Map<String, String> params = new HashMap<>();
|
|
560
|
+ params.put("crklx", receiveNotice.getCblx());
|
|
561
|
+ params.put("ysid", receiveNotice.getYsid());
|
|
562
|
+
|
|
563
|
+ logger.info("给给市平台发送性质转变成功通知信息:"+params.toString());
|
|
564
|
+
|
|
565
|
+ //给市平台发送请求
|
|
566
|
+ result = HTTPUtils.doPost(path, params);
|
|
567
|
+
|
|
568
|
+ //保存推送合同引用状态的消息和返回结果
|
|
569
|
+ systemOutsideDataService.addlogger("xzzzxx_result", params.toString(), result);
|
|
570
|
+ }
|
|
571
|
+ } catch (Exception e) {
|
|
572
|
+ e.printStackTrace();
|
|
573
|
+ }
|
|
574
|
+ }
|
|
575
|
+
|
|
576
|
+ /**
|
|
577
|
+ * 调用出入库接口改变粮食性质
|
|
578
|
+ * @param id 性质转变单数据ID
|
|
579
|
+ * @return
|
|
580
|
+ */
|
|
581
|
+ public boolean restLsxz(Integer id) {
|
|
582
|
+
|
|
583
|
+ boolean flag = false;
|
|
584
|
+
|
541
|
585
|
BusinessNoticeReceive receiveNotice = businessNoticeReceiveMapper.selectByPrimaryKey(id);
|
542
|
586
|
Object[] parameters = new Object[9];
|
543
|
587
|
parameters[0] = receiveNotice.getOrgId() + "";
|
|
@@ -549,11 +593,11 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
549
|
593
|
} else {
|
550
|
594
|
parameters[4] = receiveNotice.getHouseId() + "";//油罐
|
551
|
595
|
}
|
552
|
|
- parameters[5] = receiveNotice.getHzqlsxzdm() + "";
|
553
|
|
- parameters[6] = receiveNotice.getGrainAttribute() + "";
|
554
|
|
- parameters[7] = Integer.parseInt(receiveNotice.getLssl())*1000 + "";
|
|
596
|
+ parameters[5] = receiveNotice.getHzqlsxzdm() + "";//要转换的粮食性质
|
|
597
|
+ parameters[6] = receiveNotice.getGrainAttribute() + "";//原来的粮食性质
|
|
598
|
+ parameters[7] = Integer.parseInt(receiveNotice.getLssl())*1000 + "";//数量
|
555
|
599
|
parameters[8] = 1 + ""; //1:新增;2:修改;3:删除
|
556
|
|
-
|
|
600
|
+
|
557
|
601
|
String crkurl = depotSystemFeignService.getUrl(receiveNotice.getOrgId().toString(), "2");
|
558
|
602
|
if (StringUtils.isNotBlank(crkurl)) {
|
559
|
603
|
String url_id = crkurl.substring(0, crkurl.lastIndexOf("Base")-1);
|
|
@@ -561,7 +605,11 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
561
|
605
|
sbf.append(url_id).append(url);
|
562
|
606
|
String str = createKC.createKC("ChangeGrainAttribute", sbf.toString(), parameters);
|
563
|
607
|
systemOutsideDataService.addlogger("rkxzzb", JSON.toJSONString(parameters), str);
|
|
608
|
+ if ("true".equals(str)) {
|
|
609
|
+ flag = true;
|
|
610
|
+ }
|
564
|
611
|
}
|
|
612
|
+ return flag;
|
565
|
613
|
}
|
566
|
614
|
|
567
|
615
|
@Override
|
|
@@ -639,6 +687,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
639
|
687
|
|
640
|
688
|
|
641
|
689
|
|
|
690
|
+ @SuppressWarnings("unused")
|
642
|
691
|
@Override
|
643
|
692
|
public Map<String, Object> scRkxzzbd(String sptId, String cblx, String ysid) {
|
644
|
693
|
Map<String, Object> result_map = new HashMap<>();
|
|
@@ -707,6 +756,12 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
707
|
756
|
BigDecimal kcslKg = kcslBig.divide(s);
|
708
|
757
|
businessNoticeReceive.setLssl(kcslKg.toString());//库存数量
|
709
|
758
|
|
|
759
|
+ if ("1".equals(cblx)) {//市储
|
|
760
|
+ businessNoticeReceive.setHzqlsxzdm(6877);
|
|
761
|
+ }
|
|
762
|
+ if ("2".equals(cblx)) {//区储
|
|
763
|
+ businessNoticeReceive.setHzqlsxzdm(6878);
|
|
764
|
+ }
|
710
|
765
|
businessNoticeReceive.setHzqlsxzdm(3052);//商品粮 转后,划转后粮食性质
|
711
|
766
|
StringBuffer sbf = new StringBuffer(50);
|
712
|
767
|
Date thisdate = new Date();
|
|
@@ -720,6 +775,9 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
720
|
775
|
businessNoticeReceive.setIsNotice(1);//0是可以引用的通知单,1不是
|
721
|
776
|
businessNoticeReceive.setIsSheet(0);//0代表是性质转变单
|
722
|
777
|
businessNoticeReceiveMapper.insert(businessNoticeReceive);
|
|
778
|
+
|
|
779
|
+ result_map.put("msg", "操作成功");
|
|
780
|
+ result_map.put("status", "success");
|
723
|
781
|
} else {
|
724
|
782
|
result_map.put("msg", "根据所传信息没有查到对应库存信息");
|
725
|
783
|
result_map.put("status", "error");
|