Merge remote-tracking branch 'origin/main'

feature-LeeD-20221025
shilei 2 years ago
commit 7b5dd89414

@ -0,0 +1,7 @@
package com.api.signature;
import javax.ws.rs.Path;
@Path("/docSign")
public class GetDocSignatureWebAction extends com.engine.haojing.web.GetDocSignatureWebAction {
}

@ -153,32 +153,34 @@ public class SendPortalTodoUtil {
// String username = "admin";
// String passwd = "Uportal_123";
// String todourl = "http://172.16.25.133/portal-web/centerTodo/sync" ;
String auth = username + ":" + passwd;
String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth);
bb.writeLog("msgdata:"+msgdata);
if(StringUtils.isNotEmpty(msgdata)){
JSONObject msgObject = JSONObject.parseObject(msgdata);
//{"resultCode":"1","resultMsg":"No Result"}
if(msgObject.containsKey("resultCode")){
String resultCode = msgObject.getString("resultCode");
if("0".equals(resultCode)){
bb.writeLog("emailArray:"+emailArray);
if(StringUtils.isNotEmpty(emailArray))
{
Map<String,String> templateMap = getEmailTemplate(requestname,lastname,processTime);
String notificationSubject = templateMap.get("notificationSubject");
String notificationContent = templateMap.get("notificationContent");
sendMailUtil.sendMail(requestid,emailArray,notificationSubject,notificationContent);
if (taskObjectList.size() > 0){
String auth = username + ":" + passwd;
String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth);
bb.writeLog("msgdata:"+msgdata);
if(StringUtils.isNotEmpty(msgdata)){
JSONObject msgObject = JSONObject.parseObject(msgdata);
//{"resultCode":"1","resultMsg":"No Result"}
if(msgObject.containsKey("resultCode")){
String resultCode = msgObject.getString("resultCode");
if("0".equals(resultCode)){
bb.writeLog("emailArray:"+emailArray);
if(StringUtils.isNotEmpty(emailArray))
{
Map<String,String> templateMap = getEmailTemplate(requestname,lastname,processTime);
String notificationSubject = templateMap.get("notificationSubject");
String notificationContent = templateMap.get("notificationContent");
sendMailUtil.sendMail(requestid,emailArray,notificationSubject,notificationContent);
}
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,"");
}else{
String resultmsg = msgObject.getString("resultMsg");
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,resultmsg);
}
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,"");
}else{
String resultmsg = msgObject.getString("resultMsg");
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,resultmsg);
}
}
}
@ -337,36 +339,37 @@ public class SendPortalTodoUtil {
}
}
requestObject.put("taskObjectList",taskObjectList);
if (taskObjectList.size() > 0){
requestObject.put("taskObjectList",taskObjectList);
String auth = username + ":" + passwd;
// bb.writeLog("sendTodoDataByCreater-requestObject:"+requestObject.toJSONString());
String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth);
bb.writeLog("sendTodoDataByCreater-msgdata:"+msgdata);
if(!"".equals(msgdata)){
JSONObject msgObject = JSONObject.parseObject(msgdata);
//{"resultCode":"1","resultMsg":"No Result"}
if(msgObject.containsKey("resultCode")){
String resultCode = msgObject.getString("resultCode");
if("0".equals(resultCode)){
bb.writeLog("emailArray:"+emailArray);
if(StringUtils.isNotEmpty(emailArray))
{
String auth = username + ":" + passwd;
String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth);
bb.writeLog("sendTodoDataByCreater-msgdata:"+msgdata);
if(!"".equals(msgdata)){
JSONObject msgObject = JSONObject.parseObject(msgdata);
//{"resultCode":"1","resultMsg":"No Result"}
if(msgObject.containsKey("resultCode")){
String resultCode = msgObject.getString("resultCode");
if("0".equals(resultCode)){
bb.writeLog("emailArray:"+emailArray);
if(StringUtils.isNotEmpty(emailArray))
{
// String notificationSubject = "You have a new to-do list:"+requestname+",Please handle it in time";
// String notificationContent = "You have a new to-do list:"+requestname+",Please handle it in time";
Map<String,String> templateMap = getEmailTemplate(requestname,lastname,processTime);
String notificationSubject = templateMap.get("notificationSubject");
String notificationContent = templateMap.get("notificationContent");
Map<String,String> templateMap = getEmailTemplate(requestname,lastname,processTime);
String notificationSubject = templateMap.get("notificationSubject");
String notificationContent = templateMap.get("notificationContent");
sendMailUtil.sendMail(requestid,emailArray,notificationSubject,notificationContent);
}
sendMailUtil.sendMail(requestid,emailArray,notificationSubject,notificationContent);
}
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,"");
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,"");
}else{
String resultmsg = msgObject.getString("resultMsg");
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,resultmsg);
}else{
String resultmsg = msgObject.getString("resultMsg");
sendPortalErrorUtil.doRecordPortalErrorInfo(requestid,nodeId,nodeName,userids,requestObject.toJSONString(),resultCode,resultmsg);
}
}
}
}
@ -397,6 +400,7 @@ public class SendPortalTodoUtil {
String cus_staff = PropBean.getUfPropValue("cus_staff") ;
String scopeid = "-1";
String scope = "HrmCustomFieldByInfoType" ;
String msgdata = "";
String terminal = "1" ;
String taskType = "0";
@ -532,6 +536,12 @@ public class SendPortalTodoUtil {
userids = user.getUID()+"";
if (taskObjectList.size() > 0){
String auth = username + ":" + passwd;
//bb.writeLog("requestObject:"+requestObject.toJSONString());
msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth);
}
}else{
String actionType = "2" ;
String objectAction = "0" ;
@ -651,11 +661,12 @@ public class SendPortalTodoUtil {
}
}
requestObject.put("taskObjectList",taskObjectList);
// if (taskObjectList.size() > 0){
String auth = username + ":" + passwd;
//bb.writeLog("requestObject:"+requestObject.toJSONString());
msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth);
// }
}
String auth = username + ":" + passwd;
//bb.writeLog("requestObject:"+requestObject.toJSONString());
String msgdata = httpRequestUtil.doPostByAuth(portal_todourl,requestObject.toJSONString(),auth);
bb.writeLog("msgdata:"+msgdata);
if(!"".equals(msgdata)){
JSONObject msgObject = JSONObject.parseObject(msgdata);

@ -77,7 +77,7 @@ public class SendPortalWithAddTodoCmd {
String terminal = "1" ;
String taskType = "0";
String actionType = "0" ;
String actionType = "2" ;
String objectAction = "0" ;
String objectType = "0";

@ -0,0 +1,50 @@
package com.engine.signature;
import com.alibaba.fastjson.JSON;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class GetDocSignatureWebAction {
@GET
@Path("/list")
@Produces(MediaType.TEXT_PLAIN)
public String getDocSignatureByUserId(@Context HttpServletRequest request, @Context HttpServletResponse response) {
Map<String, Object> apidatas = new HashMap<>();
try {
User user = HrmUserVarify.getUser (request , response);
RecordSet rs = new RecordSet();
String sql = "SELECT a.markName, b.imagefileid, b.imagefilename FROM DocSignature a, ImageFile b where a.imagefileid = b.imagefileid " +
"and a.hrmresid = " + user.getUID();
rs.execute(sql);
List<Map<String, Object>> dataList = new ArrayList<>();
if (rs.next()) {
Map<String, Object> data = new HashMap<>();
data.put("markName", Util.null2String(rs.getString("markName")));
data.put("imagefileid", Util.null2String(rs.getString("imagefileid")));
data.put("imagefilename", Util.null2String(rs.getString("imagefilename")));
dataList.add(data);
}
apidatas.put("api_status", true);
apidatas.put("counts", dataList.size());
apidatas.put("datas", dataList);
} catch (Exception e) {
apidatas.put("api_status", false);
}
return JSON.toJSONString(apidatas);
}
}
Loading…
Cancel
Save