parent
							
								
									955b284593
								
							
						
					
					
						commit
						d95b59cfb4
					
				|  | @ -0,0 +1,44 @@ | |||
| package shjh.jhzj7.fi.fi.plugin.form; | ||||
| 
 | ||||
| import kd.bos.dataentity.entity.DynamicObject; | ||||
| import kd.bos.entity.EntityMetadataCache; | ||||
| import kd.bos.entity.datamodel.ListSelectedRowCollection; | ||||
| import kd.bos.form.control.events.BeforeItemClickEvent; | ||||
| import kd.bos.list.BillList; | ||||
| import kd.bos.list.plugin.AbstractListPlugin; | ||||
| import kd.bos.orm.query.QCP; | ||||
| import kd.bos.orm.query.QFilter; | ||||
| import kd.bos.servicehelper.BusinessDataServiceHelper; | ||||
| import kd.bos.util.StringUtils; | ||||
| import kd.sdk.plugin.Plugin; | ||||
| 
 | ||||
| /** | ||||
|  * 认领处理单监听变更操作列表插件 | ||||
|  */ | ||||
| public class ClaimChangeListPlugin extends AbstractListPlugin implements Plugin { | ||||
| 
 | ||||
|     @Override | ||||
|     public void beforeItemClick(BeforeItemClickEvent evt) { | ||||
|         super.beforeItemClick(evt); | ||||
| 
 | ||||
|         String key = evt.getItemKey().toLowerCase(); | ||||
|         if ("baritemap1".equals(key)) { | ||||
|             BillList list = (BillList) this.getView().getControl("billlistap"); | ||||
|             ListSelectedRowCollection selectedRows = list.getSelectedRows(); | ||||
|             //认领单变更操作,查询源单为该认领单的收款单,若未推送SAP(凭证号为空),校验不许变更 | ||||
|             DynamicObject claimbill= BusinessDataServiceHelper.loadSingle(selectedRows.get(0).getPrimaryKeyValue(), | ||||
|                     EntityMetadataCache.getDataEntityType("cas_claimbill")); | ||||
|             if (null != claimbill) { | ||||
|                 QFilter qFilter = new QFilter("sourcebillnumber", QCP.equals, claimbill.getString("claimno")); | ||||
|                 DynamicObject casRecbill = BusinessDataServiceHelper.loadSingle("cas_recbill", qFilter.toArray()); | ||||
|                 if (null != casRecbill) { | ||||
|                     String shjhVouchernum = casRecbill.getString("shjh_vouchernum"); | ||||
|                     if (StringUtils.isEmpty(shjhVouchernum)) { | ||||
|                         this.getView().showTipNotification(claimbill.getString("billno") + "对应的收款单未推送至SAP,不允许变更"); | ||||
|                         evt.setCancel(true); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Loading…
	
		Reference in New Issue