共享任务中心审批检查

This commit is contained in:
zhangzhiguo 2025-06-28 18:14:43 +08:00
parent 3ab1d6815d
commit d3e6c72bab
1 changed files with 54 additions and 34 deletions

View File

@ -8,20 +8,37 @@ import kd.bos.form.control.Control;
import kd.bos.form.control.events.BeforeClickEvent;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.ssc.task.formplugin.util.VoucherUtil;
import java.util.EventObject;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* 我的共享任务审批时增加付款完成校验
*/
public class TaskApproveFormCkPlugin extends AbstractFormPlugin {
private static final Log log = LogFactory.getLog(TaskApproveFormCkPlugin.class);
private static Set<String> billTypes = new HashSet<String>();
static {
billTypes.add("er_repaymentbill");
billTypes.add("er_dailyreimbursebill");
billTypes.add("er_publicreimbursebill");
billTypes.add("er_tripreimbursebill");
billTypes.add("er_dailyloanbill");
billTypes.add("er_prepaybill");
billTypes.add("er_applypaybill");
billTypes.add("cas_paybill");
}
//
public void registerListener(EventObject evt) {
this.addClickListeners(new String[]{"submit", "submitandnext"});
@ -48,13 +65,20 @@ public class TaskApproveFormCkPlugin extends AbstractFormPlugin {
String billid = "";
String billNo = null;
if (customParams != null) {
log.info("TaskApproveFormCkPlugin"+customParams.toString());
log.info("TaskApproveFormCkPluginbilltypeid "+customParams.get("billtypeid"));
log.info("TaskApproveFormCkPlugintasktypeid "+customParams.get("tasktypeid"));
log.info("TaskApproveFormCkPluginsscid "+customParams.get("sscid"));
log.info("TaskApproveFormCkPluginbillnumber "+customParams.get("billnumber"));
log.info("TaskApproveFormCkPluginbillid "+customParams.get("billid"));
billtypeid = (Long)customParams.get("billtypeid");//单据类型id
tasktypeid = (Long)customParams.get("tasktypeid");//任务类型id
sscid = (Long)customParams.get("sscid");//任务类型id
sscid = Long.valueOf((String)customParams.get("sscid"));//任务类型id
billnumber = (String)customParams.get("billnumber");//单据编码单据标识 entityName
billid = (String)customParams.get("billid");//业务单据id
billNo = VoucherUtil.getTaskBillNo(billid);//业务单据编号
if(billTypes.contains(billnumber)){
IDataModel model = this.getModel();
String operation = (String)model.getValue("operationgroupfield");
if ("1".equals(operation)) { //如果审批操作是通过
@ -63,7 +87,7 @@ public class TaskApproveFormCkPlugin extends AbstractFormPlugin {
DynamicObject[] tasktypeArray = BusinessDataServiceHelper.load("task_tasktype", "id", new QFilter[]{tasktypeFilter});
if(tasktypeArray != null && tasktypeArray.length > 0){
DynamicObject tasktype = tasktypeArray[0];
if(tasktypeid.getLong("id") == tasktype.getLong("id")) {
if(tasktypeid == tasktype.getLong("id")) {
if(StringUtils.isNotBlank(billNo) && StringUtils.isNotBlank(billid) && StringUtils.isNotBlank(billnumber) ) {
QFilter accountTableFilter = new QFilter("id", QCP.equals,Long.valueOf(billid));
DynamicObject sourceBillObject = BusinessDataServiceHelper.loadSingle(billnumber, new QFilter[]{accountTableFilter});
@ -89,13 +113,9 @@ public class TaskApproveFormCkPlugin extends AbstractFormPlugin {
}
}
}
}
}
//System.out.println(billtypeid);
//System.out.println(tasktypeid);
//System.out.println(billnumber);
//System.out.println(billid);
//System.out.println(billNo);
}
}