|
@@ -18,8 +18,14 @@ import kd.bos.form.FormShowParameter;
|
|
|
import kd.bos.form.ShowType;
|
|
|
import kd.bos.form.control.EntryGrid;
|
|
|
import kd.bos.form.control.Toolbar;
|
|
|
-import kd.bos.form.control.events.*;
|
|
|
-import kd.bos.form.events.*;
|
|
|
+import kd.bos.form.control.events.BeforeItemClickEvent;
|
|
|
+import kd.bos.form.control.events.ItemClickEvent;
|
|
|
+import kd.bos.form.control.events.RowClickEvent;
|
|
|
+import kd.bos.form.control.events.RowClickEventListener;
|
|
|
+import kd.bos.form.events.AfterDoOperationEventArgs;
|
|
|
+import kd.bos.form.events.BeforeDoOperationEventArgs;
|
|
|
+import kd.bos.form.events.ClosedCallBackEvent;
|
|
|
+import kd.bos.form.events.PreOpenFormEventArgs;
|
|
|
import kd.bos.form.operate.FormOperate;
|
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
import kd.bos.list.ListShowParameter;
|
|
@@ -31,9 +37,9 @@ import kd.bos.servicehelper.operation.OperationServiceHelper;
|
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
|
import kd.bos.servicehelper.permission.PermissionServiceHelper;
|
|
|
import kd.bos.util.CollectionUtils;
|
|
|
+import nckd.jimin.jyyy.fi.common.constant.BillTypeConstants;
|
|
|
import nckd.jimin.jyyy.fi.common.constant.ErPrintUserConstant;
|
|
|
import nckd.jimin.jyyy.fi.common.constant.ErReimBurseBillConstant;
|
|
|
-import nckd.jimin.jyyy.fi.common.constant.BillTypeConstants;
|
|
|
import nckd.jimin.jyyy.fi.common.constant.HandInReceiveTicketConstant;
|
|
|
import nckd.jimin.jyyy.fi.common.entity.MergePrintEntity;
|
|
|
import nckd.jimin.jyyy.fi.common.util.ErFindRelationBillUtils;
|
|
@@ -71,13 +77,13 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
|
|
|
if(CollectionUtils.isEmpty(scanTypeCol)){
|
|
|
e.setCancel(true);
|
|
|
- e.setCancelMessage(ResManager.loadKDString("请先配置用户登记后再操作。","",""));
|
|
|
+ e.setCancelMessage("请先配置用户登记后再操作。");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if(scanTypeCol.size() > 1){
|
|
|
e.setCancel(true);
|
|
|
- e.setCancelMessage(ResManager.loadKDString("用户登记存在多条有效数据,请处理后再操作。","",""));
|
|
|
+ e.setCancelMessage("用户登记存在多条有效数据,请处理后再操作。");
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -108,20 +114,33 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
if(findNumberOp.isPresent()){
|
|
|
return;
|
|
|
}
|
|
|
- String selector = String.join(",",ErReimBurseBillConstant.ID,ErReimBurseBillConstant.KEY_BILLNO,ErReimBurseBillConstant.KEY_COSTCOMPANY,
|
|
|
- ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON,ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON);
|
|
|
- // 查询费用报销单
|
|
|
- DynamicObject reimBurseBill = BusinessDataServiceHelper.loadSingle(ErReimBurseBillConstant.ENTITYID,selector,
|
|
|
- new QFilter(ErReimBurseBillConstant.KEY_BILLNO, QCP.equals, scanNumber).toArray());
|
|
|
- if(reimBurseBill != null){
|
|
|
- addScanBillEntry(reimBurseBill.getString(ErReimBurseBillConstant.KEY_BILLNO),getReceiptStatus(reimBurseBill),
|
|
|
- reimBurseBill.get(ErReimBurseBillConstant.ID), ErReimBurseBillConstant.ENTITYID,
|
|
|
- reimBurseBill.getDynamicObject(ErReimBurseBillConstant.KEY_COSTCOMPANY).getPkValue());
|
|
|
- return;
|
|
|
+
|
|
|
+ String[] findBillArray = new String[]{BillTypeConstants.ER_PUBLICREIMBURSEBILL,BillTypeConstants.ER_DAILYREIMBURSEBILL,
|
|
|
+ BillTypeConstants.ER_TRIPREIMBURSEBILL,BillTypeConstants.ER_CHECKINGPAYBILL,BillTypeConstants.ER_PREPAYBILL};
|
|
|
+ for(String billType : findBillArray){
|
|
|
+ Boolean isFind = loadBillInfo(billType, scanNumber);
|
|
|
+ if(isFind){
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ protected Boolean loadBillInfo(String billlType , String billNo){
|
|
|
+ String selector = String.join(",",ErReimBurseBillConstant.ID,ErReimBurseBillConstant.KEY_BILLNO,ErReimBurseBillConstant.KEY_COMPANY,
|
|
|
+ ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON,ErReimBurseBillConstant.KEY_NCKD_RECEIPT_PERSON);
|
|
|
+ DynamicObject tripReimBurseBill = BusinessDataServiceHelper.loadSingle(billlType,selector,
|
|
|
+ new QFilter(ErReimBurseBillConstant.KEY_BILLNO, QCP.equals, billNo).toArray());
|
|
|
+ if(tripReimBurseBill != null){
|
|
|
+ addScanBillEntry(tripReimBurseBill.getString(ErReimBurseBillConstant.KEY_BILLNO),getReceiptStatus(tripReimBurseBill),
|
|
|
+ tripReimBurseBill.get(ErReimBurseBillConstant.ID), billlType,
|
|
|
+ tripReimBurseBill.getDynamicObject(ErReimBurseBillConstant.KEY_COMPANY).getPkValue());
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
protected String getReceiptStatus(DynamicObject billInfo){
|
|
|
// 未交票
|
|
|
if(billInfo.getDynamicObject(ErReimBurseBillConstant.KEY_NCKD_HANDIN_PERSON) == null){
|
|
@@ -165,6 +184,17 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
public void beforeItemClick(BeforeItemClickEvent evt) {
|
|
|
super.beforeItemClick(evt);
|
|
|
String itemKey = evt.getItemKey();
|
|
|
+
|
|
|
+ if(HandInReceiveTicketConstant.OPERATE.NCKD_MAIL.equals(itemKey) || HandInReceiveTicketConstant.OPERATE.NCKD_CANCELMAIN.equals(itemKey)
|
|
|
+ || HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_VOUCHER.equals(itemKey) || HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_ELECRECEIPT.equals(itemKey)){
|
|
|
+ String checkMsg = checkSelectSingle();
|
|
|
+ if(!StringUtils.isEmpty(checkMsg)) {
|
|
|
+ getView().showTipNotification(checkMsg);
|
|
|
+ evt.setCancel(true);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
switch (itemKey){
|
|
|
case HandInReceiveTicketConstant.OPERATE.NCKD_MAIL:
|
|
|
beforeMail(evt);
|
|
@@ -176,12 +206,6 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
}
|
|
|
|
|
|
protected void beforeMail(BeforeItemClickEvent evt){
|
|
|
- String checkMsg = checkSelectSingle();
|
|
|
- if(!StringUtils.isEmpty(checkMsg)) {
|
|
|
- getView().showTipNotification(checkMsg);
|
|
|
- evt.setCancel(true);
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
DynamicObject selectRow = getSelectRows().get(0);
|
|
|
// 快递编号为空
|
|
@@ -189,23 +213,17 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_FORMID), ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER);
|
|
|
|
|
|
if(!StringUtils.isEmpty(billInfo.getString(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER))){
|
|
|
- getView().showTipNotification(ResManager.loadKDString("单据快递单号不为空,请先进行退邮操作。","",""));
|
|
|
+ getView().showTipNotification("不允许重复邮寄。");
|
|
|
evt.setCancel(true);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
protected void beforeCancleMail(BeforeItemClickEvent evt){
|
|
|
- String checkMsg = checkSelectSingle();
|
|
|
- if(!StringUtils.isEmpty(checkMsg)) {
|
|
|
- getView().showTipNotification(checkMsg);
|
|
|
- evt.setCancel(true);
|
|
|
- return;
|
|
|
- }
|
|
|
// 快递编号为空
|
|
|
DynamicObject billInfo = getSelectBillInfo(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER);
|
|
|
|
|
|
if(StringUtils.isEmpty(billInfo.getString(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER))){
|
|
|
- getView().showTipNotification(ResManager.loadKDString("单据没有进行邮寄操作。","",""));
|
|
|
+ getView().showTipNotification("单据没有进行邮寄操作。");
|
|
|
evt.setCancel(true);
|
|
|
return;
|
|
|
}
|
|
@@ -231,6 +249,8 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
break;
|
|
|
case HandInReceiveTicketConstant.OPERATE.NCKD_VIEW_ELECRECEIPT:
|
|
|
doViewElecReceipt();
|
|
|
+ case HandInReceiveTicketConstant.OPERATE.NCKD_REFRESH:
|
|
|
+ doRefresh();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -274,10 +294,10 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
this.getView().showForm(showParameter);
|
|
|
}
|
|
|
}else{
|
|
|
- this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi", new Object[0]));
|
|
|
+ this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi"));
|
|
|
}
|
|
|
}else{
|
|
|
- this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi", new Object[0]));
|
|
|
+ this.getView().showTipNotification(ResManager.loadKDString("单据没有关联的凭证。", "TraceVoucher_2", "bos-ext-fi"));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -285,6 +305,16 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
|
|
|
}
|
|
|
|
|
|
+ protected void doRefresh(){
|
|
|
+
|
|
|
+ int entryRowCount = getModel().getEntryRowCount(HandInReceiveTicketConstant.SCANBILLENTRY.ENTITYID);
|
|
|
+ int[] allRow = new int[entryRowCount];
|
|
|
+ for(int i = 0 ; i< entryRowCount ; i++){
|
|
|
+ allRow[i] = i ;
|
|
|
+ }
|
|
|
+ reloadEntryRow(allRow);
|
|
|
+ }
|
|
|
+
|
|
|
protected void doMail(){
|
|
|
|
|
|
FormShowParameter parameter = new FormShowParameter();
|
|
@@ -299,7 +329,7 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
DynamicObject billInfo = getSelectBillInfo(String.join(",",ErReimBurseBillConstant.KEY_BILLNO,ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER));
|
|
|
billInfo.set(ErReimBurseBillConstant.KEY_NCKD_TRACKING_NUMBER,null);
|
|
|
SaveServiceHelper.save(new DynamicObject[]{ billInfo });
|
|
|
- getView().showSuccessNotification(String.format(ResManager.loadKDString("单据%1$s退邮成功。","",""),billInfo.getString(ErReimBurseBillConstant.KEY_BILLNO)));
|
|
|
+ getView().showSuccessNotification("退邮成功。");
|
|
|
}
|
|
|
|
|
|
|
|
@@ -381,10 +411,10 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
protected String checkSelectSingle(){
|
|
|
List<DynamicObject> selectRows = getSelectRows();
|
|
|
if(selectRows.size() == 0){
|
|
|
- return ResManager.loadKDString("请选择要执行的数据。","","");
|
|
|
+ return "请选择要执行的数据。";
|
|
|
}
|
|
|
if(selectRows.size() > 1){
|
|
|
- return ResManager.loadKDString("请选择一条数据进行操作。","","");
|
|
|
+ return "仅允许选择一条数据进行操作。";
|
|
|
}
|
|
|
return "";
|
|
|
}
|
|
@@ -397,8 +427,8 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
|
|
|
// 通过打印配置获取单据打印信息
|
|
|
List<MergePrintEntity> printPdfConfig = ReceiveTicketUtils.getPrintPdfConfig(formId,billId,companyId);
|
|
|
-
|
|
|
- String downloadUrl = ReceiveTicketUtils.mergePrintPdf(getView(), printPdfConfig, "报销单附件打印.pdf");
|
|
|
+ String printFileName = String.format("%s报销信息打印",selectRow.getString(HandInReceiveTicketConstant.SCANBILLENTRY.KEY_NCKD_NUMBER));
|
|
|
+ String downloadUrl = ReceiveTicketUtils.mergePrintPdf(getView(), printPdfConfig, printFileName);
|
|
|
getView().download(downloadUrl);
|
|
|
}
|
|
|
|
|
@@ -453,7 +483,7 @@ public class HandInReceiveTicketPlugin extends AbstractFormPlugin implements Row
|
|
|
|
|
|
// 全部成功弹出消息提示,否则弹出操作提示框
|
|
|
if(opResult.isSuccess()){
|
|
|
- getView().showSuccessNotification(String.format(ResManager.loadKDString("执行【%1$s】操作成功!","",""),operateName));
|
|
|
+ getView().showSuccessNotification(String.format("执行【%1$s】操作成功!",operateName));
|
|
|
}else{
|
|
|
getView().showOperationResult(opResult);
|
|
|
}
|