insert into pub_function
(ARGUMENTS,
CLASSNAME,
CODE,
DR,
FUNCTIONNOTE,
FUNCTIONNOTE_RESID,
FUNCTYPE,
HINTMESSAGE,
ISCOMP,
METHODNAME,
PK_BILLTYPE,
PK_BILLTYPEID,
PK_FUNCTION,
RETURNTYPE,
TS)
values
('nc.vo.pub.AggregatedValueObject:01',
'nc.pf.so.function.Send30ToBPM',
'SO30-GH',
0,
'低价销售发送至bpm',
'低价销售发送至bpm',
0,
'',
'',
'send30tobpm',
'30',
'30',
'1001A81000000000CTF6',
'BOOLEAN',
'2021-08-05 22:38:39');
package nc.pf.so.function;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import nc.bs.framework.common.InvocationInfoProxy;
import nc.bs.framework.common.NCLocator;
import nc.itf.htjck.pub.IPublicToolsService;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.so.m30.entity.SaleOrderBVO;
import nc.vo.so.m30.entity.SaleOrderVO;
import nc.vo.pub.BusinessException;
public class SendSOToBPM {
public UFBoolean sendsotobpm(AggregatedValueObject billvo) throws BusinessException {
IPublicToolsService service=NCLocator.getInstance().lookup(IPublicToolsService.class);
SaleOrderVO bill = (SaleOrderVO)billvo;
String billid=service.getStrFsql("select billid from pub_workflownote where billno='"+bill.getParentVO().getVbillcode()+"' and approvestatus='0' and checkman='1001A11000000001OM7X'");
if(billid!=null) {
try {
Map<String, String> m;
m = service.GetViewAndFlowid("30");
if(m!=null&&m.size()>0) {
JSONObject json=service.GetSendJson(m.get("memo"), billvo.getParentVO().getPrimaryKey());
json.put("bpmtable", "so_saleorder_m");
json.put("bpmkeyname", "nccsaleorderid");
String billtype=m.get("shortname");
InvocationInfoProxy.getInstance().setProperty("billmaker",String.valueOf(billvo.getParentVO().getAttributeValue("billmaker")));
service.SendToBPM(billtype, "销售订单", json);
}
} catch (Exception e) {
throw new BusinessException(e.getMessage());
}
}
return new UFBoolean(true);
}
}