天眼查供应商变更优化,待办优化

This commit is contained in:
weiyunlong 2024-11-24 11:07:27 +08:00
parent af58b2564e
commit d798d1df33
5 changed files with 111 additions and 18 deletions

View File

@ -0,0 +1,24 @@
package shkd.repc.recon.formplugin;
import kd.bos.bill.BillShowParameter;
import kd.bos.form.ShowType;
import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.form.plugin.AbstractFormPlugin;
public class TestFormPlugin extends AbstractFormPlugin {
@Override
public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
super.afterDoOperation(afterDoOperationEventArgs);
String operateKey = afterDoOperationEventArgs.getOperateKey();
if ("testoperate".equals(operateKey)) {
BillShowParameter billShowParameter = new BillShowParameter();
billShowParameter.setFormId("recos_conplan");// 合约规划
billShowParameter.getOpenStyle().setShowType(ShowType.Modal);
billShowParameter.getOpenStyle().setTargetKey("tabap");
this.getView().showForm(billShowParameter);
}
}
}

View File

@ -2,10 +2,12 @@ package shkd.repc.recon.opplugin;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import kd.bos.bill.BillShowParameter;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs; import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.form.ShowType;
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.QCP;

View File

@ -0,0 +1,62 @@
package shkd.repc.resm.formplugin;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import java.util.EventObject;
/**
* 供应商变更
* qeug_resm_change_supp_ext
*/
public class SupplierChangeFormPlugin extends AbstractFormPlugin {
@Override
public void afterCreateNewData(EventObject e) {
super.afterCreateNewData(e);
}
@Override
public void afterBindData(EventObject e) {
super.afterBindData(e);
DynamicObject dataEntity = this.getView().getModel().getDataEntity();
DynamicObject supplier = dataEntity.getDynamicObject("supplier");
if (supplier == null || dataEntity.getBoolean("qeug_iscarry")) {
return;
}
QFilter q1 = new QFilter("id", QCP.equals, supplier.getLong("id"));
supplier = BusinessDataServiceHelper.loadSingle("resm_official_supplier", new QFilter[]{q1});
//正式供应商
if (null != supplier) {
/**
* 基本信息核对 qeug_infocheckentry
*/
DynamicObjectCollection qeugInfocheckentry = supplier.getDynamicObjectCollection("qeug_infocheckentry");
DynamicObjectCollection qeugInfocheckentry1 = dataEntity.getDynamicObjectCollection("qeug_infocheckentry");
qeugInfocheckentry1.clear();
if (null != qeugInfocheckentry) {
for (int i = 0; i < qeugInfocheckentry.size(); i++) {
DynamicObject qeugInfocheckentry_item = qeugInfocheckentry.get(i);
DynamicObject add = qeugInfocheckentry1.addNew();
getModel().setValue("qeug_bsfieldname", qeugInfocheckentry_item.getString("qeug_bsfieldname"),i);
getModel().setValue("qeug_bsfield", qeugInfocheckentry_item.getString("qeug_bsfield"),i);
getModel().setValue("qeug_apifield", qeugInfocheckentry_item.getString("qeug_apifield"),i);
getModel().setValue("qeug_bsinput", qeugInfocheckentry_item.getString("qeug_bsinput"),i);
getModel().setValue("qeug_queryresult", qeugInfocheckentry_item.getString("qeug_queryresult"),i);
getModel().setValue("qeug_issame", qeugInfocheckentry_item.getString("qeug_issame"),i);
}
getModel().setValue("qeug_iscarry",true);//是否携带过比对字段
this.getView().updateView("qeug_iscarry");
this.getView().updateView("qeug_infocheckentry");
}
}
}
}

View File

