其他出入库单、其他出入库申请单、采购订单列表插件刷新
This commit is contained in:
parent
7a71daf5e2
commit
572dace97a
|
|
@ -22,6 +22,7 @@ import java.util.Set;
|
||||||
*/
|
*/
|
||||||
public class PurOrderBillUpdatasfkzshListPlugin extends AbstractListPlugin implements Plugin {
|
public class PurOrderBillUpdatasfkzshListPlugin extends AbstractListPlugin implements Plugin {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void itemClick(ItemClickEvent evt) {
|
public void itemClick(ItemClickEvent evt) {
|
||||||
super.itemClick(evt);
|
super.itemClick(evt);
|
||||||
|
|
@ -65,9 +66,10 @@ public class PurOrderBillUpdatasfkzshListPlugin extends AbstractListPlugin imple
|
||||||
}
|
}
|
||||||
if (msg.length() > 0) {
|
if (msg.length() > 0) {
|
||||||
msg.deleteCharAt(msg.length() - 1);
|
msg.deleteCharAt(msg.length() - 1);
|
||||||
this.getView().showTipNotification("单据【"+msg+"】未审核,不能更新【是否可做收获通知】");
|
this.getView().showTipNotification("单据【"+msg+"】未审核,不能更新【是否可做收货通知】");
|
||||||
}
|
}
|
||||||
|
this.getView().showSuccessNotification("查询成功");
|
||||||
|
this.getView().invokeOperation("refresh");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,31 +1,16 @@
|
||||||
package tqq9.lc123.cloud.app.plugin.form.result;
|
package tqq9.lc123.cloud.app.plugin.form.result;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import kd.bos.context.RequestContext;
|
import kd.bos.context.RequestContext;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
|
||||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
||||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
|
||||||
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||||
import kd.bos.entity.datamodel.events.PackageDataEvent;
|
import kd.bos.entity.datamodel.events.PackageDataEvent;
|
||||||
import kd.bos.list.BillList;
|
import kd.bos.list.BillList;
|
||||||
import kd.bos.list.plugin.AbstractListPlugin;
|
import kd.bos.list.plugin.AbstractListPlugin;
|
||||||
import kd.bos.logging.Log;
|
import kd.bos.logging.Log;
|
||||||
import kd.bos.logging.LogFactory;
|
import kd.bos.logging.LogFactory;
|
||||||
import kd.bos.orm.query.QCP;
|
|
||||||
import kd.bos.orm.query.QFilter;
|
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
||||||
import kd.bos.servicehelper.QueryServiceHelper;
|
|
||||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
||||||
import kd.sdk.plugin.Plugin;
|
import kd.sdk.plugin.Plugin;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
|
|
||||||
import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
|
|
||||||
import tqq9.lc123.cloud.app.plugin.utils.FWUtils;
|
|
||||||
|
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标准单据列表插件
|
* 标准单据列表插件
|
||||||
|
|
@ -40,73 +25,15 @@ public class OtherInApplyWorkflowDataListPlugin extends AbstractListPlugin imple
|
||||||
super.afterBindData(e);
|
super.afterBindData(e);
|
||||||
BillList b = this.getView().getControl("billlistap");
|
BillList b = this.getView().getControl("billlistap");
|
||||||
ListSelectedRowCollection currentListAllRowCollection = b.getCurrentListAllRowCollection();
|
ListSelectedRowCollection currentListAllRowCollection = b.getCurrentListAllRowCollection();
|
||||||
Set<Long> idSet = new HashSet<>();
|
String billSign = b.getBillFormId();
|
||||||
for (ListSelectedRow row : currentListAllRowCollection) {
|
Boolean result = FWImpl.WorkflowData(billSign, currentListAllRowCollection);
|
||||||
Long primaryKeyValue = (Long) row.getPrimaryKeyValue();
|
if (result) {
|
||||||
idSet.add(primaryKeyValue);
|
log.info("调用成功");
|
||||||
}
|
} else {
|
||||||
//获取第三方配置表的泛微用户ID
|
log.info("没有获取到泛微用户ID,当前用户ID:" + RequestContext.get().getCurrUserId());
|
||||||
String userid = ConfigUtils.getThirdConfigByNumber("FW_WorkFlowInfo_UserId");
|
|
||||||
|
|
||||||
QFilter f = new QFilter("id", "in", idSet);
|
|
||||||
DynamicObject[] billArr = BusinessDataServiceHelper.load("tqq9_otherinapply",
|
|
||||||
"id,billno,tqq9_fwrequestid,tqq9_fwstate,tqq9_auditor,tqq9_auditornode", new QFilter[]{f});
|
|
||||||
for (DynamicObject tqq9_otherinapply : billArr) {
|
|
||||||
String billno = tqq9_otherinapply.getString("billno");
|
|
||||||
log.info("billno:" + billno);
|
|
||||||
String tqq9_fwrequestid = tqq9_otherinapply.getString("tqq9_fwrequestid");
|
|
||||||
String tqq9_fwstate = tqq9_otherinapply.getString("tqq9_fwstate");
|
|
||||||
if (StringUtils.isNotBlank(tqq9_fwrequestid) && "B".equals(tqq9_fwstate)) {
|
|
||||||
if (StringUtils.isBlank(userid)) {
|
|
||||||
//获取当前用户id对应的泛微用户ID
|
|
||||||
Long id = RequestContext.get().getCurrUserId();
|
|
||||||
QFilter f1 = new QFilter("id", "=", id);
|
|
||||||
QFilter f2 = new QFilter("entryentity.ispartjob", "=", false);
|
|
||||||
DynamicObject bos_user = QueryServiceHelper.queryOne("bos_user", "id,entryentity.tqq9_fwuserid", new QFilter[]{f1, f2});
|
|
||||||
if (bos_user != null) {
|
|
||||||
userid = bos_user.getString("entryentity.tqq9_fwuserid");
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(userid)) {
|
|
||||||
log.info("没有获取到泛微用户ID,当前用户ID:" + id);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String requestName = "FW_获取流程流转数据";
|
|
||||||
//调用泛微接口获取下一步处理人
|
|
||||||
String bodyString = FWRestfulUtils.getRequest(requestName, billno, tqq9_fwrequestid, userid);
|
|
||||||
log.info("billno:" + billno + ",bodyString:" + bodyString);
|
|
||||||
JSONObject map = JSONObject.parseObject(bodyString);
|
|
||||||
if (map != null) {
|
|
||||||
JSONArray data = map.getJSONArray("data");//节点id
|
|
||||||
if (data != null && data.size() > 0) {
|
|
||||||
String nodeName = null;
|
|
||||||
String fwuserid = null;
|
|
||||||
for (int i = 0; i < data.size(); i++) {
|
|
||||||
JSONObject data0 = (JSONObject) data.get(i);
|
|
||||||
Integer isremark = data0.getInteger("isremark");
|
|
||||||
nodeName = data0.getString("nodeName");
|
|
||||||
if (StringUtils.isNotBlank(nodeName) && isremark != null) {
|
|
||||||
if (isremark == 0 && !nodeName.contains("归档")) {
|
|
||||||
fwuserid = String.valueOf(data0.getInteger("userid"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(fwuserid)) {
|
|
||||||
DynamicObject[] fwuserArr = BusinessDataServiceHelper.load("bos_user", "id,name,number",
|
|
||||||
new QFilter[]{new QFilter("entryentity.tqq9_fwuserid", QCP.equals, fwuserid)});
|
|
||||||
if (fwuserArr != null && fwuserArr.length > 0) {
|
|
||||||
tqq9_otherinapply.set("tqq9_auditor", fwuserArr[0]);//待审批人
|
|
||||||
tqq9_otherinapply.set("tqq9_auditornode", nodeName);//节点名称
|
|
||||||
SaveServiceHelper.save(new DynamicObject[]{tqq9_otherinapply});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void packageData(PackageDataEvent e) {
|
public void packageData(PackageDataEvent e) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package tqq9.lc123.cloud.app.plugin.form.result;
|
||||||
|
|
||||||
|
import kd.bos.context.RequestContext;
|
||||||
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||||
|
import kd.bos.list.BillList;
|
||||||
|
import kd.bos.list.plugin.AbstractListPlugin;
|
||||||
|
import kd.bos.logging.Log;
|
||||||
|
import kd.bos.logging.LogFactory;
|
||||||
|
import kd.sdk.plugin.Plugin;
|
||||||
|
import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*其他入库单列表插件
|
||||||
|
*FW—获取流程流转数据 接口调用获取下一步处理人、节点名称
|
||||||
|
*/
|
||||||
|
public class OtherInWorkflowDataListPlugin extends AbstractListPlugin implements Plugin {
|
||||||
|
private static final Log log = LogFactory.getLog(OtherInApplyWorkflowDataListPlugin.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterBindData(EventObject e) {
|
||||||
|
super.afterBindData(e);
|
||||||
|
BillList b = this.getView().getControl("billlistap");
|
||||||
|
ListSelectedRowCollection currentListAllRowCollection = b.getCurrentListAllRowCollection();
|
||||||
|
String billSign = b.getBillFormId();
|
||||||
|
Boolean result = FWImpl.WorkflowData(billSign, currentListAllRowCollection);
|
||||||
|
if (result) {
|
||||||
|
log.info("调用成功");
|
||||||
|
} else {
|
||||||
|
log.info("没有获取到泛微用户ID,当前用户ID:" + RequestContext.get().getCurrUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package tqq9.lc123.cloud.app.plugin.form.result;
|
||||||
|
|
||||||
|
import kd.bos.context.RequestContext;
|
||||||
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||||
|
import kd.bos.list.BillList;
|
||||||
|
import kd.bos.list.plugin.AbstractListPlugin;
|
||||||
|
import kd.bos.logging.Log;
|
||||||
|
import kd.bos.logging.LogFactory;
|
||||||
|
import kd.sdk.plugin.Plugin;
|
||||||
|
import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他出库申请单列表插件
|
||||||
|
* FW—获取流程流转数据 接口调用获取下一步处理人、节点名称
|
||||||
|
*/
|
||||||
|
public class OtherOutApplyWorkflowDataListPlugin extends AbstractListPlugin implements Plugin {
|
||||||
|
private static final Log log = LogFactory.getLog(OtherInApplyWorkflowDataListPlugin.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterBindData(EventObject e) {
|
||||||
|
super.afterBindData(e);
|
||||||
|
BillList b = this.getView().getControl("billlistap");
|
||||||
|
ListSelectedRowCollection currentListAllRowCollection = b.getCurrentListAllRowCollection();
|
||||||
|
String billSign = b.getBillFormId();
|
||||||
|
Boolean result = FWImpl.WorkflowData(billSign, currentListAllRowCollection);
|
||||||
|
if (result) {
|
||||||
|
log.info("调用成功");
|
||||||
|
} else {
|
||||||
|
log.info("没有获取到泛微用户ID,当前用户ID:" + RequestContext.get().getCurrUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package tqq9.lc123.cloud.app.plugin.form.result;
|
||||||
|
|
||||||
|
import kd.bos.context.RequestContext;
|
||||||
|
import kd.bos.entity.datamodel.ListSelectedRowCollection;
|
||||||
|
import kd.bos.list.BillList;
|
||||||
|
import kd.bos.list.plugin.AbstractListPlugin;
|
||||||
|
import kd.bos.logging.Log;
|
||||||
|
import kd.bos.logging.LogFactory;
|
||||||
|
import kd.sdk.plugin.Plugin;
|
||||||
|
import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*其他出库单列表插件
|
||||||
|
*FW—获取流程流转数据 接口调用获取下一步处理人、节点名称
|
||||||
|
*/
|
||||||
|
public class OtherOutWorkflowDataListPlugin extends AbstractListPlugin implements Plugin {
|
||||||
|
private static final Log log = LogFactory.getLog(OtherInApplyWorkflowDataListPlugin.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterBindData(EventObject e) {
|
||||||
|
super.afterBindData(e);
|
||||||
|
BillList b = this.getView().getControl("billlistap");
|
||||||
|
ListSelectedRowCollection currentListAllRowCollection = b.getCurrentListAllRowCollection();
|
||||||
|
String billSign = b.getBillFormId();
|
||||||
|
Boolean result = FWImpl.WorkflowData(billSign, currentListAllRowCollection);
|
||||||
|
if (result) {
|
||||||
|
log.info("调用成功");
|
||||||
|
} else {
|
||||||
|
log.info("没有获取到泛微用户ID,当前用户ID:" + RequestContext.get().getCurrUserId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue