市场认证、法规清单删除完善。(去除冗余数据。),认证市场清单发送消息修改。
This commit is contained in:
+70
-15
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.authDummy.entity.*;
|
||||
@@ -23,6 +24,7 @@ import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
|
||||
import com.jero.modules.dummy.entity.DummyReadEO;
|
||||
import com.jero.modules.dummy.enums.InventoryStateEnum;
|
||||
import com.jero.modules.dummy.enums.ReadFlagEnum;
|
||||
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.log.entity.MarketListVersionUpdateLogEO;
|
||||
@@ -40,10 +42,7 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -144,6 +143,35 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
|
||||
// 市场认证清单明细数据
|
||||
QueryWrapper<AuthDummyInventoryInfoEO> adiRemoveWrap = new QueryWrapper<>();
|
||||
adiRemoveWrap.lambda().in(AuthDummyInventoryInfoEO::getAuthDummyInventoryBaseId,ids);
|
||||
this.iAuthDummyInventoryInfoEOService.remove(adiRemoveWrap);
|
||||
|
||||
// 内容变更表数据
|
||||
QueryWrapper<AuthDummyContentChangeEO> adccConnectIdRemoveWrap = new QueryWrapper<>();
|
||||
adccConnectIdRemoveWrap.lambda().in(AuthDummyContentChangeEO::getConnectId,ids);
|
||||
this.iAuthDummyContentChangeEOService.remove(adccConnectIdRemoveWrap);
|
||||
QueryWrapper<AuthDummyContentChangeEO> adccPidRemoveWrap = new QueryWrapper<>();
|
||||
adccPidRemoveWrap.lambda().in(AuthDummyContentChangeEO::getParentId,ids);
|
||||
this.iAuthDummyContentChangeEOService.remove(adccPidRemoveWrap);
|
||||
|
||||
// 更新log数据
|
||||
QueryWrapper<AuthDummyLog> adlRemoveWrap = new QueryWrapper<>();
|
||||
adlRemoveWrap.lambda().in(AuthDummyLog::getAuthDummyInventoryBaseId,ids);
|
||||
this.authDummyLogService.remove(adlRemoveWrap);
|
||||
|
||||
// 订阅数据
|
||||
QueryWrapper<AuthDummyReadEO> adrRemoveWrap = new QueryWrapper<>();
|
||||
adrRemoveWrap.lambda().in(AuthDummyReadEO::getAuthDummyInventoryBaseId,ids);
|
||||
this.authDummyReadEOService.remove(adrRemoveWrap);
|
||||
|
||||
// 市场清单版本历史数据
|
||||
QueryWrapper<MarketListVersionUpdateLogEO> mlvLogRemoveWrap = new QueryWrapper<>();
|
||||
mlvLogRemoveWrap.lambda().eq(MarketListVersionUpdateLogEO::getListType,ListTypeEnum.MARKET_CERTIFICATION_LIST.getValue());
|
||||
mlvLogRemoveWrap.lambda().in(MarketListVersionUpdateLogEO::getListId,ids);
|
||||
this.marketListVersionUpdateLogEOService.remove(mlvLogRemoveWrap);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,7 +288,7 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
baseWrapper.set("update_by",sysUser.getUsername())
|
||||
.set("update_time",now);
|
||||
}
|
||||
if(org.apache.commons.lang3.StringUtils.equals(authDummyInventoryBaseEO.getUpgradeOrNot(),"1")){
|
||||
if(org.apache.commons.lang3.StringUtils.equals(authDummyInventoryBaseEO.getUpgradeOrNot(), YesOrNoEnum.YES.getValue())){
|
||||
String upgradeExplanation = authDummyInventoryBaseEO.getUpgradeExplanation();
|
||||
String versionNum = authDummyInventoryBaseEO.getVersionNum();
|
||||
baseWrapper.set("upgrade_explanation",upgradeExplanation);
|
||||
@@ -277,7 +305,7 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
baseWrapper.eq("id",authDummyInventoryBaseEO.getId());
|
||||
authDummyInventoryBaseEOMapper.update(null,baseWrapper);
|
||||
|
||||
if(InventoryStateEnum.ISSUE.getValue().equals(authDummyInventoryBaseEO.getState()) && org.apache.commons.lang3.StringUtils.equals(authDummyInventoryBaseEO.getUpgradeOrNot(),"1")){
|
||||
if(InventoryStateEnum.ISSUE.getValue().equals(authDummyInventoryBaseEO.getState()) && org.apache.commons.lang3.StringUtils.equals(authDummyInventoryBaseEO.getUpgradeOrNot(),YesOrNoEnum.YES.getValue())){
|
||||
//先判断第一次发布的时候是否保存过数据
|
||||
LambdaQueryWrapper<AuthDummyContentChangeEO> wrapper =new LambdaQueryWrapper<>();
|
||||
wrapper.in(AuthDummyContentChangeEO::getConnectId,authDummyInventoryBaseEO.getId());
|
||||
@@ -411,8 +439,9 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
|
||||
List<String> userNameList = authDummyReadEOService.queryReadUserInfo(authDummyInventoryBaseEO.getId());
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
if(userNameList.size() != 0){
|
||||
List<String> userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList());
|
||||
userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList());
|
||||
thirdIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getThirdId()).collect(Collectors.toList());
|
||||
if(userIdList.size() != 0){
|
||||
//封装消息的实体类
|
||||
@@ -434,15 +463,41 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl<AuthDummyIn
|
||||
String href = backUrl + "/virtualAuthenticationListDetails?name=" + baseEO.getName() + "&useExplain=" + baseEO.getUseExplain() +"&id=" + baseEO.getId() +"&title=维护虚拟清单";
|
||||
try {
|
||||
String contentInfoFeiCn = "您所订阅的"+baseEO.getName()+"虚拟认证清单已更新,更新内容如下:";
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
|
||||
feishuMsgVo.setUrl(href);
|
||||
feishuMsgVo.setContentEn(contentLogFeishuTemp);
|
||||
feishuMsgVo.setContent(contentInfoFeiCn);
|
||||
|
||||
iFeishuService.sendCardMsgVirtua(thirdIdList.toArray(new String[]{}),feishuMsgVo,serialNumberAddList,serialNumberDeleteList);
|
||||
// FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
// feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
|
||||
// feishuMsgVo.setUrl(href);
|
||||
// feishuMsgVo.setContentEn(contentLogFeishuTemp);
|
||||
// feishuMsgVo.setContent(contentInfoFeiCn);
|
||||
//
|
||||
// iFeishuService.sendCardMsgVirtua(thirdIdList.toArray(new String[]{}),feishuMsgVo,serialNumberAddList,serialNumberDeleteList);
|
||||
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentLogFeishu, MessageTypeEnum.PUSH.getName(), href);
|
||||
} catch (IOException e) {
|
||||
|
||||
String contentCn = "";
|
||||
String contentEn = "";
|
||||
if(!serialNumberAddList.isEmpty() && serialNumberDeleteList.isEmpty()){
|
||||
contentCn = "1. 新增文档: " + org.apache.commons.lang3.StringUtils.join(serialNumberAddList,",");
|
||||
contentEn = "1. New regulations: " + org.apache.commons.lang3.StringUtils.join(serialNumberAddList,",");
|
||||
}
|
||||
if(serialNumberAddList.isEmpty() && !serialNumberDeleteList.isEmpty()){
|
||||
contentCn = "1. 删除文档: " + org.apache.commons.lang3.StringUtils.join(serialNumberDeleteList,",");
|
||||
contentEn = "1. Remove regulations: " + org.apache.commons.lang3.StringUtils.join(serialNumberDeleteList,",");
|
||||
}
|
||||
if(!serialNumberAddList.isEmpty() && !serialNumberDeleteList.isEmpty()){
|
||||
contentCn = "1. 新增文档: " + org.apache.commons.lang3.StringUtils.join(serialNumberAddList,",") + "\n"
|
||||
+"2. 删除文档: " + org.apache.commons.lang3.StringUtils.join(serialNumberDeleteList,",");
|
||||
contentEn = "1. New regulations: " + org.apache.commons.lang3.StringUtils.join(serialNumberAddList,",") + "\n"
|
||||
+"2. Remove regulations: " + org.apache.commons.lang3.StringUtils.join(serialNumberDeleteList,",");
|
||||
}
|
||||
//飞书消息(模板-20230410)
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("contentInfoFeiCn",contentInfoFeiCn + "\n" + contentCn);
|
||||
params.put("contentInfoFeiEn",contentLogFeishuTemp + "\n" + contentEn);
|
||||
params.put("userIdList",userIdList);
|
||||
params.put("back_url",href);
|
||||
params.put("titleCn", TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameCn());
|
||||
params.put("titleEn",TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameEn());
|
||||
iFeishuService.sendMessageSubscriptionNotification(TemplateInfoEnum2.SUBSCRIPTION_INFORM.getValue(),params);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ public class DummyInventoryBaseEO implements Serializable {
|
||||
@ApiModelProperty(value = "升版说明")
|
||||
private String upgradeExplanation;
|
||||
|
||||
// 是否升级 1是2否
|
||||
// 是否升级 1是0否 对应枚举类 YesOrNoEnum
|
||||
@TableField(exist = false)
|
||||
private String upgradeOrNot;
|
||||
}
|
||||
|
||||
+14
-2
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||
@@ -232,6 +233,17 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
QueryWrapper<DummyLogEO> logEOQueryWrapper = new QueryWrapper<>();
|
||||
logEOQueryWrapper.in("dummy_inventory_base_id",ids);
|
||||
dummyLogEOService.remove(logEOQueryWrapper);
|
||||
|
||||
// 订阅数据
|
||||
QueryWrapper<DummyReadEO> drRemoveWrap = new QueryWrapper<>();
|
||||
drRemoveWrap.lambda().in(DummyReadEO::getDummyInventoryBaseId,ids);
|
||||
this.dummyReadEOService.remove(drRemoveWrap);
|
||||
|
||||
// 市场清单版本历史数据
|
||||
QueryWrapper<MarketListVersionUpdateLogEO> mlvLogRemoveWrap = new QueryWrapper<>();
|
||||
mlvLogRemoveWrap.lambda().eq(MarketListVersionUpdateLogEO::getListType,ListTypeEnum.MARKET_REGULATION_LIST.getValue());
|
||||
mlvLogRemoveWrap.lambda().in(MarketListVersionUpdateLogEO::getListId,ids);
|
||||
this.marketListVersionUpdateLogEOService.remove(mlvLogRemoveWrap);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -351,7 +363,7 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
baseWrapper.set("update_by",sysUser.getUsername())
|
||||
.set("update_time",now);
|
||||
}
|
||||
if(StringUtils.equals(dummyInventoryBaseEO.getUpgradeOrNot(),"1")){
|
||||
if(StringUtils.equals(dummyInventoryBaseEO.getUpgradeOrNot(), YesOrNoEnum.YES.getValue())){
|
||||
String upgradeExplanation = dummyInventoryBaseEO.getUpgradeExplanation();
|
||||
String versionNum = dummyInventoryBaseEO.getVersionNum();
|
||||
baseWrapper.set("upgrade_explanation",upgradeExplanation);
|
||||
@@ -380,7 +392,7 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
//先判断是发布还是撤回 1-->发布 2-->撤回
|
||||
//撤回需要发消息
|
||||
|
||||
if(InventoryStateEnum.ISSUE.getValue().equals(dummyInventoryBaseEO.getState()) && StringUtils.equals(dummyInventoryBaseEO.getUpgradeOrNot(),"1")){
|
||||
if(InventoryStateEnum.ISSUE.getValue().equals(dummyInventoryBaseEO.getState()) && StringUtils.equals(dummyInventoryBaseEO.getUpgradeOrNot(),YesOrNoEnum.YES.getValue())){
|
||||
//先判断第一次发布的时候是否保存过数据
|
||||
LambdaQueryWrapper<DummyContentChangeEO> wrapper =new LambdaQueryWrapper<>();
|
||||
wrapper.in(DummyContentChangeEO::getConnectId,dummyInventoryBaseEO.getId());
|
||||
|
||||
Reference in New Issue
Block a user