@ -5,6 +5,7 @@ import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.logging.Log; import kd.bos.logging.Log;
import kd.bos.logging.LogFactory; import kd.bos.logging.LogFactory;
import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.user.UserServiceHelper;
import kd.bos.util.StringUtils; import kd.bos.util.StringUtils;
import kd.bos.workflow.engine.impl.persistence.entity.operationlog.OperationLogEntity; import kd.bos.workflow.engine.impl.persistence.entity.operationlog.OperationLogEntity;
import kd.bos.workflow.engine.msg.AbstractMessageServiceHandler; import kd.bos.workflow.engine.msg.AbstractMessageServiceHandler;
@ -217,6 +218,10 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler {
//JSONObject.parseObject(String.valueOf(message.getParams().get("messageContext"))); //JSONObject.parseObject(String.valueOf(message.getParams().get("messageContext")));
Map<String, Object> params = message.getParams(); Map<String, Object> params = message.getParams();
Long userId = UserServiceHelper.getCurrentUserId();
DynamicObject bos_user = BusinessDataServiceHelper.loadSingle(userId, "bos_user");
String username = bos_user.getString("username");
String billNo = ""; String billNo = "";
Long taskId = 0L; Long taskId = 0L;
if (params != null) { if (params != null) {
@ -241,23 +246,23 @@ public class todoZyTaskServiceHandler extends AbstractMessageServiceHandler {
List<DynamicObject> approvers = new ArrayList<>(); List<DynamicObject> approvers = new ArrayList<>();
List<Long> userIds = message.getUserIds(); // 审批人ID集合 List<Long> userIds = message.getUserIds(); // 审批人ID集合
List<DynamicObject> approversLists = getApprovers(userIds, approvers); List<DynamicObject> approversLists = getApprovers(userIds, approvers);
//获取任务创建人 // 信息发送人 //获取任务创建人 // 信息发送人 消息推送不需要创建人
// ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getDecisionType(); // ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getDecisionType();
Long startUserId = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getOwnerId(); // Long startUserId = ServiceFactory.getService(WorkflowService.class).getTaskService().getOperationLogByTaskId(taskId).get(0).getOwnerId();
// Long startUserId = message.getSenderId(); // Long startUserId = message.getSenderId();
// Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id // Long startUserId = messageContext.getStartUserId(); // 审批实例发起人id
String startNumber = ""; String startNumber = "";
String startName = ""; String startName = "";
if (null != startUserId) { // if (null != startUserId) {
DynamicObject startUser = BusinessDataServiceHelper.loadSingle(startUserId, "bos_user"); // DynamicObject startUser = BusinessDataServiceHelper.loadSingle(startUserId, "bos_user");
if (null != startUser) { // if (null != startUser) {
startNumber = startUser.getString("number"); // startNumber = startUser.getString("number");
startName = startUser.getString("name"); // startName = startUser.getString("name");
if (!userIds.contains(startUserId)) { // if (!userIds.contains(startUserId)) {
approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口) // approversLists.add(startUser);//添加发起人到审批人集合_便于后续接口调用(用户绑定接口)
} // }
} // }
} // }
//获取Url //获取Url
String url = message.getContentUrl(); // 链接 String url = message.getContentUrl(); // 链接
String url1 = message.getContentUrl(); // 链接 String url1 = message.getContentUrl(); // 链接

View File

@ -318,14 +318,14 @@ public class OAUtils {
List<DynamicObject> approversLists = (List<DynamicObject>)thirdPartyMap.get("approversLists"); List<DynamicObject> approversLists = (List<DynamicObject>)thirdPartyMap.get("approversLists");
for (DynamicObject approver :approversLists ) { for (DynamicObject approver :approversLists ) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("thirdpartyMessageId", String.valueOf(thirdPartyMap.get("taskId")));//第三方待办主键保证唯一 jsonObject.put("thirdpartyMessageId", String.valueOf(thirdPartyMap.get("taskId")));//待办主键保证唯一
jsonObject.put("thirdpartyRegisterCode", "3004");//系统注册编码 jsonObject.put("thirdpartyRegisterCode", "3004");//系统注册编码
jsonObject.put("messageContent", String.valueOf(thirdPartyMap.get("content")) );//消息内容 jsonObject.put("messageContent", String.valueOf(thirdPartyMap.get("content")) );//消息内容
jsonObject.put("thirdpartySenderId", String.valueOf(thirdPartyMap.get("startNumber")));//第三方待办发起人主键 jsonObject.put("thirdpartySenderId", String.valueOf(thirdPartyMap.get("startNumber")));//发起人主键
// jsonObject.put("thirdpartySenderId", "jdtest");//todo 第三方待办发起人主键 // jsonObject.put("thirdpartySenderId", "jdtest");//todo 发起人主键
jsonObject.put("thirdpartyReceiverId", approver.getString("number"));//第三方待办接收人主键保证唯一 jsonObject.put("thirdpartyReceiverId", approver.getString("number"));//接收人主键保证唯一
// jsonObject.put("thirdpartyReceiverId", "jdtest");//todo 第三方待办接收人主键保证唯一 // jsonObject.put("thirdpartyReceiverId", "jdtest");//todo 接收人主键保证唯一
jsonObject.put("creation_date", String.valueOf(thirdPartyMap.get("createDateStr")));//待办创建时间格式yyyy-MM-dd HH:mm:ss jsonObject.put("creation_date", String.valueOf(thirdPartyMap.get("createDateStr")));//创建时间格式yyyy-MM-dd HH:mm:ss
jsonObject.put("messageURL", String.valueOf(thirdPartyMap.get("url")));//PC端穿透链接 jsonObject.put("messageURL", String.valueOf(thirdPartyMap.get("url")));//PC端穿透链接
jsonObject.put("messageH5URL", "test");//移动端穿透链接 jsonObject.put("messageH5URL", "test");//移动端穿透链接
messageList.add(jsonObject); messageList.add(jsonObject);