52 lines
2.2 KiB
Java
52 lines
2.2 KiB
Java
|
|
package tqq9.lc123.cloud.app.plugin.operate.im;
|
||
|
|
|
||
|
|
import com.alibaba.fastjson.JSONObject;
|
||
|
|
import kd.bos.dataentity.entity.DynamicObject;
|
||
|
|
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||
|
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||
|
|
import kd.bos.entity.plugin.args.BeforeOperationArgs;
|
||
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||
|
|
import org.apache.commons.lang3.StringUtils;
|
||
|
|
import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 其他出库单--按钮 tqq9_pushexprno
|
||
|
|
* 推送快递单号到泛微
|
||
|
|
*/
|
||
|
|
public class OtherOutPushExprnoOp extends AbstractOperationServicePlugIn {
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
|
||
|
|
super.beforeExecuteOperationTransaction(e);
|
||
|
|
DynamicObject[] dataEntities = e.getDataEntities();
|
||
|
|
for (DynamicObject dataEntity : dataEntities) {
|
||
|
|
dataEntity = BusinessDataServiceHelper.loadSingle(dataEntity.getPkValue(), dataEntity.getDynamicObjectType().getName(),"creator,tqq9_entrywl.tqq9_kddh,tqq9_fwrequestid,billno");
|
||
|
|
DynamicObjectCollection wlEntries = dataEntity.getDynamicObjectCollection("tqq9_entrywl");
|
||
|
|
String kddh = "";
|
||
|
|
for (DynamicObject entity : wlEntries) {
|
||
|
|
String tqq9_kddh = entity.getString("tqq9_kddh");
|
||
|
|
kddh = kddh + "," + tqq9_kddh;
|
||
|
|
}
|
||
|
|
if(StringUtils.isNotBlank(kddh)){
|
||
|
|
kddh = kddh.substring(1);
|
||
|
|
}else{
|
||
|
|
continue;
|
||
|
|
}
|
||
|
|
|
||
|
|
String billno = dataEntity.getString("billno");
|
||
|
|
String tqq9_fwrequestid = dataEntity.getString("tqq9_fwrequestid");
|
||
|
|
JSONObject mainTable = new JSONObject();
|
||
|
|
mainTable.put("lcid", tqq9_fwrequestid);
|
||
|
|
mainTable.put("kddh", kddh);
|
||
|
|
|
||
|
|
DynamicObject creator = dataEntity.getDynamicObject("creator");
|
||
|
|
creator = BusinessDataServiceHelper.loadSingle(creator.getPkValue(),"bos_user");
|
||
|
|
String tqq9_fwuserid = creator.getString("tqq9_fwuserid");
|
||
|
|
|
||
|
|
FWRestfulUtils fwRestfulUtils = new FWRestfulUtils();
|
||
|
|
String resultStr = fwRestfulUtils.pushData(mainTable, tqq9_fwuserid, billno, "im_otheroutbill");
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|