Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
@@ -928,7 +928,7 @@ UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Responsible Fi
|
|||||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Filled by' WHERE `id` = 'a371f6d49781c0921a48f317d1ba69b6';
|
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Filled by' WHERE `id` = 'a371f6d49781c0921a48f317d1ba69b6';
|
||||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Eng. Interface' WHERE `id` = '58c3d5a50c86be19d5ab0cd5ac4d6d8b';
|
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Eng. Interface' WHERE `id` = '58c3d5a50c86be19d5ab0cd5ac4d6d8b';
|
||||||
|
|
||||||
-- 国家国旗表 增加旗帜 2022-08-16
|
-- 国家国旗表 增加旗帜 2022-08-16 已同步生产环境
|
||||||
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('14', NULL, NULL, NULL, NULL, NULL, '海湾地区', 'GCC', NULL, '/jero-boot/nationalFlag/GCC.png');
|
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('14', NULL, NULL, NULL, NULL, NULL, '海湾地区', 'GCC', NULL, '/jero-boot/nationalFlag/GCC.png');
|
||||||
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('15', NULL, NULL, NULL, NULL, NULL, '巴西', 'Brazil', NULL, '/jero-boot/nationalFlag/Brazil.png');
|
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('15', NULL, NULL, NULL, NULL, NULL, '巴西', 'Brazil', NULL, '/jero-boot/nationalFlag/Brazil.png');
|
||||||
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('16', NULL, NULL, NULL, NULL, NULL, '德国', 'Germany', NULL, '/jero-boot/nationalFlag/Germany.png');
|
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('16', NULL, NULL, NULL, NULL, NULL, '德国', 'Germany', NULL, '/jero-boot/nationalFlag/Germany.png');
|
||||||
@@ -946,15 +946,15 @@ INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_ti
|
|||||||
-- 删除之前的3中国香港 和8海湾地区
|
-- 删除之前的3中国香港 和8海湾地区
|
||||||
delete from country_national_flag where id in ('3','8');
|
delete from country_national_flag where id in ('3','8');
|
||||||
|
|
||||||
-- 法规流程历史表增加字段 审批意见 2022-08-16
|
-- 法规流程历史表增加字段 审批意见 2022-08-16 已同步生产环境
|
||||||
ALTER TABLE `laws_weilai`.`laws_process_history`
|
ALTER TABLE `laws_weilai`.`laws_process_history`
|
||||||
ADD COLUMN `approval_opinion` varchar(2000) NULL COMMENT '审批意见' AFTER `flow_type`;
|
ADD COLUMN `approval_opinion` varchar(2000) NULL COMMENT '审批意见' AFTER `flow_type`;
|
||||||
|
|
||||||
--- 用户表 删除工号唯一索引 2022-08-18
|
--- 用户表 删除工号唯一索引 2022-08-18 已同步生产环境
|
||||||
ALTER TABLE `laws_weilai`.`sys_user`
|
ALTER TABLE `laws_weilai`.`sys_user`
|
||||||
DROP INDEX `uniq_sys_user_work_no`;
|
DROP INDEX `uniq_sys_user_work_no`;
|
||||||
|
|
||||||
|
|
||||||
-- 工作流 流程表增加流程名称 英文字段 2022-08-19
|
-- 工作流 流程表增加流程名称 英文字段 2022-08-19 已同步生产环境
|
||||||
ALTER TABLE `laws_weilai_wkflow`.`bus_process_name`
|
ALTER TABLE `laws_weilai_wkflow`.`bus_process_name`
|
||||||
ADD COLUMN `PRC_NAME_EN` varchar(255) NULL COMMENT '流程名称(英文)' AFTER `PROJECT_LAWS_INVENTORY_ID`;
|
ADD COLUMN `PRC_NAME_EN` varchar(255) NULL COMMENT '流程名称(英文)' AFTER `PROJECT_LAWS_INVENTORY_ID`;
|
||||||
|
|||||||
+3
@@ -772,6 +772,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
|||||||
OnlCgformField onlCgformField = fieldList.get(i);
|
OnlCgformField onlCgformField = fieldList.get(i);
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
String dbFieldName = onlCgformField.getDbFieldName();
|
String dbFieldName = onlCgformField.getDbFieldName();
|
||||||
|
if ("nioNumber".equals(dbFieldName) || "paramsName".equals(dbFieldName)) {
|
||||||
|
map.put("click3", true);
|
||||||
|
}
|
||||||
if ("description".equals(dbFieldName)) {
|
if ("description".equals(dbFieldName)) {
|
||||||
indexOfDescription = i;
|
indexOfDescription = i;
|
||||||
map.put("click2", true);
|
map.put("click2", true);
|
||||||
|
|||||||
+88
-45
@@ -21,6 +21,7 @@ import com.jero.modules.system.entity.SysUser;
|
|||||||
import com.jero.modules.system.service.ISysUserService;
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
import com.jero.modules.system.util.HttpRequestUtil;
|
import com.jero.modules.system.util.HttpRequestUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -565,69 +566,111 @@ public class FeishuServiceImpl implements IFeishuService {
|
|||||||
headerMap.put("Authorization", "Bearer " + token);
|
headerMap.put("Authorization", "Bearer " + token);
|
||||||
headerMap.put("Content-Type", "application/json; charset=utf-8");
|
headerMap.put("Content-Type", "application/json; charset=utf-8");
|
||||||
|
|
||||||
String sendJson = " {\n" +
|
//参考:https://open.feishu.cn/tool/cardbuilder?from=openplantform_mcb_entrance
|
||||||
" \"config\": {\n" +
|
/*String sendJson = "{\n" +
|
||||||
" \"wide_screen_mode\": true\n" +
|
|
||||||
" },\n" +
|
|
||||||
" \"header\": {\n" +
|
" \"header\": {\n" +
|
||||||
|
" \"template\": \"green\",\n" +
|
||||||
" \"title\": {\n" +
|
" \"title\": {\n" +
|
||||||
" \"tag\": \"plain_text\",\n" +
|
" \"content\": \"知识库分类负责人\",\n" +
|
||||||
" \"content\": \"点击下方的分类查看常见问题\"\n" +
|
" \"tag\": \"plain_text\"\n" +
|
||||||
" },\n" +
|
" }\n" +
|
||||||
" \"template\": \"green\"\n" +
|
" },\n" +
|
||||||
|
" \"elements\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"fields\": [\n" +
|
||||||
|
" {\n" +
|
||||||
|
" \"is_short\": true,\n" +
|
||||||
|
" \"text\": {\n" +
|
||||||
|
" \"content\": \"**\uD83D\uDC64 提交人:**\\n<at id=fag43ef3></at>\",\n" +
|
||||||
|
" \"tag\": \"lark_md\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" }\n" +
|
||||||
|
" ],\n" +
|
||||||
|
" \"tag\": \"div\"\n" +
|
||||||
|
" }\n" +
|
||||||
|
" ]\n" +
|
||||||
|
"}";*/
|
||||||
|
|
||||||
|
String sendJson = "{\n" +
|
||||||
|
" \"header\": {\n" +
|
||||||
|
" \"template\": \"green\",\n" +
|
||||||
|
" \"title\": {\n" +
|
||||||
|
" \"content\": \"知识库分类负责人\",\n" +
|
||||||
|
" \"tag\": \"plain_text\"\n" +
|
||||||
|
" }\n" +
|
||||||
" }\n" +
|
" }\n" +
|
||||||
"}";
|
"}";
|
||||||
JSONObject jsonObject = JSONObject.parseObject(sendJson);
|
JSONObject jsonObject = JSONObject.parseObject(sendJson);
|
||||||
JSONArray elements = new JSONArray();
|
JSONArray elements = new JSONArray();
|
||||||
JSONObject element = new JSONObject();
|
JSONObject element = new JSONObject();
|
||||||
element.put("tag","action");
|
JSONArray fields = new JSONArray();
|
||||||
element.put("layout","bisected");
|
|
||||||
|
|
||||||
//获取分类
|
//获取分类
|
||||||
List<ProblemKnowledgeBaseClassifyEO> problemKnowledgeBaseClassifyEOList = this.problemKnowledgeBaseClassifyEOService.list();
|
List<ProblemKnowledgeBaseClassifyEO> problemKnowledgeBaseClassifyEOList = this.problemKnowledgeBaseClassifyEOService.list();
|
||||||
this.problemKnowledgeBaseClassifyEOService.disposeData(problemKnowledgeBaseClassifyEOList);
|
this.problemKnowledgeBaseClassifyEOService.disposeData(problemKnowledgeBaseClassifyEOList);
|
||||||
|
|
||||||
JSONArray actions = new JSONArray();
|
//获取所有分类下的负责人信息
|
||||||
|
List<String> chargePersonUserIdList = new ArrayList<>();
|
||||||
//组装推送过去的点击按钮
|
|
||||||
for (ProblemKnowledgeBaseClassifyEO problemKnowledgeBaseClassifyEO : problemKnowledgeBaseClassifyEOList) {
|
for (ProblemKnowledgeBaseClassifyEO problemKnowledgeBaseClassifyEO : problemKnowledgeBaseClassifyEOList) {
|
||||||
JSONObject buttonObject = new JSONObject();
|
if(StringUtils.isNotEmpty(problemKnowledgeBaseClassifyEO.getChargePersonId())){
|
||||||
JSONObject text = new JSONObject();
|
String chargePersonId = problemKnowledgeBaseClassifyEO.getChargePersonId();
|
||||||
JSONObject value = new JSONObject();
|
for (String chargePerson : chargePersonId.split(",")) {
|
||||||
buttonObject.put("tag","button");
|
chargePersonUserIdList.add(chargePerson);
|
||||||
|
}
|
||||||
text.put("tag","plain_text");
|
}
|
||||||
text.put("content",problemKnowledgeBaseClassifyEO.getProblemLabel() + " [" + problemKnowledgeBaseClassifyEO.getChargePersonIdName() + "]");
|
|
||||||
value.put("chosen",problemKnowledgeBaseClassifyEO.getChargePersonId());
|
|
||||||
|
|
||||||
buttonObject.put("text",text);
|
|
||||||
buttonObject.put("type","primary");
|
|
||||||
buttonObject.put("value",value);
|
|
||||||
actions.add(buttonObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
element.put("actions",actions);
|
if(CollectionUtils.isNotEmpty(chargePersonUserIdList)){
|
||||||
|
List<SysUser> chargePersonUserList = this.sysUserService.querySysUserListByIdList(chargePersonUserIdList);
|
||||||
|
|
||||||
|
//组装推送过去的知识库负责人信息
|
||||||
|
for (ProblemKnowledgeBaseClassifyEO problemKnowledgeBaseClassifyEO : problemKnowledgeBaseClassifyEOList) {
|
||||||
|
JSONObject field = new JSONObject();
|
||||||
|
JSONObject text = new JSONObject();
|
||||||
|
StringBuilder atUserSb = new StringBuilder();
|
||||||
|
|
||||||
elements.add(element);
|
if(StringUtils.isNotEmpty(problemKnowledgeBaseClassifyEO.getChargePersonId())){
|
||||||
jsonObject.put("elements",elements);
|
for (String chargePersonId : problemKnowledgeBaseClassifyEO.getChargePersonId().split(",")) {
|
||||||
// 设置请求参数
|
for (SysUser sysUser : chargePersonUserList) {
|
||||||
JSONObject paramsMap = new JSONObject();
|
if(StringUtils.equals(chargePersonId,sysUser.getId())){
|
||||||
paramsMap.put("user_ids", userIds);
|
String thirdId = sysUser.getThirdId();
|
||||||
paramsMap.put("msg_type", "interactive");
|
atUserSb.append("<at id=" + thirdId + "></at>");
|
||||||
paramsMap.put("card", jsonObject);
|
atUserSb.append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 发送请求给飞书
|
text.put("content","问题标签:" + problemKnowledgeBaseClassifyEO.getProblemLabel() + "\n" + "责任人:" + atUserSb.toString());
|
||||||
String response = null;
|
text.put("tag","lark_md");
|
||||||
try {
|
|
||||||
response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
field.put("is_short",true);
|
||||||
} catch (IOException e) {
|
field.put("text",text);
|
||||||
e.printStackTrace();
|
fields.add(field);
|
||||||
}
|
}
|
||||||
// 获取返回结果
|
|
||||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
element.put("tag","div");
|
||||||
if(!tokenJson.get("code").toString().equals("0")) {
|
element.put("fields",fields);
|
||||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
elements.add(element);
|
||||||
|
jsonObject.put("elements",elements);
|
||||||
|
// 设置请求参数
|
||||||
|
JSONObject paramsMap = new JSONObject();
|
||||||
|
paramsMap.put("user_ids", userIds);
|
||||||
|
paramsMap.put("msg_type", "interactive");
|
||||||
|
paramsMap.put("card", jsonObject);
|
||||||
|
|
||||||
|
// 发送请求给飞书
|
||||||
|
String response = null;
|
||||||
|
try {
|
||||||
|
response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// 获取返回结果
|
||||||
|
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||||
|
if(!tokenJson.get("code").toString().equals("0")) {
|
||||||
|
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user