|
@@ -530,19 +530,17 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
530
|
530
|
businessNoticeReceiveMapper.updateByPrimaryKeySelective(receiveNotice);
|
531
|
531
|
|
532
|
532
|
}
|
533
|
|
- //增加审批表数据
|
|
533
|
+ //增加审批表数据
|
534
|
534
|
businessApprovalService.add(businessApproval);
|
535
|
535
|
|
536
|
|
- //必须是入库,并且不是通知单,只是性质转变单
|
537
|
|
- if ("1".equals(receiveNotice.getIsNotice()) && "1".equals(receiveNotice.getIsSheet()) && "1".equals(receiveNotice.getCrktype())) {
|
538
|
|
- boolean flag = restLsxz(receiveNotice.getId());
|
539
|
|
-
|
540
|
|
- if (flag) {
|
541
|
|
- //转储成功后把信息给市平台
|
542
|
|
- retSptMeagess(receiveNotice);
|
543
|
|
- //把对应的粮情卡所挂载的粮食性质改为储备粮
|
544
|
|
- updateQualitycheckHwxz(receiveNotice);
|
545
|
|
- }
|
|
536
|
+ System.out.println("5".equals(receiveNotice.getAuditState().toString()));
|
|
537
|
+ System.out.println("1".equals(receiveNotice.getIsNotice().toString()));
|
|
538
|
+ System.out.println("0".equals(receiveNotice.getIsSheet().toString()));
|
|
539
|
+ System.out.println("1".equals(receiveNotice.getCrktype()));
|
|
540
|
+ //必须是入库,库级和市级都审批完成,并且不是通知单,只是性质转变单
|
|
541
|
+ if ("5".equals(receiveNotice.getAuditState().toString()) && "1".equals(receiveNotice.getIsNotice().toString()) && "0".equals(receiveNotice.getIsSheet().toString()) && "1".equals(receiveNotice.getCrktype())) {
|
|
542
|
+ //转储成功后把信息给市平台
|
|
543
|
+ retSptMeagess(receiveNotice);
|
546
|
544
|
}
|
547
|
545
|
}
|
548
|
546
|
|
|
@@ -595,20 +593,22 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
595
|
593
|
boolean flag = false;
|
596
|
594
|
|
597
|
595
|
BusinessNoticeReceive receiveNotice = businessNoticeReceiveMapper.selectByPrimaryKey(id);
|
598
|
|
- Object[] parameters = new Object[9];
|
|
596
|
+ Object[] parameters = new Object[11];
|
599
|
597
|
parameters[0] = receiveNotice.getOrgId() + "";
|
600
|
598
|
parameters[1] = receiveNotice.getGrainKind() + "";
|
601
|
|
- //parameters[2] = null;
|
|
599
|
+ //parameters[2] = null;//明细品种
|
602
|
600
|
parameters[3] = receiveNotice.getHouseId() + "";
|
603
|
601
|
if (StringUtils.isNotBlank(receiveNotice.getWareHouseId()+"")) {//粮仓
|
604
|
602
|
parameters[4] = receiveNotice.getWareHouseId() + "";
|
605
|
603
|
} else {
|
606
|
604
|
parameters[4] = receiveNotice.getHouseId() + "";//油罐
|
607
|
605
|
}
|
608
|
|
- parameters[5] = receiveNotice.getHzqlsxzdm() + "";//要转换的粮食性质
|
609
|
|
- parameters[6] = receiveNotice.getGrainAttribute() + "";//原来的粮食性质
|
|
606
|
+ parameters[5] = receiveNotice.getHzqlsxzdm() + "";//变更后粮油性质
|
|
607
|
+ parameters[6] = receiveNotice.getGrainAttribute() + "";//变更前粮油性质x
|
610
|
608
|
parameters[7] = Integer.parseInt(receiveNotice.getLssl())*1000 + "";//数量
|
611
|
|
- parameters[8] = 1 + ""; //1:新增;2:修改;3:删除
|
|
609
|
+ parameters[8] = receiveNotice.getLsxzzbdh(); //文件号(性质转变单号)
|
|
610
|
+ //parameters[9] = null;//损益原因
|
|
611
|
+ parameters[10] = 1 + ""; //1:新增;2:修改;3:删除
|
612
|
612
|
|
613
|
613
|
String crkurl = depotSystemFeignService.getUrl(receiveNotice.getOrgId().toString(), "2");
|
614
|
614
|
if (StringUtils.isNotBlank(crkurl)) {
|
|
@@ -655,12 +655,12 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
655
|
655
|
@Override
|
656
|
656
|
public Map<String, Object> updateReceiveNotice(String notice) throws Exception {
|
657
|
657
|
Map<String, Object> map = new HashMap<>();
|
658
|
|
-
|
|
658
|
+
|
659
|
659
|
BusinessNoticeReceive businessNoticeReceive = formatObject(notice);
|
660
|
660
|
businessNoticeReceiveMapper.updateByPrimaryKeySelective(businessNoticeReceive);
|
661
|
661
|
map.put("status", 200);
|
662
|
662
|
map.put("msg", "操作成功");
|
663
|
|
-
|
|
663
|
+
|
664
|
664
|
return map;
|
665
|
665
|
}
|
666
|
666
|
|
|
@@ -740,15 +740,21 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
740
|
740
|
result_map.put("status", "error");
|
741
|
741
|
return result_map;
|
742
|
742
|
}
|
743
|
|
-
|
744
|
|
- Map<String, Object> kcmap = feignAgileService.getDateByChHwh(businessNoticeReceive.getOrgId(), businessNoticeReceive.getHouseId(), businessNoticeReceive.getWareHouseId());
|
745
|
|
- logger.info("根据orgId="+businessNoticeReceive.getOrgId()+",houseId="+businessNoticeReceive.getHouseId()+",warehouseId="+businessNoticeReceive.getWareHouseId()+" 获取到的库存数据如下:");
|
|
743
|
+
|
|
744
|
+ Map<String, Object> kcmap = null;
|
|
745
|
+ if (null == businessNoticeReceive.getWareHouseId()) {
|
|
746
|
+ kcmap = feignAgileService.getDateByChHwh(businessNoticeReceive.getOrgId(), businessNoticeReceive.getHouseId(), businessNoticeReceive.getHouseId());
|
|
747
|
+ logger.info("根据orgId="+businessNoticeReceive.getOrgId()+",houseId="+businessNoticeReceive.getHouseId()+",warehouseId="+businessNoticeReceive.getHouseId()+" 获取到的库存数据如下:");
|
|
748
|
+ } else {
|
|
749
|
+ kcmap = feignAgileService.getDateByChHwh(businessNoticeReceive.getOrgId(), businessNoticeReceive.getHouseId(), businessNoticeReceive.getWareHouseId());
|
|
750
|
+ logger.info("根据orgId="+businessNoticeReceive.getOrgId()+",houseId="+businessNoticeReceive.getHouseId()+",warehouseId="+businessNoticeReceive.getWareHouseId()+" 获取到的库存数据如下:");
|
|
751
|
+ }
|
746
|
752
|
logger.info(kcmap+"");
|
747
|
|
- if (null != kcmap) {
|
|
753
|
+ if (null != kcmap && !"0".equals(kcmap.get("hwxz"))) {
|
748
|
754
|
String inputTime = kcmap.get("rq")+""; //入库时间
|
749
|
755
|
Double kcsl = (Double) kcmap.get("kcsl");//千克
|
750
|
756
|
Date date = null;
|
751
|
|
- if(inputTime!=null){
|
|
757
|
+ if(StringUtils.isNotBlank(inputTime)){
|
752
|
758
|
date = ParameterUtil.string2datetime(inputTime);
|
753
|
759
|
businessNoticeReceive.setInputTime(date);//入库时间
|
754
|
760
|
}
|
|
@@ -779,7 +785,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
779
|
785
|
Date thisdate = new Date();
|
780
|
786
|
sbf.append("RKXZZBD").append(String.format("%03d", businessNoticeReceive.getOrgId())).append(ParameterUtil.getDateYMDHMS(thisdate));
|
781
|
787
|
businessNoticeReceive.setLsxzzbdh(sbf.toString());//粮食性质转变单单号
|
782
|
|
- businessNoticeReceive.setHzrq(thisdate);//划转时间
|
|
788
|
+ //businessNoticeReceive.setHzrq(thisdate);//划转时间
|
783
|
789
|
businessNoticeReceive.setCount(businessNoticeReceive.getLssl()); //计划数量(吨)
|
784
|
790
|
businessNoticeReceive.setInApplication(1); //启用
|
785
|
791
|
businessNoticeReceive.setAuditState(0);//下达未审批
|
|
@@ -803,4 +809,25 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
|
803
|
809
|
return result_map;
|
804
|
810
|
}
|
805
|
811
|
|
|
812
|
+ @Override
|
|
813
|
+ public void updateNoticeReceiveAuditState(String cblx, String ysid, String hzsj) {
|
|
814
|
+ BusinessNoticeReceiveExample example = new BusinessNoticeReceiveExample();
|
|
815
|
+ Criteria createCriteria = example.createCriteria();
|
|
816
|
+ createCriteria.andCblxEqualTo(cblx);
|
|
817
|
+ createCriteria.andYsidEqualTo(ysid);
|
|
818
|
+ List<BusinessNoticeReceive> list = businessNoticeReceiveMapper.selectByExample(example);
|
|
819
|
+ if (null != list && list.size() > 0) {
|
|
820
|
+ BusinessNoticeReceive obj = list.get(0);
|
|
821
|
+ obj.setAuditState(6);//入库的审批通过
|
|
822
|
+ obj.setHzrq(ParameterUtil.string2datetime(hzsj));//划转时间
|
|
823
|
+ businessNoticeReceiveMapper.updateByPrimaryKey(obj);
|
|
824
|
+
|
|
825
|
+ //把对应的粮情卡所挂载的粮食性质改为储备粮
|
|
826
|
+ updateQualitycheckHwxz(obj);
|
|
827
|
+
|
|
828
|
+ boolean flag = restLsxz(obj.getId());
|
|
829
|
+ System.out.println("性质转变单调用出入库接口结果:"+flag);
|
|
830
|
+ }
|
|
831
|
+ }
|
|
832
|
+
|
806
|
833
|
}
|