- [x] 1.收款单(解活)打开报错
- [x] 2.推送SAP报错 - [x] 3.列表提交不校验(付款单) --s
This commit is contained in:
		
							parent
							
								
									f54bb8c5b8
								
							
						
					
					
						commit
						4de20edbbf
					
				|  | @ -90,11 +90,14 @@ public class RecBillFromPlugin extends AbstractFormPlugin implements Plugin { | |||
|             DynamicObject transdetailinfo;//交易明细对象 | ||||
|             for (int i = 0; i < entrys.size(); i++) { | ||||
|                 entryInfo = entrys.get(i); | ||||
|                 transdetailinfo = BusinessDataServiceHelper.loadSingle(entryInfo.getLong("edetailid"),transDetailName, | ||||
|                         "id,billno,oppunit,oppbanknumber,oppbank"); | ||||
|                 this.getModel().setValue("shjh_oppunit",transdetailinfo.getString("oppunit"), i);//对方户名 | ||||
|                 this.getModel().setValue("shjh_oppbanknumber",transdetailinfo.getString("oppbanknumber"), i);//银行账户 | ||||
|                 this.getModel().setValue("shjh_oppbank",transdetailinfo.getString("oppbank"), i);//付款银行 | ||||
|                 long edetailid = entryInfo.getLong("edetailid"); | ||||
|                 if (edetailid != 0) { | ||||
|                     transdetailinfo = BusinessDataServiceHelper.loadSingle(entryInfo.getLong("edetailid"),transDetailName, | ||||
|                             "id,billno,oppunit,oppbanknumber,oppbank"); | ||||
|                     this.getModel().setValue("shjh_oppunit",transdetailinfo.getString("oppunit"), i);//对方户名 | ||||
|                     this.getModel().setValue("shjh_oppbanknumber",transdetailinfo.getString("oppbanknumber"), i);//银行账户 | ||||
|                     this.getModel().setValue("shjh_oppbank",transdetailinfo.getString("oppbank"), i);//付款银行 | ||||
|                 } | ||||
|             } | ||||
|             //更新分录页面显示 | ||||
|             this.getView().updateView(transDetailEntryID); | ||||
|  |  | |||
|  | @ -0,0 +1,102 @@ | |||
| package shjh.jhzj7.fi.fi.plugin.form; | ||||
| 
 | ||||
| import kd.bos.dataentity.entity.DynamicObject; | ||||
| import kd.bos.dataentity.entity.DynamicObjectCollection; | ||||
| import kd.bos.entity.datamodel.events.PropertyChangedArgs; | ||||
| import kd.bos.form.plugin.AbstractFormPlugin; | ||||
| import kd.bos.orm.query.QCP; | ||||
| import kd.bos.orm.query.QFilter; | ||||
| import kd.bos.servicehelper.BusinessDataServiceHelper; | ||||
| 
 | ||||
| import java.math.BigDecimal; | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.Date; | ||||
| import java.util.EventObject; | ||||
| 
 | ||||
| /** | ||||
|  * 理财赎回 | ||||
|  * shjh_cim_redeem_ext | ||||
|  */ | ||||
| public class RedeemFormPlugin extends AbstractFormPlugin { | ||||
| 
 | ||||
|     @Override | ||||
|     public void propertyChanged(PropertyChangedArgs e) { | ||||
|         super.propertyChanged(e); | ||||
|         String name = e.getProperty().getName(); | ||||
|         if ("redeemdate".equals(name)) { | ||||
|             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||||
|             Date redeemdate = (Date)this.getView().getModel().getValue(name);//赎回日期 | ||||
|             if (null != redeemdate) { | ||||
|                 String format1 = format.format(redeemdate); | ||||
|                 // 修改【赎回日期】后,校验理财申购单估值表体是否存在该日期,若不存在报错:“该日期不存在估值信息,请前往理财申购列表进行估值。” | ||||
|                 DynamicObject finbillno = (DynamicObject)this.getView().getModel().getValue("finbillno");//产品编号 | ||||
|                 if (null != finbillno) { | ||||
|                     // 理财申购单 | ||||
|                     QFilter qFilter = new QFilter("id", QCP.equals, finbillno.getLong("id")); | ||||
|                     DynamicObject cimFinsubscribe = BusinessDataServiceHelper.loadSingle("cim_finsubscribe", qFilter.toArray()); | ||||
|                     if (null != cimFinsubscribe) { | ||||
|                         //估值表体 | ||||
|                         DynamicObjectCollection valuationentry = cimFinsubscribe.getDynamicObjectCollection("valuationentry"); | ||||
|                         if (!valuationentry.isEmpty()) { | ||||
|                             boolean isExist = false; | ||||
|                             BigDecimal shrjz = BigDecimal.ZERO;//赎回日净值 | ||||
|                             BigDecimal shrsyfe = BigDecimal.ZERO;//赎回日剩余份额 | ||||
|                             for (DynamicObject dynamicObject : valuationentry) { | ||||
|                                 Date eValuationdate = dynamicObject.getDate("e_valuationdate"); | ||||
|                                 String format2 = format.format(eValuationdate); | ||||
|                                 if (format1.equals(format2)) { | ||||
|                                     isExist = true; | ||||
|                                     shrjz = dynamicObject.getBigDecimal("e_iopv"); | ||||
|                                     shrsyfe = dynamicObject.getBigDecimal("e_surpcopies"); | ||||
|                                     break; | ||||
|                                 } | ||||
|                             } | ||||
| 
 | ||||
|                             if (!isExist) { | ||||
|                                 this.getView().showErrorNotification("该日期不存在估值信息,请前往理财申购列表进行估值。"); | ||||
|                                 this.getView().getModel().setValue("redeemdate",null); | ||||
|                                 this.getView().updateView("redeemdate"); | ||||
|                             }else { | ||||
|                                 this.getView().getModel().setValue("shjh_shrjz",shrjz); | ||||
|                                 this.getView().updateView("shjh_shrjz"); | ||||
|                                 this.getView().getModel().setValue("shjh_shrsyfe",shrsyfe); | ||||
|                                 this.getView().updateView("shjh_shrsyfe"); | ||||
|                             } | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         }else if ("copies".equals(name)) { | ||||
|             //表头【剩余份数】=【赎回日剩余份数】—【赎回份数】(大于等于0); | ||||
|             BigDecimal copies = (BigDecimal)this.getView().getModel().getValue(name);//赎回份数 | ||||
|             BigDecimal shjh_shrsyfe = (BigDecimal)this.getView().getModel().getValue("shjh_shrsyfe");//赎回日剩余份额 | ||||
|             // 判断赎回份数是否大于赎回日剩余份额 | ||||
|             if (copies.compareTo(shjh_shrsyfe) > 0) { | ||||
|                 this.getView().showErrorNotification("【赎回日剩余份数】—【赎回份数】(大于等于0)"); | ||||
|                 this.getView().getModel().setValue("copies",BigDecimal.ZERO); | ||||
|                 this.getView().updateView("copies"); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public void afterBindData(EventObject e) { | ||||
|         super.afterBindData(e); | ||||
| 
 | ||||
|         //新增不可编辑字段【是否现金管理类】:根据理财申购单表头字段带出 | ||||
|         DynamicObject finbillno = (DynamicObject)this.getView().getModel().getValue("finbillno");//产品编号 | ||||
|         if (null != finbillno) { | ||||
|             // 理财申购单 | ||||
|             QFilter qFilter = new QFilter("id", QCP.equals, finbillno.getLong("id")); | ||||
|             DynamicObject cimFinsubscribe = BusinessDataServiceHelper.loadSingle("cim_finsubscribe", qFilter.toArray()); | ||||
|             if (null != cimFinsubscribe) { | ||||
|                 this.getView().getModel().setValue("shjh_xjglcp",cimFinsubscribe.getString("shjh_xjglcp")); | ||||
|                 this.getView().updateView("shjh_xjglcp"); | ||||
|                 //字段【赎回份数】默认为赎回日期剩余份额,可手工修改。 | ||||
|                 this.getView().getModel().setValue("copies",cimFinsubscribe.getBigDecimal("surpluscopies")); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|     } | ||||
| } | ||||
|  | @ -48,6 +48,7 @@ public class PayBillSubmitOperation extends AbstractOperationServicePlugIn imple | |||
|                             sourcesystem = bill.getString("shjh_sourcesystem");//来源系统:SAP_A 费控_B | ||||
|                         }catch (Exception e){ | ||||
|                             bill = BusinessDataServiceHelper.loadSingle(bill.getPkValue(),"cas_paybill"); | ||||
|                             sourcesystem = bill.getString("shjh_sourcesystem");//来源系统:SAP_A 费控_B | ||||
|                         } | ||||
|                         boolean shjhSapvalidate = bill.getBoolean("shjh_sapvalidate");//SAP校验是否通过 | ||||
|                         //付款单提交时,调用SAP应付凭证数据校验接口,校验不通过,弹框提示用户具体原因;如果校验通过,则标记;后续再提交时无需校验。 | ||||
|  |  | |||
|  | @ -25,6 +25,7 @@ import shjh.jhzj7.fi.fi.utils.domin.ResponseData; | |||
| 
 | ||||
| import java.math.BigDecimal; | ||||
| import java.text.SimpleDateFormat; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Arrays; | ||||
| import java.util.Date; | ||||
| import java.util.List; | ||||
|  | @ -433,15 +434,18 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl | |||
|         // 票据信息 | ||||
|         DynamicObjectCollection casDraftinfos = bill.getDynamicObjectCollection("cas_draftinfo"); | ||||
|         if (!casDraftinfos.isEmpty()) { | ||||
| 
 | ||||
|             List<String> draftbillnos = new ArrayList<>(); | ||||
|             // 缓存所有票据号码:draftbillno | ||||
|             List<String> draftbillnos = casDraftinfos.stream() | ||||
|                     .map(d -> d.getString("draftbillno")) | ||||
|                     .collect(Collectors.toList()); | ||||
|             for (DynamicObject casDraftinfo : casDraftinfos) { | ||||
|                 DynamicObject draftbillinfo = casDraftinfo.getDynamicObject("draftbillinfo"); | ||||
|                 if (null != draftbillinfo) { | ||||
|                     draftbillnos.add(draftbillinfo.getString("draftbillno")); | ||||
|                 } | ||||
|             } | ||||
|             // 批量查询收款单:casRecbills | ||||
|             QFilter q2 = new QFilter("openorg.number", QCP.equals, BUKRS); | ||||
|             List<QFilter> allFilters = draftbillnos.stream() | ||||
|                     .map(d -> new QFilter("cas_draftinfo.draftbillno", QCP.equals, d)) | ||||
|                     .map(d -> new QFilter("cas_draftinfo.draftbillinfo.draftbillno", QCP.equals, d)) | ||||
|                     .collect(Collectors.toList()); | ||||
|             allFilters.add(q2); | ||||
|             QFilter[] filtersArray = allFilters.toArray(new QFilter[0]); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue