You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AEG_Development/AegChange4_mxJPO.java

67 lines
2.8 KiB
Java

import com.matrixone.apps.domain.util.FrameworkException;
import com.matrixone.apps.domain.util.MqlUtil;
import matrix.db.Context;
import java.util.logging.Logger;
public class AegChange4_mxJPO {
private static final Logger LOGGER = Logger.getLogger(AegChange2_mxJPO.class.getName());
private static final String purchaseGroup = "purchase.plm";
private static final String qualityGroup = "quality.plm";
private static final String operateGroupIBC = "plm.ibc";
private static final String operateGroupRMU = "plm.rmu";
private static final String operateGroupLV= "plm.lv";
public void CheckTrustee(Context context, String[] args) throws Exception {
String objId = args[0];
String personId = args[1];
String taskId = args[2];
LOGGER.info("objId ==> " + objId);
LOGGER.info("personId ==> " + personId);
LOGGER.info("taskId ==> " + taskId);
String getPersonName = "print bus " + personId + " select name dump |";
String personName = MqlUtil.mqlCommand(context, getPersonName);
LOGGER.info("personName ==> " + personName);
if(!personName.isEmpty()){
boolean isFlag = CheckIsPublicAccount(personName);
if(isFlag){
String getAssignedTask = "print bus " + taskId + " select to[Assigned Tasks].from.name dump |";
String assignedTasks = MqlUtil.mqlCommand(context, getAssignedTask);
LOGGER.info("assignedTasks ==> " + assignedTasks);
if(!assignedTasks.isEmpty()){
if(assignedTasks.contains("|")){
String[] assignedTaskItem = assignedTasks.split("\\|");
for(String item : assignedTaskItem){
if(CheckIsPublicAccount(item)){
NoticeInfo(context);
}
}
} else{
if (CheckIsPublicAccount(assignedTasks)) {
NoticeInfo(context);
}
}
}
}
}
}
public boolean CheckIsPublicAccount(String assignedName) throws FrameworkException {
if(assignedName.equals(purchaseGroup) || assignedName.equals(qualityGroup) || assignedName.equals(operateGroupIBC) || assignedName.equals(operateGroupLV) || assignedName.equals(operateGroupRMU)){
return true;
}
return false;
}
public void NoticeInfo(Context context) throws FrameworkException {
MqlUtil.mqlCommand(context,"notice $1","\u5df2\u6709\u516c\u5171\u8d26\u53f7\uff0c\u8bf7\u52ff\u591a\u6b21\u6dfb\u52a0");
throw new RuntimeException("\u5df2\u6709\u516c\u5171\u8d26\u53f7\uff0c\u8bf7\u52ff\u591a\u6b21\u6dfb\u52a0");
}
}