Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
zyx.net
2022-08-22 16:29:32 +08:00
3 changed files with 95 additions and 49 deletions
@@ -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` = '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 ('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');
@@ -946,15 +946,15 @@ INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_ti
-- 删除之前的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`
ADD COLUMN `approval_opinion` varchar(2000) NULL COMMENT '审批意见' AFTER `flow_type`;
--- 用户表 删除工号唯一索引 2022-08-18
--- 用户表 删除工号唯一索引 2022-08-18 已同步生产环境
ALTER TABLE `laws_weilai`.`sys_user`
DROP INDEX `uniq_sys_user_work_no`;
-- 工作流 流程表增加流程名称 英文字段 2022-08-19
-- 工作流 流程表增加流程名称 英文字段 2022-08-19 已同步生产环境
ALTER TABLE `laws_weilai_wkflow`.`bus_process_name`
ADD COLUMN `PRC_NAME_EN` varchar(255) NULL COMMENT '流程名称(英文)' AFTER `PROJECT_LAWS_INVENTORY_ID`;
@@ -772,6 +772,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
OnlCgformField onlCgformField = fieldList.get(i);
Map<String, Object> map = new HashMap<>();
String dbFieldName = onlCgformField.getDbFieldName();
if ("nioNumber".equals(dbFieldName) || "paramsName".equals(dbFieldName)) {
map.put("click3", true);
}
if ("description".equals(dbFieldName)) {
indexOfDescription = i;
map.put("click2", true);
@@ -21,6 +21,7 @@ import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.util.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -565,69 +566,111 @@ public class FeishuServiceImpl implements IFeishuService {
headerMap.put("Authorization", "Bearer " + token);
headerMap.put("Content-Type", "application/json; charset=utf-8");
String sendJson = " {\n" +
" \"config\": {\n" +
" \"wide_screen_mode\": true\n" +
" },\n" +
//参考:https://open.feishu.cn/tool/cardbuilder?from=openplantform_mcb_entrance
/*String sendJson = "{\n" +
" \"header\": {\n" +
" \"template\": \"green\",\n" +
" \"title\": {\n" +
" \"tag\": \"plain_text\",\n" +
" \"content\": \"点击下方的分类查看常见问题\"\n" +
" },\n" +
" \"template\": \"green\"\n" +
" \"content\": \"知识库分类负责人\",\n" +
" \"tag\": \"plain_text\"\n" +
" }\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" +
"}";
JSONObject jsonObject = JSONObject.parseObject(sendJson);
JSONArray elements = new JSONArray();
JSONObject element = new JSONObject();
element.put("tag","action");
element.put("layout","bisected");
JSONArray fields = new JSONArray();
//获取分类
List<ProblemKnowledgeBaseClassifyEO> problemKnowledgeBaseClassifyEOList = this.problemKnowledgeBaseClassifyEOService.list();
this.problemKnowledgeBaseClassifyEOService.disposeData(problemKnowledgeBaseClassifyEOList);
JSONArray actions = new JSONArray();
//组装推送过去的点击按钮
//获取所有分类下的负责人信息
List<String> chargePersonUserIdList = new ArrayList<>();
for (ProblemKnowledgeBaseClassifyEO problemKnowledgeBaseClassifyEO : problemKnowledgeBaseClassifyEOList) {
JSONObject buttonObject = new JSONObject();
JSONObject text = new JSONObject();
JSONObject value = new JSONObject();
buttonObject.put("tag","button");
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);
if(StringUtils.isNotEmpty(problemKnowledgeBaseClassifyEO.getChargePersonId())){
String chargePersonId = problemKnowledgeBaseClassifyEO.getChargePersonId();
for (String chargePerson : chargePersonId.split(",")) {
chargePersonUserIdList.add(chargePerson);
}
}
}
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);
jsonObject.put("elements",elements);
// 设置请求参数
JSONObject paramsMap = new JSONObject();
paramsMap.put("user_ids", userIds);
paramsMap.put("msg_type", "interactive");
paramsMap.put("card", jsonObject);
if(StringUtils.isNotEmpty(problemKnowledgeBaseClassifyEO.getChargePersonId())){
for (String chargePersonId : problemKnowledgeBaseClassifyEO.getChargePersonId().split(",")) {
for (SysUser sysUser : chargePersonUserList) {
if(StringUtils.equals(chargePersonId,sysUser.getId())){
String thirdId = sysUser.getThirdId();
atUserSb.append("<at id=" + thirdId + "></at>");
atUserSb.append(" ");
}
}
}
}
// 发送请求给飞书
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);
text.put("content","问题标签:" + problemKnowledgeBaseClassifyEO.getProblemLabel() + "\n" + "责任人:" + atUserSb.toString());
text.put("tag","lark_md");
field.put("is_short",true);
field.put("text",text);
fields.add(field);
}
element.put("tag","div");
element.put("fields",fields);
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);
}
}
}