资金计划催报
This commit is contained in:
parent
b2d2e36635
commit
18f734e36b
|
|
@ -19,13 +19,11 @@ import java.util.*;
|
||||||
|
|
||||||
import kd.bos.data.BusinessDataReader;
|
import kd.bos.data.BusinessDataReader;
|
||||||
import kd.bos.dataentity.OperateOption;
|
import kd.bos.dataentity.OperateOption;
|
||||||
import kd.bos.dataentity.metadata.IDataEntityType;
|
|
||||||
import kd.bos.entity.EntityMetadataCache;
|
import kd.bos.entity.EntityMetadataCache;
|
||||||
import kd.bos.entity.MainEntityType;
|
import kd.bos.entity.MainEntityType;
|
||||||
import kd.bos.entity.botp.runtime.ConvertOperationResult;
|
import kd.bos.entity.botp.runtime.ConvertOperationResult;
|
||||||
import kd.bos.entity.botp.runtime.PushArgs;
|
import kd.bos.entity.botp.runtime.PushArgs;
|
||||||
import kd.bos.entity.botp.runtime.SourceBillReport;
|
import kd.bos.entity.botp.runtime.SourceBillReport;
|
||||||
import kd.bos.entity.datamodel.IRefrencedataProvider;
|
|
||||||
import kd.bos.entity.datamodel.ListSelectedRow;
|
import kd.bos.entity.datamodel.ListSelectedRow;
|
||||||
import kd.bos.entity.operate.OperateOptionConst;
|
import kd.bos.entity.operate.OperateOptionConst;
|
||||||
import kd.bos.entity.operate.result.IOperateInfo;
|
import kd.bos.entity.operate.result.IOperateInfo;
|
||||||
|
|
@ -38,8 +36,8 @@ import kd.bos.workflow.engine.msg.info.MessageInfo;
|
||||||
|
|
||||||
public class JhzjUtils {
|
public class JhzjUtils {
|
||||||
private static final String jklogEntityName = "shjh_jklog";
|
private static final String jklogEntityName = "shjh_jklog";
|
||||||
public static final Long GROUPID = 100000l;//组织根节点ID
|
public static final Long GROUPID = 100000L;//组织根节点ID
|
||||||
public static final Long CNY = 1l;//人民币-币别ID
|
public static final Long CNY = 1L;//人民币-币别ID
|
||||||
|
|
||||||
private static final ILocaleString msgtag = new LocaleString("消息提醒");
|
private static final ILocaleString msgtag = new LocaleString("消息提醒");
|
||||||
|
|
||||||
|
|
@ -93,7 +91,7 @@ public class JhzjUtils {
|
||||||
*/
|
*/
|
||||||
public static String getTableHtml(List<DynamicObject> billlist){
|
public static String getTableHtml(List<DynamicObject> billlist){
|
||||||
|
|
||||||
StringBuffer tabstr = new StringBuffer();
|
StringBuilder tabstr = new StringBuilder();
|
||||||
tabstr.append("<table border='1'> ");
|
tabstr.append("<table border='1'> ");
|
||||||
//设置表头-10列
|
//设置表头-10列
|
||||||
tabstr.append("<thead> <tr> <th>认领通知单</th> <th>银行账号</th> <th>对方账号</th> <th>对方户名</th> <th>币种</th> <th>收款金额</th> ");
|
tabstr.append("<thead> <tr> <th>认领通知单</th> <th>银行账号</th> <th>对方账号</th> <th>对方户名</th> <th>币种</th> <th>收款金额</th> ");
|
||||||
|
|
@ -161,7 +159,7 @@ public class JhzjUtils {
|
||||||
EmailInfo emailInfo = new EmailInfo();
|
EmailInfo emailInfo = new EmailInfo();
|
||||||
emailInfo.setTitle(title);
|
emailInfo.setTitle(title);
|
||||||
emailInfo.setContent(content);
|
emailInfo.setContent(content);
|
||||||
List receivers = new ArrayList<>(1);
|
List<String> receivers = new ArrayList<>(1);
|
||||||
receivers.add(email);//增加接收人
|
receivers.add(email);//增加接收人
|
||||||
emailInfo.setReceiver(receivers);
|
emailInfo.setReceiver(receivers);
|
||||||
Map<String, Object> sendResult = EmailHandler.sendEmail(emailInfo);
|
Map<String, Object> sendResult = EmailHandler.sendEmail(emailInfo);
|
||||||
|
|
@ -191,7 +189,9 @@ public class JhzjUtils {
|
||||||
message.setSenderId(RequestContext.get().getCurrUserId());
|
message.setSenderId(RequestContext.get().getCurrUserId());
|
||||||
message.setType("notice_email");//消息类型的编号
|
message.setType("notice_email");//消息类型的编号
|
||||||
message.setNotifyType(MessageChannels.EMAIL.getNumber());//消息渠道的编号
|
message.setNotifyType(MessageChannels.EMAIL.getNumber());//消息渠道的编号
|
||||||
MessageCenterServiceHelper.sendMessage(message);
|
// MessageCenterServiceHelper.sendMessage(message);
|
||||||
|
List<MessageInfo> msgs = new ArrayList<>(1);
|
||||||
|
MessageCenterServiceHelper.batchSendMessages(msgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -219,7 +219,9 @@ public class JhzjUtils {
|
||||||
// notifyType.append(MessageChannels.EMAIL.getNumber()).append(",");
|
// notifyType.append(MessageChannels.EMAIL.getNumber()).append(",");
|
||||||
// notifyType.append(MessageChannels.WEIXINQY.getNumber());
|
// notifyType.append(MessageChannels.WEIXINQY.getNumber());
|
||||||
message.setNotifyType(MessageChannels.WEIXINQY.getNumber());//消息渠道的编号
|
message.setNotifyType(MessageChannels.WEIXINQY.getNumber());//消息渠道的编号
|
||||||
MessageCenterServiceHelper.sendMessage(message);
|
// MessageCenterServiceHelper.sendMessage(message);
|
||||||
|
List<MessageInfo> msgs = new ArrayList<>(1);
|
||||||
|
MessageCenterServiceHelper.batchSendMessages(msgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -305,8 +307,8 @@ public class JhzjUtils {
|
||||||
try (DataMutex dataMutex = DataMutex.create()) {
|
try (DataMutex dataMutex = DataMutex.create()) {
|
||||||
//如果需要和标准操作(如保存、提交、审核)互斥,则可使用default_netctrl(默认分组),不需要和标准操作互斥则需要用自定义的groupId
|
//如果需要和标准操作(如保存、提交、审核)互斥,则可使用default_netctrl(默认分组),不需要和标准操作互斥则需要用自定义的groupId
|
||||||
String entityKey = prinfo.getDataEntityType().getName();
|
String entityKey = prinfo.getDataEntityType().getName();
|
||||||
List mutexRequireList = new ArrayList<>(1);
|
List mutexRequireList = new ArrayList(1);
|
||||||
Map requireParam = new HashMap<>();
|
Map requireParam = new HashMap();
|
||||||
requireParam.put(DataMutex.PARAMNAME_DATAOBJID, prinfo.getString("id"));//数据id
|
requireParam.put(DataMutex.PARAMNAME_DATAOBJID, prinfo.getString("id"));//数据id
|
||||||
requireParam.put(DataMutex.PARAMNAME_GROUPID, groupId);
|
requireParam.put(DataMutex.PARAMNAME_GROUPID, groupId);
|
||||||
requireParam.put(DataMutex.PARAMNAME_ENTITYKEY, entityKey);
|
requireParam.put(DataMutex.PARAMNAME_ENTITYKEY, entityKey);
|
||||||
|
|
@ -344,8 +346,8 @@ public class JhzjUtils {
|
||||||
**/
|
**/
|
||||||
public static void unLockBill(DynamicObject prinfo){
|
public static void unLockBill(DynamicObject prinfo){
|
||||||
try (DataMutex dataMutex = DataMutex.create()) {
|
try (DataMutex dataMutex = DataMutex.create()) {
|
||||||
List mutexRequireList = new ArrayList<>(1);
|
List mutexRequireList = new ArrayList(1);
|
||||||
Map requireParam = new HashMap<>();
|
Map requireParam = new HashMap();
|
||||||
requireParam.put(DataMutex.PARAMNAME_DATAOBJID, prinfo.getString("id"));
|
requireParam.put(DataMutex.PARAMNAME_DATAOBJID, prinfo.getString("id"));
|
||||||
requireParam.put(DataMutex.PARAMNAME_GROUPID, groupId);
|
requireParam.put(DataMutex.PARAMNAME_GROUPID, groupId);
|
||||||
requireParam.put(DataMutex.PARAMNAME_ENTITYKEY, prinfo.getDataEntityType().getName());
|
requireParam.put(DataMutex.PARAMNAME_ENTITYKEY, prinfo.getDataEntityType().getName());
|
||||||
|
|
@ -461,7 +463,7 @@ public class JhzjUtils {
|
||||||
ConvertOperationResult pushResult = ConvertServiceHelper.push(pushArgs);
|
ConvertOperationResult pushResult = ConvertServiceHelper.push(pushArgs);
|
||||||
// 判断下推是否成功,如果失败,提炼失败消息输出
|
// 判断下推是否成功,如果失败,提炼失败消息输出
|
||||||
if (!pushResult.isSuccess()) {
|
if (!pushResult.isSuccess()) {
|
||||||
String errMessage = pushResult.getMessage(); // 错误摘要
|
// String errMessage = pushResult.getMessage(); // 错误摘要
|
||||||
String billMessage = "";
|
String billMessage = "";
|
||||||
for (SourceBillReport billReport : pushResult.getBillReports()) {
|
for (SourceBillReport billReport : pushResult.getBillReports()) {
|
||||||
if (!billReport.isSuccess()) {
|
if (!billReport.isSuccess()) {
|
||||||
|
|
@ -472,12 +474,8 @@ public class JhzjUtils {
|
||||||
}
|
}
|
||||||
// 获取生成的目标单数据包
|
// 获取生成的目标单数据包
|
||||||
MainEntityType targetMainType = EntityMetadataCache.getDataEntityType(tobill);
|
MainEntityType targetMainType = EntityMetadataCache.getDataEntityType(tobill);
|
||||||
List<DynamicObject> targetBillObjs = pushResult.loadTargetDataObjects(new IRefrencedataProvider() {
|
List<DynamicObject> targetBillObjs = pushResult.loadTargetDataObjects((objs, dType) ->
|
||||||
@Override
|
BusinessDataReader.loadRefence(objs, dType), targetMainType);
|
||||||
public void fillReferenceData(Object[] objs, IDataEntityType dType) {
|
|
||||||
BusinessDataReader.loadRefence(objs, dType);
|
|
||||||
}
|
|
||||||
}, targetMainType);
|
|
||||||
// 设置保存参数,调用目标单保存服务,保存目标单(保存时自动反写源单)
|
// 设置保存参数,调用目标单保存服务,保存目标单(保存时自动反写源单)
|
||||||
OperateOption saveOption = OperateOption.create();
|
OperateOption saveOption = OperateOption.create();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue