工匠学院人员对接功能完善

xuyifeng-0724-人员中台对接-dev
liujun 2024-06-26 14:23:31 +08:00
parent 6d9a283acc
commit 213d2fa16f
13 changed files with 515 additions and 6 deletions

View File

@ -0,0 +1,126 @@
package com.zcloud.flow.util;
import com.zcloud.util.Base64Utils;
import javax.crypto.Cipher;
import java.io.ByteArrayOutputStream;
import java.security.Key;
import java.security.KeyFactory;
import java.security.spec.KeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
public class GJRSAUtils {
private static final String CRYPTO_METHOD = "RSA";
private static final String CYPHER = "RSA/ECB/PKCS1Padding";
private static final String CHARSET = "UTF-8";
private GJRSAUtils() {
}
public static String encrypt(String clearText, String pubKey) {
String encryptedBase64 = "";
ByteArrayOutputStream out = null;
try {
byte[] bs = clearText.getBytes(CHARSET);
out = new ByteArrayOutputStream();
int LEN = 128;
byte[] tmp = new byte[LEN];
int length = 0;
for (int i = 0; i < bs.length; ++i) {
if (length == LEN) {
byte[] bb = encrypt(tmp, 0, length, pubKey);
out.write(bb);
tmp = new byte[LEN];
length = 0;
}
tmp[length] = bs[i];
++length;
}
if (length > 0) {
byte[] bb = encrypt(tmp, 0, length, pubKey);
out.write(bb);
}
encryptedBase64 = new String(Base64Utils.encode(out.toByteArray()));
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.close();
} catch (Exception ignore) {
}
}
}
return encryptedBase64.replaceAll("(\\r|\\n)", "");
}
public static String decrypt(String encryptedBase64, String privateKey) {
String decryptedString = "";
ByteArrayOutputStream out = null;
try {
byte[] encryptedBytes = Base64Utils.decode(encryptedBase64);
out = new ByteArrayOutputStream();
int LEN = 256;
byte[] tmp = new byte[LEN];
int length = 0;
for (int i = 0; i < encryptedBytes.length; ++i) {
if (length == LEN) {
byte[] bb = decrypt(tmp, 0, length, privateKey);
out.write(bb);
tmp = new byte[LEN];
length = 0;
}
tmp[length] = encryptedBytes[i];
++length;
}
if (length > 0) {
byte[] bb = decrypt(tmp, 0, length, privateKey);
out.write(bb);
}
decryptedString = new String(out.toByteArray(), CHARSET);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (out != null) {
try {
out.close();
} catch (Exception ignore) {
}
}
}
return decryptedString;
}
private static byte[] encrypt(byte[] bs, int index, int length, String pub_key) throws Exception {
KeyFactory keyFac = KeyFactory.getInstance(CRYPTO_METHOD);
KeySpec keySpec = new X509EncodedKeySpec(Base64Utils.decode(pub_key.trim()));
Key key = keyFac.generatePublic(keySpec);
Cipher cipher = Cipher.getInstance(CYPHER);
cipher.init(1, key);
return cipher.doFinal(bs, index, length);
}
private static byte[] decrypt(byte[] encryptedBytes, int index, int length, String private_key) throws Exception {
KeyFactory keyFac = KeyFactory.getInstance(CRYPTO_METHOD);
KeySpec keySpec = new PKCS8EncodedKeySpec(Base64Utils.decode(private_key.trim()));
Key key = keyFac.generatePrivate(keySpec);
Cipher cipher = Cipher.getInstance(CYPHER);
cipher.init(2, key);
return cipher.doFinal(encryptedBytes, index, length);
}
}

View File

@ -0,0 +1,54 @@
package com.zcloud.flow.util;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
public class GJSHAUtils {
private static final String[] HEX_DIGITS = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
private GJSHAUtils() {
}
public static String sha256(String text) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
byte[] bytes = text.getBytes(StandardCharsets.UTF_8);
messageDigest.update(bytes);
return byteArrayToHexString(messageDigest.digest());
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
public static String sha256(byte[] bytes) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(bytes);
return byteArrayToHexString(messageDigest.digest());
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
private static String byteArrayToHexString(byte[] bytes) {
StringBuilder stringBuilder = new StringBuilder();
int bytesLen = bytes.length;
for (int i = 0; i < bytesLen; ++i) {
byte tem = bytes[i];
stringBuilder.append(byteToHexString(tem));
}
return stringBuilder.toString();
}
private static String byteToHexString(byte b) {
int n = b;
if (b < 0) {
n = 256 + b;
}
int d1 = n / 16;
int d2 = n % 16;
return HEX_DIGITS[d1] + HEX_DIGITS[d2];
}
}

View File

@ -0,0 +1,139 @@
package com.zcloud.flow.util;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.zcloud.flow.util.dto.UserDTO;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.*;
/**
*
*/
@Component
public class SendMessageUtil {
/**
* ()
**/
@Value("${gongJiangXueYuanTestUrl}")
public static String SERVER_URL_TEST;
/**
* ()
**/
@Value("${gongJiangXueYuanProdUrl}")
public static String SERVER_URL_PROD;
/**
* RSA
**/
@Value("${gongJiangXueYuanSendPublicKey}")
public static String RSA_PUBLIC_KEY;
/**
*
**/
@Value("${gongJiangXueYuanSendPrivateKey}")
public static final String SECRET_KEY = "58e5e358b220335e7b1c6cc3576ceecc28b4a95d96cbbe0";
/**
* header
**/
public static final String SIGN_HEADER = "gjxy-sign";
/**
* header
**/
public static final String NONCE_HEADER = "gjxy-nonce";
/**
* header
**/
public static final String TIMESTAMP_HEADER = "gjxy-timestamp";
public void sendMessage(List<UserDTO> users) throws Exception {
for (UserDTO user : users) {
Map<String, Object> paramDataMap = new HashMap<>();
paramDataMap.put("userList", user);
// 发起请求
String body = createPostFormHttpRequest("/API-BACKEND/openapi/user/v1/syncNotify", paramDataMap);
}
}
/**
* post
*
* @param uri
* @param paramDataMap ()
* @return String
*/
public static String createPostFormHttpRequest(String uri, Map<String, Object> paramDataMap) throws Exception {
// 参数RSA加密
String paramDataJsonStr = JSON.toJSONString(paramDataMap);
String paramDataRsaEncrypt = GJRSAUtils.encrypt(paramDataJsonStr, RSA_PUBLIC_KEY);
// 请求参数
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("param", paramDataRsaEncrypt);
// 时间戳
String timestamp = String.valueOf(System.currentTimeMillis());
// 随机字符串
String nonce = RandomUtil.randomString(16);
// 签名
String sign = signBySHA256(SECRET_KEY, nonce, timestamp, paramMap);
Map<String, Object> lmap = new HashMap<>();
lmap.put("param", paramDataMap);
HttpResponse response = HttpUtil.createPost(SERVER_URL_TEST + uri)
.header(NONCE_HEADER, nonce)
.header(SIGN_HEADER, sign)
.header(TIMESTAMP_HEADER, timestamp)
.form("param", paramDataRsaEncrypt)
.execute();
return response.body();
}
/**
*
*
* @param secretKey
* @param nonce
* @param timestamp
* @param paramMap ()
* @return String
*/
private static String signBySHA256(String secretKey, String nonce, String timestamp, Map<String, Object> paramMap) {
try {
// 参数名排序
List<String> paramNames = new ArrayList<>(paramMap.keySet());
Collections.sort(paramNames);
StringBuilder result = new StringBuilder();
// 拼接参数字符串
for (String paramName : paramNames) {
if (result.length() > 1) {
result.append("|");
}
if (paramName != null && paramName.length() > 0) {
String value;
if (paramMap.get(paramName) == null) {
value = "";
} else {
value = paramMap.get(paramName).toString();
if (value.length() > 4096) {
value = value.substring(0, 4096);
}
}
result.append(paramName).append("=").append(value);
}
}
result.append(":").append(nonce).append(":").append(secretKey).append("&").append(timestamp);
return GJSHAUtils.sha256(result.toString());
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
}

View File

@ -0,0 +1,38 @@
package com.zcloud.flow.util.dto;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class UserDTO {
/**
*
*/
private String userName;
/**
*
*/
private String realName;
/**
*
*/
private String userSex;
/**
*
*/
private String idCard;
/**
* (/)
* XXX/XXX/XXX
*/
private String orgTree;
/**
* url
*/
private String avatarUrl;
/**
*
*/
private String phoneNumber;
}

View File

@ -3,7 +3,10 @@ package com.zcloud.flow.xgf.GuFen;
import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeComponent;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.flow.util.SendMessageUtil;
import com.zcloud.flow.util.dto.UserDTO;
import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
import com.zcloud.service.xgf.XgfUserService; import com.zcloud.service.xgf.XgfUserService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
@ -11,6 +14,8 @@ import com.zcloud.flow.xgf.util.XgfFlowDto;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@LiteflowComponent("GuFenSupervise") @LiteflowComponent("GuFenSupervise")
@SuppressWarnings("all") @SuppressWarnings("all")
@ -25,6 +30,11 @@ public class GuFenSupervise extends NodeComponent {
@Resource @Resource
private XgfUserMapper xgfUserMapper; private XgfUserMapper xgfUserMapper;
@Resource
private XgfUserDetailsMapper xgfUserDetailsMapper;
@Resource
private SendMessageUtil sendMessageUtil;
@Override @Override
public boolean isAccess() { public boolean isAccess() {
XgfFlowDto info = this.getRequestData(); XgfFlowDto info = this.getRequestData();
@ -85,6 +95,22 @@ public class GuFenSupervise extends NodeComponent {
entity.put("STATUS", "2"); entity.put("STATUS", "2");
xgfUserMapper.edit(entity); xgfUserMapper.edit(entity);
// created by liu jun 2024-06-26 工匠学院对接
condition.clear();
condition.put("XGF_USER_ID", flows.getString("FLOWS_ID"));
PageData entityInfo = xgfUserDetailsMapper.findById(condition);
UserDTO userDTO = UserDTO.builder()
.userName(entity.getString("USERNAME"))
.realName(entity.getString("NAME"))
.userSex("0".equals(entityInfo.getString("SEX")) ? "男" : "女")
.phoneNumber(entity.getString("USERNAME"))
.idCard(entityInfo.getString("CARD_ID"))
.orgTree("集团外公司(含外协单位)/"+ entity.getString("BELONG_TO_CORP_NAME"))
.avatarUrl(entityInfo.getString("PHOTO"))
.build();
List<UserDTO> list = new ArrayList<UserDTO>();
list.add(userDTO);
sendMessageUtil.sendMessage(list);
// 保存操作记录 // 保存操作记录
xgfUserService.saveLog(info, info.getSTATUS(), "1"); xgfUserService.saveLog(info, info.getSTATUS(), "1");
} }

View File

@ -3,8 +3,11 @@ package com.zcloud.flow.xgf.GuFen;
import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeComponent;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.flow.util.SendMessageUtil;
import com.zcloud.flow.util.dto.UserDTO;
import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.bus.CorpInfoMapper;
import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
import com.zcloud.service.xgf.XgfUserService; import com.zcloud.service.xgf.XgfUserService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
@ -13,6 +16,8 @@ import com.zcloud.flow.xgf.util.XgfFlowDto;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@LiteflowComponent("GuFenWeiTuoSupervise") @LiteflowComponent("GuFenWeiTuoSupervise")
@SuppressWarnings("all") @SuppressWarnings("all")
@ -30,9 +35,13 @@ public class GuFenWeiTuoSupervise extends NodeComponent {
@Resource @Resource
private CorpInfoMapper corpInfoMapper; private CorpInfoMapper corpInfoMapper;
@Resource
private XgfUserDetailsMapper xgfUserDetailsMapper;
@Resource
private SendMessageUtil sendMessageUtil;
@Override @Override
public boolean isAccess() { public boolean isAccess() {
System.out.println("2???????");
XgfFlowDto info = this.getRequestData(); XgfFlowDto info = this.getRequestData();
// 如果指针没有数据,赋值后自动结束 // 如果指针没有数据,赋值后自动结束
if (StringUtils.isBlank(info.getIterator())) { if (StringUtils.isBlank(info.getIterator())) {
@ -87,6 +96,23 @@ public class GuFenWeiTuoSupervise extends NodeComponent {
entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1);
xgfUserMapper.edit(entity); xgfUserMapper.edit(entity);
// created by liu jun 2024-06-26 工匠学院对接
condition.clear();
condition.put("XGF_USER_ID", flows.getString("FLOWS_ID"));
PageData entityInfo = xgfUserDetailsMapper.findById(condition);
UserDTO userDTO = UserDTO.builder()
.userName(entity.getString("USERNAME"))
.realName(entity.getString("NAME"))
.userSex("0".equals(entityInfo.getString("SEX")) ? "男" : "女")
.phoneNumber(entity.getString("USERNAME"))
.idCard(entityInfo.getString("CARD_ID"))
.orgTree("集团外公司(含外协单位)/"+ entity.getString("BELONG_TO_CORP_NAME"))
.avatarUrl(entityInfo.getString("PHOTO"))
.build();
List<UserDTO> list = new ArrayList<UserDTO>();
list.add(userDTO);
sendMessageUtil.sendMessage(list);
// 保存操作记录 // 保存操作记录
xgfUserService.saveLog(info, info.getSTATUS(), "1"); xgfUserService.saveLog(info, info.getSTATUS(), "1");
info.setIterator(""); info.setIterator("");

View File

@ -3,14 +3,19 @@ package com.zcloud.flow.xgf.JiTuan;
import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeComponent;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.flow.util.SendMessageUtil;
import com.zcloud.flow.util.dto.UserDTO;
import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.flow.xgf.util.XgfFlowDto;
import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
import com.zcloud.service.xgf.XgfUserService; import com.zcloud.service.xgf.XgfUserService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@LiteflowComponent("JiTuanSupervise") @LiteflowComponent("JiTuanSupervise")
public class JiTuanSupervise extends NodeComponent { public class JiTuanSupervise extends NodeComponent {
@ -24,6 +29,11 @@ public class JiTuanSupervise extends NodeComponent {
@Resource @Resource
private XgfUserMapper xgfUserMapper; private XgfUserMapper xgfUserMapper;
@Resource
private XgfUserDetailsMapper xgfUserDetailsMapper;
@Resource
private SendMessageUtil sendMessageUtil;
@Override @Override
public boolean isAccess() { public boolean isAccess() {
@ -84,7 +94,22 @@ public class JiTuanSupervise extends NodeComponent {
entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1);
entity.put("STATUS", "2"); entity.put("STATUS", "2");
xgfUserMapper.edit(entity); xgfUserMapper.edit(entity);
// created by liu jun 2024-06-26 工匠学院对接
condition.clear();
condition.put("XGF_USER_ID", flows.getString("FLOWS_ID"));
PageData entityInfo = xgfUserDetailsMapper.findById(condition);
UserDTO userDTO = UserDTO.builder()
.userName(entity.getString("USERNAME"))
.realName(entity.getString("NAME"))
.userSex("0".equals(entityInfo.getString("SEX")) ? "男" : "女")
.phoneNumber(entity.getString("USERNAME"))
.idCard(entityInfo.getString("CARD_ID"))
.orgTree("集团外公司(含外协单位)/"+ entity.getString("BELONG_TO_CORP_NAME"))
.avatarUrl(entityInfo.getString("PHOTO"))
.build();
List<UserDTO> list = new ArrayList<UserDTO>();
list.add(userDTO);
sendMessageUtil.sendMessage(list);
// 保存操作记录 // 保存操作记录
xgfUserService.saveLog(info, info.getSTATUS(), "1"); xgfUserService.saveLog(info, info.getSTATUS(), "1");
} }

View File

@ -3,9 +3,12 @@ package com.zcloud.flow.xgf.JiTuan;
import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeComponent;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.flow.util.SendMessageUtil;
import com.zcloud.flow.util.dto.UserDTO;
import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.flow.xgf.util.XgfFlowDto;
import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.bus.CorpInfoMapper;
import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
import com.zcloud.service.xgf.XgfUserService; import com.zcloud.service.xgf.XgfUserService;
import com.zcloud.util.DateUtil; import com.zcloud.util.DateUtil;
@ -13,6 +16,8 @@ import com.zcloud.util.Jurisdiction;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@LiteflowComponent("JiTuanWeiTuoSupervise") @LiteflowComponent("JiTuanWeiTuoSupervise")
public class JiTuanWeiTuoSupervise extends NodeComponent { public class JiTuanWeiTuoSupervise extends NodeComponent {
@ -29,6 +34,11 @@ public class JiTuanWeiTuoSupervise extends NodeComponent {
@Resource @Resource
private CorpInfoMapper corpInfoMapper; private CorpInfoMapper corpInfoMapper;
@Resource
private XgfUserDetailsMapper xgfUserDetailsMapper;
@Resource
private SendMessageUtil sendMessageUtil;
@Override @Override
public boolean isAccess() { public boolean isAccess() {
XgfFlowDto info = this.getRequestData(); XgfFlowDto info = this.getRequestData();
@ -86,6 +96,22 @@ public class JiTuanWeiTuoSupervise extends NodeComponent {
entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1);
xgfUserMapper.edit(entity); xgfUserMapper.edit(entity);
// created by liu jun 2024-06-26 工匠学院对接
condition.clear();
condition.put("XGF_USER_ID", flows.getString("FLOWS_ID"));
PageData entityInfo = xgfUserDetailsMapper.findById(condition);
UserDTO userDTO = UserDTO.builder()
.userName(entity.getString("USERNAME"))
.realName(entity.getString("NAME"))
.userSex("0".equals(entityInfo.getString("SEX")) ? "男" : "女")
.phoneNumber(entity.getString("USERNAME"))
.idCard(entityInfo.getString("CARD_ID"))
.orgTree("集团外公司(含外协单位)/"+ entity.getString("BELONG_TO_CORP_NAME"))
.avatarUrl(entityInfo.getString("PHOTO"))
.build();
List<UserDTO> list = new ArrayList<UserDTO>();
list.add(userDTO);
sendMessageUtil.sendMessage(list);
// 保存操作记录 // 保存操作记录
xgfUserService.saveLog(info, info.getSTATUS(), "1"); xgfUserService.saveLog(info, info.getSTATUS(), "1");
} }

View File

@ -3,8 +3,11 @@ package com.zcloud.flow.xgf.YiBan;
import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.core.NodeComponent; import com.yomahub.liteflow.core.NodeComponent;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.flow.util.SendMessageUtil;
import com.zcloud.flow.util.dto.UserDTO;
import com.zcloud.mapper.datasource.bus.CorpInfoMapper; import com.zcloud.mapper.datasource.bus.CorpInfoMapper;
import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper; import com.zcloud.mapper.datasource.xgf.XgfFlowsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
import com.zcloud.flow.xgf.util.XgfFlowDto; import com.zcloud.flow.xgf.util.XgfFlowDto;
import com.zcloud.service.xgf.XgfUserService; import com.zcloud.service.xgf.XgfUserService;
@ -13,9 +16,12 @@ import com.zcloud.util.Jurisdiction;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@LiteflowComponent("YiBanSupervise") @LiteflowComponent("YiBanSupervise")
@SuppressWarnings("all")
public class YiBanSupervise extends NodeComponent { public class YiBanSupervise extends NodeComponent {
@Resource @Resource
@ -27,6 +33,11 @@ public class YiBanSupervise extends NodeComponent {
@Resource @Resource
private XgfUserMapper xgfUserMapper; private XgfUserMapper xgfUserMapper;
@Resource
private XgfUserDetailsMapper xgfUserDetailsMapper;
@Resource
private SendMessageUtil sendMessageUtil;
@Resource @Resource
private CorpInfoMapper corpInfoMapper; private CorpInfoMapper corpInfoMapper;
@ -118,7 +129,22 @@ public class YiBanSupervise extends NodeComponent {
entity.put("STATUS", "2"); entity.put("STATUS", "2");
entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1); entity.put("CHECK_STEP", Integer.parseInt(entity.get("CHECK_STEP").toString()) + 1);
xgfUserMapper.edit(entity); xgfUserMapper.edit(entity);
// created by liu jun 2024-06-26 工匠学院对接
condition.clear();
condition.put("XGF_USER_ID", flows.getString("FLOWS_ID"));
PageData entityInfo = xgfUserDetailsMapper.findById(condition);
UserDTO userDTO = UserDTO.builder()
.userName(entity.getString("USERNAME"))
.realName(entity.getString("NAME"))
.userSex("0".equals(entityInfo.getString("SEX")) ? "男" : "女")
.phoneNumber(entity.getString("USERNAME"))
.idCard(entityInfo.getString("CARD_ID"))
.orgTree("集团外公司(含外协单位)/"+ entity.getString("BELONG_TO_CORP_NAME"))
.avatarUrl(entityInfo.getString("PHOTO"))
.build();
List<UserDTO> list = new ArrayList<UserDTO>();
list.add(userDTO);
sendMessageUtil.sendMessage(list);
// 保存操作记录 // 保存操作记录
xgfUserService.saveLog(info, info.getSTATUS(), "1"); xgfUserService.saveLog(info, info.getSTATUS(), "1");
} }

View File

@ -931,6 +931,13 @@ public class XgfUserServiceImpl implements XgfUserService {
flow.put("APPOINT_SEVEN_USER_ID", ""); flow.put("APPOINT_SEVEN_USER_ID", "");
} }
/**
*
* @param info
* @param status
* @param endFlag
* @throws Exception
*/
public void saveLog(PageData info, String status, String endFlag) throws Exception { public void saveLog(PageData info, String status, String endFlag) throws Exception {
/* 保存审批记录 */ /* 保存审批记录 */
PageData condition = new PageData(); PageData condition = new PageData();

View File

@ -132,3 +132,8 @@ heBeiQinAnFile=https://file.zcloudchina.com/YTHFile
liteflow.rule-source=flow.xml liteflow.rule-source=flow.xml
liteflow.print-execution-log=false liteflow.print-execution-log=false
gongJiangXueYuanSendPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzbwmqhb5xVejFQFoa8NF2FGtb2nMtpalZ2Zcy78tL/5Y5Od78EKb9dALuv4b+F/PexynKrQDlnRhAouuqF8S1LuC0njbWSaFMofCeyeoltSQTEcjwzEAOPH9CnzGOZQ19tB2vEamVoLefWC4H0V+e5hWv7DDCm3bLNaHhMnR1/o0ASZqzIHYDEzVZNGrxR8WIhxUh7fORk75nEUyz2S6WKq1MlOkm8ZssMsFW+KacRTnexn8Q2p8/7/3zRCScLoH3pHA+J35nuP+doigUmPJzwHfPsr1QeYdadtuwZdfCZVQ7U4R4vB83NsSElAgTW+xHzy7Y1EcgZgYfSedetb03QIDAQAB
gongJiangXueYuanSendPrivateKey=58e5e358b220335e7b1c6cc3576ceecc28b4a95d96cbbe0
gongJiangXueYuanTestUrl=http://fy04.bjttsx.com
gongJiangXueYuanProdUrl=https://gjxy.bjttsx.com

View File

@ -107,3 +107,8 @@ gwj-baseimgpath=https://qgqy.qhdsafety.com/file/
gwj-backendaddr=http://192.168.0.31:8991/qa-prevention-gwj/ gwj-backendaddr=http://192.168.0.31:8991/qa-prevention-gwj/
cfd.prevention.api.url=http://192.168.0.31:7021/qa-regulatory-cfd cfd.prevention.api.url=http://192.168.0.31:7021/qa-regulatory-cfd
gongJiangXueYuanSendPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzbwmqhb5xVejFQFoa8NF2FGtb2nMtpalZ2Zcy78tL/5Y5Od78EKb9dALuv4b+F/PexynKrQDlnRhAouuqF8S1LuC0njbWSaFMofCeyeoltSQTEcjwzEAOPH9CnzGOZQ19tB2vEamVoLefWC4H0V+e5hWv7DDCm3bLNaHhMnR1/o0ASZqzIHYDEzVZNGrxR8WIhxUh7fORk75nEUyz2S6WKq1MlOkm8ZssMsFW+KacRTnexn8Q2p8/7/3zRCScLoH3pHA+J35nuP+doigUmPJzwHfPsr1QeYdadtuwZdfCZVQ7U4R4vB83NsSElAgTW+xHzy7Y1EcgZgYfSedetb03QIDAQAB
gongJiangXueYuanSendPrivateKey=58e5e358b220335e7b1c6cc3576ceecc28b4a95d96cbbe0
gongJiangXueYuanTestUrl=http://fy04.bjttsx.com
gongJiangXueYuanProdUrl=https://gjxy.bjttsx.com

View File

@ -104,3 +104,9 @@ biaoZhunShuJuKu=https://file.zcloudchina.com/
liteflow.rule-source=flow.xml liteflow.rule-source=flow.xml
liteflow.print-execution-log=false liteflow.print-execution-log=false
gongJiangXueYuanSendPublicKey=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzbwmqhb5xVejFQFoa8NF2FGtb2nMtpalZ2Zcy78tL/5Y5Od78EKb9dALuv4b+F/PexynKrQDlnRhAouuqF8S1LuC0njbWSaFMofCeyeoltSQTEcjwzEAOPH9CnzGOZQ19tB2vEamVoLefWC4H0V+e5hWv7DDCm3bLNaHhMnR1/o0ASZqzIHYDEzVZNGrxR8WIhxUh7fORk75nEUyz2S6WKq1MlOkm8ZssMsFW+KacRTnexn8Q2p8/7/3zRCScLoH3pHA+J35nuP+doigUmPJzwHfPsr1QeYdadtuwZdfCZVQ7U4R4vB83NsSElAgTW+xHzy7Y1EcgZgYfSedetb03QIDAQAB
gongJiangXueYuanSendPrivateKey=58e5e358b220335e7b1c6cc3576ceecc28b4a95d96cbbe0
gongJiangXueYuanTestUrl=http://fy04.bjttsx.com
gongJiangXueYuanProdUrl=https://gjxy.bjttsx.com