Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
@@ -140,6 +140,7 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/opensso/**", "anon"); //单点登录
|
||||
|
||||
filterChainDefinitionMap.put("/project/projectLawsInventoryEO/processCall", "anon"); // 项目库-法规清单 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/project/projectTaskInventoryEO/processCall", "anon"); // 项目库-任务清单 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/sys/user/querySysUserListByIdList", "anon"); // 工作流根据用户idList获取用户信息接口
|
||||
|
||||
// 添加自己的过滤器并且取名为jwt
|
||||
|
||||
+2
-2
@@ -2363,7 +2363,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
|
||||
private void sendWebsocket(String msgId, String msgTet) {
|
||||
public void sendWebsocket(String msgId, String msgTet) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||
obj.put(WebsocketConst.MSG_ID, msgId);
|
||||
@@ -2424,7 +2424,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
|
||||
|
||||
@NotNull
|
||||
private SysAnnouncement getSysAnnouncement(List<String> userIdList, String content, String contentInfo) {
|
||||
public SysAnnouncement getSysAnnouncement(List<String> userIdList, String content, String contentInfo) {
|
||||
SysAnnouncement sysAnnouncement = new SysAnnouncement();
|
||||
sysAnnouncement.setDelFlag("0");
|
||||
sysAnnouncement.setSendStatus("0");
|
||||
|
||||
+13
-8
@@ -1,7 +1,8 @@
|
||||
package com.jero.modules.dummy.service;
|
||||
|
||||
import com.jero.modules.dummy.entity.DummyReadEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.dummy.entity.DummyReadEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -18,7 +19,7 @@ public interface IDummyReadEOService extends IService<DummyReadEO> {
|
||||
* @param dummyReadEO
|
||||
* @return
|
||||
*/
|
||||
void add(DummyReadEO dummyReadEO);
|
||||
void add(DummyReadEO dummyReadEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
@@ -26,7 +27,7 @@ public interface IDummyReadEOService extends IService<DummyReadEO> {
|
||||
* @param dummyReadEO
|
||||
* @return
|
||||
*/
|
||||
void editById(DummyReadEO dummyReadEO);
|
||||
void editById(DummyReadEO dummyReadEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
@@ -34,7 +35,7 @@ public interface IDummyReadEOService extends IService<DummyReadEO> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
@@ -42,7 +43,7 @@ public interface IDummyReadEOService extends IService<DummyReadEO> {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
@@ -50,12 +51,16 @@ public interface IDummyReadEOService extends IService<DummyReadEO> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
DummyReadEO queryById(String id);
|
||||
DummyReadEO queryById(String id);
|
||||
|
||||
/**
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<DummyReadEO> queryList();
|
||||
List<DummyReadEO> queryList();
|
||||
|
||||
|
||||
/**查询订阅虚拟清单的用户*/
|
||||
List<String> queryReadUserInfo(String dummyInventoryBaseId);
|
||||
}
|
||||
|
||||
+235
-33
@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||
import com.jero.modules.domain.service.DomainUserRelService;
|
||||
import com.jero.modules.dummy.entity.DummyContentChangeEO;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
|
||||
@@ -19,16 +22,23 @@ import com.jero.modules.dummy.service.IDummyInventoryBaseEOService;
|
||||
import com.jero.modules.dummy.service.IDummyInventoryInfoEOService;
|
||||
import com.jero.modules.dummy.service.IDummyReadEOService;
|
||||
import com.jero.modules.dummy.util.ListDiff;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysAnnouncementService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -50,8 +60,18 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
private IDummyContentChangeEOService iDummyContentChangeEOService;
|
||||
@Autowired
|
||||
private IDummyInventoryInfoEOService iDummyInventoryInfoEOService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private BussDocumentLibraryEOServiceImpl bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private DomainUserRelService domainUserRelService;
|
||||
@Autowired
|
||||
private ISysAnnouncementService sysAnnouncementService;
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
@Resource
|
||||
private IFeishuService iFeishuService;
|
||||
@Resource
|
||||
private WebSocket webSocket;
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -193,7 +213,7 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
//发布与撤回均需要发消息(向订阅的人员发消息)
|
||||
//首次发布不发消息
|
||||
//(1)首次发布将虚拟清单的基础数据和详情数据存入维护清单内容变更表_dummy_content_change
|
||||
//(2)撤回再次编辑完后再次发布
|
||||
//(2)撤回再次编辑完后再次发布,发消息
|
||||
//A. 分别判断基础数据和详情数据同上次发布的数据是否发生变化
|
||||
//发生变化-->发消息,删除dummy_content_change中上一次存入的数据,将本次数据存入
|
||||
//没有变化-->不发消息,数据不处理
|
||||
@@ -257,7 +277,6 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
baseCJList.get(i);
|
||||
dummyInventoryBaseEOList.get(i);
|
||||
baseDiff = ListDiff.compareObject(baseCJList.get(i), dummyInventoryBaseEOList.get(i));
|
||||
System.out.println(baseDiff);//不同的字段原,现,{name=[虚拟清单33331122211, 虚拟清单3333444]}
|
||||
}
|
||||
|
||||
//4.对比详情表数据
|
||||
@@ -266,40 +285,60 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
|
||||
//4.2详情表数据(一条基础数据可能对应多个详情数据---一对多)
|
||||
//数据库里原来的详情数据
|
||||
for(DummyContentChangeEO dummyContentChangeEO : dummyContentChangeEOInfoList){
|
||||
Map<String, String> infoDiff = null;
|
||||
List<Map<String, String>> infoDiffList=null;
|
||||
String addSerialNumber=null;
|
||||
String deleteSerialNumber=null;
|
||||
List<String> addSerialNumberList =null;
|
||||
List<String> deleteSerialNumberList =null;
|
||||
//对比,获取值不同的字段
|
||||
for(DummyContentChangeEO dummyContentChangeEO : dummyContentChangeEOInfoList) {
|
||||
String infoCJ = dummyContentChangeEO.getContentJson();
|
||||
List<DummyInventoryInfoEO> infoCJList = JSONArray.parseArray(infoCJ,DummyInventoryInfoEO.class);//json转list
|
||||
//对比,获取值不同的字段
|
||||
Map<String, String> infoDiff = null;
|
||||
if(infoCJList.size()==dummyInventoryInfoEOList.size()) {//现在的详情数据数量和数据库里的一样
|
||||
for (int i = 0; i < infoCJList.size(); i++) {
|
||||
DummyInventoryInfoEO h = infoCJList.get(i);
|
||||
DummyInventoryInfoEO g = dummyInventoryInfoEOList.get(i);
|
||||
infoDiff = ListDiff.compareObject(infoCJList.get(i), dummyInventoryInfoEOList.get(i));
|
||||
System.out.println(infoDiff);//不同的字段原,现
|
||||
}
|
||||
}else{//现在的详情数据数量和数据库里的不一样<--详情的id不一样
|
||||
String diffId=null;
|
||||
StringBuilder diffIdBuilder=new StringBuilder();
|
||||
for(DummyInventoryInfoEO dummyInventoryInfoEO : infoCJList) {
|
||||
diffId = dummyInventoryInfoEOList.stream().filter(e -> !dummyInventoryInfoEO.equals(e.getId()))
|
||||
.map(f->f.getId()).collect(Collectors.joining(","));
|
||||
diffIdBuilder.append(diffId).append(",");
|
||||
|
||||
}
|
||||
diffIdBuilder.substring(0,diffIdBuilder.toString().length()-1);
|
||||
List<DummyInventoryInfoEO> infoCJList = JSONArray.parseArray(infoCJ, DummyInventoryInfoEO.class);//json转list
|
||||
//获取数据库和传入同时存在的编号
|
||||
List<String> infoCJBaseSerialNumberList = infoCJList.stream().map(e -> e.getSerialNumber()).collect(Collectors.toList());
|
||||
List<String> dummyInventoryInfoEOSerialNumberList = dummyInventoryInfoEOList.stream().map(e -> e.getSerialNumber()).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(dummyInventoryInfoEOSerialNumberList)) {
|
||||
dummyInventoryInfoEOSerialNumberList.removeIf(s -> !infoCJBaseSerialNumberList.contains(s));
|
||||
|
||||
}
|
||||
System.out.println(infoCJList);
|
||||
System.out.println(dummyInventoryInfoEOSerialNumberList);
|
||||
|
||||
//4.2.1处理原有详情数据
|
||||
for (int i = 0; i < infoCJList.size(); i++) {
|
||||
infoDiff = ListDiff.compareObject(infoCJList.get(i), dummyInventoryInfoEOList.get(i));
|
||||
infoDiffList.add(infoDiff);
|
||||
}
|
||||
|
||||
//4.2.2处理新增数据
|
||||
List<String> infoCJSerialNumberList = infoCJList.stream().map(e -> e.getSerialNumber()).collect(Collectors.toList());
|
||||
for (DummyInventoryInfoEO dummyInventoryInfoEO : infoCJList) {
|
||||
addSerialNumberList = dummyInventoryInfoEOList.stream().filter(e -> !dummyInventoryInfoEO.equals(e.getId()))
|
||||
.map(f -> f.getSerialNumber()).collect(Collectors.toList());
|
||||
}
|
||||
//去掉发布时传入的和数据库同时有的数据
|
||||
for(String midSerialNumber:infoCJSerialNumberList){
|
||||
addSerialNumberList.remove(midSerialNumber);
|
||||
}
|
||||
addSerialNumber =StringUtils.join(addSerialNumberList,",");
|
||||
|
||||
|
||||
// JsonDiff.compareJson(infoCJjson,info,null);
|
||||
|
||||
//4.2.3处理删除的数据
|
||||
for (DummyInventoryInfoEO dummyInventoryInfoEO : infoCJList) {
|
||||
deleteSerialNumberList = dummyInventoryInfoEOList.stream().filter(e -> !dummyInventoryInfoEO.equals(e.getId()))
|
||||
.map(f -> f.getSerialNumber()).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
for(String midSerialNumber:deleteSerialNumberList){
|
||||
infoCJSerialNumberList.remove(midSerialNumber);
|
||||
}
|
||||
deleteSerialNumber=StringUtils.join(infoCJSerialNumberList,",");
|
||||
}
|
||||
//向订阅该领域管理的人发消息和飞书
|
||||
sendMsg(baseDiff,dummyContentChangeEOBaseList.get(0).getConnectId(),infoDiff,addSerialNumber,deleteSerialNumber);
|
||||
|
||||
|
||||
//6.数据对比完成后.删除之前保存的dummy_inventory_info中的数据,重新保存最新的数据
|
||||
//5.数据对比完成后.删除之前保存的dummy_inventory_info中的数据,重新保存最新的数据
|
||||
|
||||
|
||||
}
|
||||
@@ -312,4 +351,167 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void sendMsg(Map<String, String> baseDiff, String idTemp,Map<String, String> infoDiff,String addSerialNumber,String deleteSerialNumber) {
|
||||
|
||||
String baseName=queryById(idTemp).getName();//基础表id
|
||||
List<String> userNameList = dummyReadEOService.queryReadUserInfo(idTemp);
|
||||
List<String> userIdList=sysUserService.queryUserIdListByNameList(userNameList).stream().map(e->e.getId()).collect(Collectors.toList());
|
||||
//给发送消息的用户
|
||||
if(userIdList.size() == 0){
|
||||
return;
|
||||
}
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
if (userIdList.size() != 0) {
|
||||
String href = backUrl + "/dummy/dummyInventoryBaseEO/issue?id=" + idTemp;
|
||||
|
||||
//The xx virtual list you subscribed to has been updated as follows:1 . xxxxx 2.xxxx
|
||||
String content ="The " + baseName + " virtual list you subscribed to has been updated.";
|
||||
String contentInfo ="The " + baseName + " virtual list you subscribed to has been updated as follows : " + "\r\n";
|
||||
setContentInfo(contentInfo,baseDiff,infoDiff,addSerialNumber,deleteSerialNumber);
|
||||
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, content, contentInfo);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
bussDocumentLibraryEOService.sendWebsocket(idTemp, idTemp);
|
||||
//飞书
|
||||
try {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), content, MessageTypeEnum.PUSH.getName(), href);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setContentInfo(String contentInfo,Map<String, String> baseDiff,Map<String, String> infoDiff,String addSerialNumber,String deleteSerialNumber) {
|
||||
int row = 1;
|
||||
//设置虚拟清单列表的修改消息
|
||||
if(MapUtils.isNotEmpty(baseDiff)) {
|
||||
//虚拟清单名称
|
||||
if (StringUtils.isNotBlank(baseDiff.get("name"))) {
|
||||
List<String> nameList = Arrays.asList(baseDiff.get("name").split(","));
|
||||
String baseDiffOldName = nameList.get(0);
|
||||
String baseDiffNewName = nameList.get(1);
|
||||
contentInfo += row + ". The name of virtual list has been changed from " + baseDiffOldName + " to " + baseDiffNewName + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
//适用说明
|
||||
if (StringUtils.isNotBlank(baseDiff.get("useExplain"))) {
|
||||
List<String> useExplainList = Arrays.asList(baseDiff.get("useExplain").split(","));
|
||||
String baseDiffOldUseExplain = useExplainList.get(0);
|
||||
String baseDiffNewUseExplain = useExplainList.get(1);
|
||||
contentInfo += row + ". The applicable instructions of virtual list has been changed from " + baseDiffOldUseExplain + " to " + baseDiffNewUseExplain + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
}
|
||||
|
||||
//设置维护清单的新增消息
|
||||
if (StringUtils.isNotBlank(addSerialNumber)) {
|
||||
contentInfo += row + ". " + "This virtual list has been added serial number : " + addSerialNumber + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
|
||||
//设置维护清单的删除消息
|
||||
if (StringUtils.isNotBlank(deleteSerialNumber)) {
|
||||
contentInfo += row + ". " + "This virtual list has been deleted serial number : " + deleteSerialNumber + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
|
||||
//设置维护清单的修改消息
|
||||
if(MapUtils.isNotEmpty(infoDiff)) {
|
||||
//技术领域
|
||||
if (StringUtils.isNotBlank(infoDiff.get("technologyTerritory"))) {
|
||||
List<String> technologyTerritoryList = Arrays.asList(infoDiff.get("technologyTerritory").split(","));
|
||||
String infoDiffOldTechnologyTerritory = technologyTerritoryList.get(0);
|
||||
String infoDiffNewTechnologyTerritory = technologyTerritoryList.get(1);
|
||||
contentInfo += row + ". " + infoDiffOldTechnologyTerritory + " has been changed to" + infoDiffNewTechnologyTerritory + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
//新车型实施日期
|
||||
if (StringUtils.isNotBlank(infoDiff.get("xin1Che1Xing2Shi2Shi1Ri4Qi1"))) {
|
||||
List<String> xin1Che1Xing2Shi2Shi1Ri4Qi1List = Arrays.asList(infoDiff.get("xin1Che1Xing2Shi2Shi1Ri4Qi1").split(","));
|
||||
String infoDiffOldXin1Che1Xing2Shi2Shi1Ri4Qi1 = xin1Che1Xing2Shi2Shi1Ri4Qi1List.get(0);
|
||||
String infoDiffNewXin1Che1Xing2Shi2Shi1Ri4Qi1 = xin1Che1Xing2Shi2Shi1Ri4Qi1List.get(1);
|
||||
contentInfo += row + ". " + infoDiffOldXin1Che1Xing2Shi2Shi1Ri4Qi1 + " has been changed to" + infoDiffNewXin1Che1Xing2Shi2Shi1Ri4Qi1 + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
//在产车实施日期
|
||||
if (StringUtils.isNotBlank(infoDiff.get("implementTime"))) {
|
||||
List<String> implementTimeList = Arrays.asList(infoDiff.get("implementTime").split(","));
|
||||
String infoDiffOldImplementTime = implementTimeList.get(0);
|
||||
String infoDiffNewImplementTime = implementTimeList.get(1);
|
||||
contentInfo += row + ". " + infoDiffOldImplementTime + " has been changed to" + infoDiffNewImplementTime + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
//WVTA ID
|
||||
if (StringUtils.isNotBlank(infoDiff.get("wvtaId"))) {
|
||||
List<String> wvtaIdList = Arrays.asList(infoDiff.get("wvtaId").split(","));
|
||||
String infoDiffOldWvtaId = wvtaIdList.get(0);
|
||||
String infoDiffNewWvtaId = wvtaIdList.get(1);
|
||||
contentInfo += row + ". " + infoDiffOldWvtaId + " has been changed to" + infoDiffNewWvtaId + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
//子标题
|
||||
if (StringUtils.isNotBlank(infoDiff.get("subtitle"))) {
|
||||
List<String> subtitleList = Arrays.asList(infoDiff.get("subtitle").split(","));
|
||||
String infoDiffOldSubtitle = subtitleList.get(0);
|
||||
String infoDiffNewSubtitle = subtitleList.get(1);
|
||||
contentInfo += row + ". " + infoDiffOldSubtitle + " has been changed to" + infoDiffNewSubtitle + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
//实施类别
|
||||
if (StringUtils.isNotBlank(infoDiff.get("implementType"))) {
|
||||
List<String> implementTypeList = Arrays.asList(infoDiff.get("implementType").split(","));
|
||||
String infoDiffOldImplementType = implementTypeList.get(0);
|
||||
String infoDiffNewImplementType = implementTypeList.get(1);
|
||||
contentInfo += row + ". " + infoDiffOldImplementType + " has been changed to" + infoDiffNewImplementType + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
//认证类型
|
||||
if (StringUtils.isNotBlank(infoDiff.get("attestationType"))) {
|
||||
List<String> attestationTypeList = Arrays.asList(infoDiff.get("attestationType").split(","));
|
||||
String infoDiffOldAttestationType = attestationTypeList.get(0);
|
||||
String infoDiffNewAttestationType = attestationTypeList.get(1);
|
||||
contentInfo += row + ". " + infoDiffOldAttestationType + " has been changed to" + infoDiffNewAttestationType + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
|
||||
//认证级别
|
||||
//责任领域
|
||||
//备注
|
||||
//设计符合性确认-交付物类型
|
||||
//设计符合性确认-交付物模板
|
||||
//设计符合性确认-发起人
|
||||
//设计符合性确认-责任人
|
||||
//prehomo确认-交付物类型
|
||||
//prehomo确认-交付物模板
|
||||
//prehomo确认-发起人
|
||||
//prehomo确认-责任人
|
||||
//验证符合性确认-交付物类型
|
||||
//验证符合性确认-交付物模板
|
||||
//验证符合性确认-发起人
|
||||
//验证符合性确认-责任人
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void setContent(String contentInfo,Map<String, String> infoDiff, String field,int row){
|
||||
|
||||
if (StringUtils.isNotBlank(infoDiff.get(field))) {
|
||||
List<String> list = Arrays.asList(infoDiff.get(field).split(","));
|
||||
String infoDiffOld = list.get(0);
|
||||
String infoDiffNew = list.get(1);
|
||||
contentInfo += row + ". " + infoDiffOld + " has been changed to" + infoDiffNew + ".\r\n";
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+53
-27
@@ -1,12 +1,17 @@
|
||||
package com.jero.modules.dummy.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.dummy.entity.DummyReadEO;
|
||||
import com.jero.modules.dummy.mapper.DummyReadEOMapper;
|
||||
import com.jero.modules.dummy.service.IDummyReadEOService;
|
||||
import me.zhyd.oauth.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 虚拟清单订阅表
|
||||
@@ -16,6 +21,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
*/
|
||||
@Service
|
||||
public class DummyReadEOServiceImpl extends ServiceImpl<DummyReadEOMapper, DummyReadEO> implements IDummyReadEOService {
|
||||
@Autowired
|
||||
private DummyReadEOMapper dummyReadEOMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -24,12 +32,12 @@ public class DummyReadEOServiceImpl extends ServiceImpl<DummyReadEOMapper, Dummy
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(DummyReadEO dummyReadEO) {
|
||||
Date now = new Date();
|
||||
dummyReadEO.setCreateTime(now);
|
||||
dummyReadEO.setUpdateTime(now);
|
||||
save(dummyReadEO);
|
||||
}
|
||||
public void add(DummyReadEO dummyReadEO) {
|
||||
Date now = new Date();
|
||||
dummyReadEO.setCreateTime(now);
|
||||
dummyReadEO.setUpdateTime(now);
|
||||
save(dummyReadEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
@@ -38,11 +46,11 @@ public class DummyReadEOServiceImpl extends ServiceImpl<DummyReadEOMapper, Dummy
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(DummyReadEO dummyReadEO) {
|
||||
Date now = new Date();
|
||||
dummyReadEO.setUpdateTime(now);
|
||||
saveOrUpdate(dummyReadEO);
|
||||
}
|
||||
public void editById(DummyReadEO dummyReadEO) {
|
||||
Date now = new Date();
|
||||
dummyReadEO.setUpdateTime(now);
|
||||
saveOrUpdate(dummyReadEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
@@ -51,9 +59,9 @@ public class DummyReadEOServiceImpl extends ServiceImpl<DummyReadEOMapper, Dummy
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
@@ -62,9 +70,9 @@ public class DummyReadEOServiceImpl extends ServiceImpl<DummyReadEOMapper, Dummy
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
@@ -73,17 +81,35 @@ public class DummyReadEOServiceImpl extends ServiceImpl<DummyReadEOMapper, Dummy
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public DummyReadEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
public DummyReadEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DummyReadEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
public List<DummyReadEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订阅虚拟清单的用户
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> queryReadUserInfo(String dummyInventoryBaseId) {
|
||||
//获取订阅该虚拟清单的所有用户信息
|
||||
if(StringUtils.isNotEmpty(dummyInventoryBaseId)){
|
||||
QueryWrapper<DummyReadEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("create_by").eq("dummy_inventory_base_id",dummyInventoryBaseId);
|
||||
List<String> readUserList = list(queryWrapper).stream().map(e -> e.getCreateBy()).distinct().collect(Collectors.toList());
|
||||
return readUserList;
|
||||
}else{
|
||||
throw new JeroBootException("The virtual inventory is not subscribed.");//该虚拟清单未被订阅
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ public class ListDiff <T> {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if( ! equals(v1, v2)
|
||||
&& !f.getName().equals("updateTime") ){
|
||||
if( ! equals(v1, v2) && !f.getName().contains("create")
|
||||
&& !f.getName().contains("update") ){
|
||||
|
||||
StringBuilder v1String= new StringBuilder(String.valueOf(v1));
|
||||
StringBuilder v2String= new StringBuilder(String.valueOf(v2));
|
||||
@@ -28,7 +28,7 @@ public class ListDiff <T> {
|
||||
|
||||
|
||||
result.put(f.getName(), v1String.append(",").append(v2String).toString());
|
||||
System.out.println("zlzl");
|
||||
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
+25
@@ -4,6 +4,8 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
@@ -167,4 +169,27 @@ public class ProjectTaskInventoryEOController extends JeroController<ProjectTask
|
||||
return super.importExcel(request, response, ProjectTaskInventoryEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程调用接口
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-任务清单表-流程调用")
|
||||
@ApiOperation(value="项目库-任务清单表-流程调用", notes="项目库-任务清单表-流程调用")
|
||||
@PostMapping(value = "/processCall")
|
||||
public Result<?> processCall(@RequestBody JSONObject jsonObject){
|
||||
return this.projectTaskInventoryEOService.processCall(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提醒办理
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-任务清单表-提醒办理")
|
||||
@ApiOperation(value="项目库-任务清单表-提醒办理", notes="项目库-任务清单表-提醒办理")
|
||||
@PostMapping(value = "/remindDispose")
|
||||
public Result<?> remindDispose(@RequestBody JSONObject jsonObject){
|
||||
return this.projectTaskInventoryEOService.remindDispose(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -8,6 +8,9 @@ public enum MsgTypeEnum {
|
||||
TASK_AFFIRM_ISSUE_DRE_MSG("任务确认分配dre消息","taskAffirmIssueDreMsg"),
|
||||
TASK_AFFIRM_DRE_ACCEPTED("任务确认DRE通过消息","taskAffirmDreAccepted"),
|
||||
TASK_AFFIRM_DRE_REJECTED("任务确认DRE退回消息","taskAffirmDreRejected"),
|
||||
|
||||
DESIGN_ISSUE_DRE_MSG("设计符合性确认分配dre消息","designIssueDreMsg"),
|
||||
DESIGN_REMIND_MSG("设计符合性提醒办理","designRemindMsg"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ public enum OperatorTypeEnum {
|
||||
|
||||
|
||||
TASK_AFFIRM_QUERY("任务确认流程,查询法规清单信息","taskAffirmQuery"),
|
||||
ADD_TASK_INVENTORY_DETAIL("添加法规清单明细信息","addTaskInventoryDetail"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+2
-2
@@ -130,9 +130,9 @@ public class InventoryAffirmJob implements Job {
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
/*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*/
|
||||
String msgContentEN = "The the regulation task confirmation of GB 7258 in "
|
||||
String msgContentEN = "The the regulation list confirmation of "
|
||||
+ projectNameInfoEO.getProjectName()
|
||||
+ "(projectname) is coming to an end today. Please check and deal with it intime";
|
||||
+ "(project name) is coming to an end today. Please check and deal with it in time";
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLibraryBase.getId());
|
||||
}
|
||||
|
||||
+16
@@ -1,5 +1,7 @@
|
||||
package com.jero.modules.project.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -60,4 +62,18 @@ public interface IProjectTaskInventoryEOService extends IService<ProjectTaskInve
|
||||
* @return
|
||||
*/
|
||||
List<ProjectTaskInventoryEO> queryList(ProjectTaskInventoryEO projectTaskInventoryEO, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 项目库-任务清单表-流程调用
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
Result<?> processCall(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 项目库-任务清单表-提醒办理
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
Result<?> remindDispose(JSONObject jsonObject);
|
||||
}
|
||||
|
||||
+129
-12
@@ -1,21 +1,18 @@
|
||||
package com.jero.modules.project.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryDetailEO;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.jero.modules.project.enums.InventoryAffirmStatusEnum;
|
||||
import com.jero.modules.project.enums.ProjectRoleEnum;
|
||||
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
|
||||
import com.jero.modules.project.enums.TaskStatusEnum;
|
||||
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||
import com.jero.modules.project.mapper.ProjectTaskInventoryDetailEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectTaskInventoryEOMapper;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.*;
|
||||
import com.jero.modules.project.mapper.*;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||
import com.jero.modules.project.util.SendMessageUtils;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.mapper.SysUserMapper;
|
||||
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -24,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -50,6 +48,12 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
@Autowired
|
||||
private ProjectTaskInventoryDetailEOMapper projectTaskInventoryDetailEOMapper;
|
||||
|
||||
@Autowired
|
||||
private ProjectNameInfoEOMapper projectNameInfoEOMapper;
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -175,6 +179,80 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> processCall(JSONObject jsonObject) {
|
||||
String requestSource = jsonObject.getString("requestSource");
|
||||
if(StringUtils.isEmpty(requestSource)){
|
||||
throw new JeroBootException("请求来源不能为空!");
|
||||
}
|
||||
if(!StringUtils.equals(requestSource, RequestSourceEnum.WORK_FLOW.getValue())){
|
||||
throw new JeroBootException("来源有误,没有权限调用该接口!");
|
||||
}
|
||||
String operatorType = jsonObject.getString("operatorType");
|
||||
if(StringUtils.isEmpty(operatorType)){
|
||||
throw new JeroBootException("操作类型不能为空!");
|
||||
}
|
||||
|
||||
if(StringUtils.equals(operatorType,OperatorTypeEnum.UPDATE_STATUS.getValue())){
|
||||
ProjectTaskInventoryEO projectTaskInventoryEO = JSONObject.parseObject(jsonObject.toString(), ProjectTaskInventoryEO.class);
|
||||
this.baseMapper.updateById(projectTaskInventoryEO);
|
||||
}else if(StringUtils.equals(operatorType,OperatorTypeEnum.SEND_MSG.getValue())){
|
||||
workFlowSendMsg(jsonObject);
|
||||
}else if(StringUtils.equals(operatorType,OperatorTypeEnum.ADD_TASK_INVENTORY_DETAIL.getValue())){
|
||||
//添加法规清单明细数据。
|
||||
JSONArray taskInventoryDetailList = jsonObject.getJSONArray("taskInventoryDetailList");
|
||||
ProjectTaskInventoryDetailEO projectTaskInventoryDetailEO = null;
|
||||
for (Object detail : taskInventoryDetailList) {
|
||||
projectTaskInventoryDetailEO = JSONObject.parseObject(JSONObject.toJSONString(detail),ProjectTaskInventoryDetailEO.class);
|
||||
projectTaskInventoryDetailEOMapper.insert(projectTaskInventoryDetailEO);
|
||||
}
|
||||
}
|
||||
|
||||
return new Result<>().success("调用成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目库-任务清单表-提醒办理
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<?> remindDispose(JSONObject jsonObject) {
|
||||
|
||||
//发送消息类型
|
||||
String msgType = jsonObject.getString("msgType");
|
||||
|
||||
if(StringUtils.isEmpty(msgType)){
|
||||
throw new JeroBootException("发送消息类型不能为空,请检查!");
|
||||
}
|
||||
String serialNumber = jsonObject.getString("serialNumber");
|
||||
//项目库id
|
||||
String projectLibraryId = jsonObject.getString("projectLibraryId");
|
||||
|
||||
String msgContentEN = "";
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>()
|
||||
.lambda().eq(ProjectLibraryBase::getId, projectLibraryId));
|
||||
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
|
||||
|
||||
if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_REMIND_MSG.getValue())){
|
||||
String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id
|
||||
userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
|
||||
msgContentEN = "Please check and deal with the design compliance confirmation process of "
|
||||
+ serialNumber + " in "+ projectNameInfoEO.getProjectName() + " (project name) in time.";
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryId);
|
||||
}
|
||||
return new Result<>().success("提醒办理成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建任务清单列表数据
|
||||
* @param projectTaskInventoryEOList
|
||||
@@ -305,4 +383,43 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作流发送消息
|
||||
* @param jsonObject
|
||||
*/
|
||||
public void workFlowSendMsg(JSONObject jsonObject){
|
||||
String msgType = jsonObject.getString("msgType"); //发送消息类型
|
||||
if(StringUtils.isEmpty(msgType)){
|
||||
throw new JeroBootException("发送消息类型不能为空,请检查!");
|
||||
}
|
||||
String id = jsonObject.getString("id"); //法规清单id
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
String serialNumber = jsonObject.getString("serialNumber"); //编号
|
||||
String projectLibraryId = jsonObject.getString("projectLibraryId"); //项目库id
|
||||
|
||||
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>()
|
||||
.lambda().eq(ProjectLibraryBase::getId, projectLibraryId));
|
||||
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
|
||||
|
||||
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
|
||||
String msgContentEN = "";
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id
|
||||
userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
|
||||
|
||||
if (StringUtils.equals(msgType, MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())) {
|
||||
msgContentEN = sysUser.getUsername() + "has distributed the design compliance confirmation process of " + serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
+ " (project name) to you. Please check and handle it in time.";
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgContentEN,userIdList,id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
package com.jero.modules.project.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.WebsocketConst;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysAnnouncementService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class SendMessageUtils {
|
||||
private final static Logger logger= LoggerFactory.getLogger(SendMessageUtils.class);
|
||||
|
||||
private static ISysUserService sysUserService;
|
||||
@Autowired
|
||||
public void setISysUserService(ISysUserService sysUserService){
|
||||
SendMessageUtils.sysUserService = sysUserService;
|
||||
}
|
||||
|
||||
private static ISysAnnouncementService sysAnnouncementService;
|
||||
@Autowired
|
||||
public void setISysAnnouncementService(ISysAnnouncementService sysAnnouncementService){
|
||||
SendMessageUtils.sysAnnouncementService = sysAnnouncementService;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private static IFeishuService iFeishuService;
|
||||
public void setIFeishuService(IFeishuService iFeishuService){
|
||||
SendMessageUtils.iFeishuService = iFeishuService;
|
||||
}
|
||||
|
||||
private static WebSocket webSocket;
|
||||
@Autowired
|
||||
public void setWebSocket(IFeishuService iFeishuService){
|
||||
SendMessageUtils.iFeishuService = iFeishuService;
|
||||
}
|
||||
|
||||
public static void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId) {
|
||||
String idTemp = projectLibraryId;
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//系统消息
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgContent, "");
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket(idTemp, idTemp);
|
||||
|
||||
//飞书消息
|
||||
try {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, MessageTypeEnum.PUSH.getName(), "");
|
||||
} catch (IOException e) {
|
||||
logger.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static SysAnnouncement getSysAnnouncement(List<String> userIdList, String content, String contentInfo) {
|
||||
SysAnnouncement sysAnnouncement = new SysAnnouncement();
|
||||
sysAnnouncement.setDelFlag("0");
|
||||
sysAnnouncement.setSendStatus("0");
|
||||
sysAnnouncement.setSendTime(new Date());
|
||||
sysAnnouncement.setMsgCategory(MessageTypeEnum.READ.getValue());//消息类型
|
||||
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
|
||||
sysAnnouncement.setMsgContent(content);
|
||||
sysAnnouncement.setMsgContentInfo(contentInfo);
|
||||
sysAnnouncement.setUserIds(StringUtils.join(userIdList, ","));
|
||||
return sysAnnouncement;
|
||||
}
|
||||
|
||||
private static void sendWebsocket(String msgId, String msgTet) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC);
|
||||
obj.put(WebsocketConst.MSG_ID, msgId);
|
||||
obj.put(WebsocketConst.MSG_TXT, msgTet);
|
||||
webSocket.sendMessage(obj.toJSONString());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -752,4 +752,7 @@ module.exports = {
|
||||
notEvaluated:'Not evaluated',
|
||||
cannotExceed:'cannot exceed',
|
||||
Characters:'Characters',
|
||||
standardInformation:'standardInformation',
|
||||
VirtualList:'VirtualList',
|
||||
importTemplate:'import template',
|
||||
}
|
||||
@@ -580,6 +580,7 @@ module.exports = {
|
||||
selectDisplayList: '请选择是否列表展示',
|
||||
documentSplitDisplay: '文档拆分模块展示',
|
||||
VirtualListName: '虚拟清单名称',
|
||||
VirtualList:'虚拟清单',
|
||||
listStatus: '清单状态',
|
||||
creater: '创建人',
|
||||
withdraw: '撤回',
|
||||
@@ -757,4 +758,6 @@ module.exports = {
|
||||
notEvaluated:'未评估',
|
||||
cannotExceed:'不能超出',
|
||||
Characters:'个字符',
|
||||
standardInformation:'标准信息',
|
||||
importTemplate:'导入模板',
|
||||
}
|
||||
@@ -138,7 +138,7 @@
|
||||
<a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
|
||||
</span>
|
||||
<span slot="titleName" slot-scope="text,record" :title="text">
|
||||
{{text && text.length > 20 ? text.slice(0,19)+'...':text}}
|
||||
{{text && text.length > 10 ? text.slice(0,9)+'...':text}}
|
||||
</span>
|
||||
<span slot="designDeliverableTemplateName" slot-scope="text,record">
|
||||
<span>{{record.designDeliverableType_dictText}}</span><br v-if="record.designDeliverableType_dictText">
|
||||
@@ -568,7 +568,7 @@
|
||||
},
|
||||
//模板下载
|
||||
handleModule() {
|
||||
downloadFile(this.url.exportTemplate, '模板下载.xls', {})
|
||||
downloadFile(this.url.exportTemplate, this.$t('VirtualList')+this.$t('importTemplate')+'.xls', {})
|
||||
},
|
||||
//导出
|
||||
handleExport() {
|
||||
@@ -579,7 +579,7 @@
|
||||
ids: selectedRowKeys.join(','),
|
||||
dummyInventoryBaseId: this.$route.query.id
|
||||
}
|
||||
downloadFile(this.url.exportData, this.$route.query.name + '虚拟清单.zip', query, this.Deselect)
|
||||
downloadFile(this.url.exportData, this.$route.query.name + this.$t('VirtualList')+'.zip', query, this.Deselect)
|
||||
},
|
||||
Deselect() {
|
||||
this.selectedRowKeys = []
|
||||
|
||||
@@ -43,14 +43,49 @@
|
||||
<div style="width: 100%">
|
||||
<a-table
|
||||
ref="table"
|
||||
bordered
|
||||
:loading="loading"
|
||||
:pagination="false"
|
||||
:scroll="{x: true}"
|
||||
rowKey="id"
|
||||
:data-source="dataSource"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:columns="columns"
|
||||
>
|
||||
<div slot="standardInformation" slot-scope="text,result" class="box-left">
|
||||
<a class="box-content">GB-7258-2017</a><br/>
|
||||
<a>及东盟火车大师傅但是</a>
|
||||
</div>
|
||||
<div slot="areaOfResponsibility" slot-scope="text,result" class="box-left">
|
||||
<span class="box-content">1212sdfdsf</span><br/>
|
||||
<span>责任领土</span>
|
||||
</div>
|
||||
<div slot="confirmationOfDesignConformity" slot-scope="text,result" class="box-left">
|
||||
<span class="box-content">截止时间: 2022-06-01</span><br/>
|
||||
<span class="box-content">流程状态: 待审核</span><br/>
|
||||
<span class="box-content-color">待追踪</span>
|
||||
<div class="content-box">
|
||||
<div class="content-box-jiao"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="PrehomoConfirmation" slot-scope="text,result" class="box-left">
|
||||
<span class="box-content">截止时间: 2022-06-01</span><br/>
|
||||
<span class="box-content">流程状态: 待审核</span><br/>
|
||||
<span class="box-content-color">待追踪</span>
|
||||
</div>
|
||||
<div slot="verificationAndConformityconfirmation" slot-scope="text,result" class="box-left">
|
||||
<span class="box-content">截止时间: 2022-06-01</span><br/>
|
||||
<span class="box-content">流程状态: 待审核</span><br/>
|
||||
<span class="box-content-color">待追踪</span>
|
||||
</div>
|
||||
<div slot="CertificationProgress" slot-scope="text,result">
|
||||
<span class="box-content-color">
|
||||
实验通过
|
||||
</span>
|
||||
</div>
|
||||
<div slot="CurrentProjectStatusEvaluation" slot-scope="text,result">
|
||||
<div class="Current-color">
|
||||
<div class="Current-color-box"></div>
|
||||
</div>
|
||||
</div>
|
||||
</a-table>
|
||||
</div>
|
||||
<certificationDirectory :url="url" ref="certificationDirectoryRef"/>
|
||||
@@ -59,9 +94,10 @@
|
||||
|
||||
<script>
|
||||
import certificationDirectory from './certificationDirectory'
|
||||
|
||||
export default {
|
||||
name: 'TaskList',
|
||||
components:{
|
||||
components: {
|
||||
certificationDirectory
|
||||
},
|
||||
data() {
|
||||
@@ -70,105 +106,52 @@
|
||||
{
|
||||
title: this.$t('serialNumber'),
|
||||
align: 'center',
|
||||
width: 100,
|
||||
fixed: 'left'
|
||||
width: 80,
|
||||
customRender: function(t, r, index) {
|
||||
return parseInt(index) + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('standard'),
|
||||
title: this.$t('standardInformation'),
|
||||
align: 'center',
|
||||
dataIndex: 'standard',
|
||||
fixed: 'left'
|
||||
scopedSlots: { customRender: 'standardInformation' }
|
||||
},
|
||||
{
|
||||
title: this.$t('areaOfResponsibility'),
|
||||
align: 'center',
|
||||
dataIndex: 'areaOfResponsibility',
|
||||
fixed: 'left'
|
||||
scopedSlots: { customRender: 'areaOfResponsibility' }
|
||||
},
|
||||
{
|
||||
title: this.$t('confirmationOfDesignConformity'),
|
||||
children: [
|
||||
{
|
||||
title: this.$t('TaskRequirements'),
|
||||
dataIndex: 'TaskRequirements',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('Sponsor'),
|
||||
dataIndex: 'Sponsor',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('TaskCutOffTime'),
|
||||
dataIndex: 'TaskCutOffTime',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('status'),
|
||||
dataIndex: 'status',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
align: 'center',
|
||||
dataIndex: 'confirmationOfDesignConformity',
|
||||
scopedSlots: { customRender: 'confirmationOfDesignConformity' }
|
||||
},
|
||||
{
|
||||
title: this.$t('PrehomoConfirmation'),
|
||||
children: [
|
||||
{
|
||||
title: this.$t('TaskRequirements'),
|
||||
dataIndex: 'TaskRequirements',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('Sponsor'),
|
||||
dataIndex: 'Sponsor',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('TaskCutOffTime'),
|
||||
dataIndex: 'TaskCutOffTime',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('status'),
|
||||
dataIndex: 'status',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
align: 'center',
|
||||
dataIndex: 'PrehomoConfirmation',
|
||||
scopedSlots: { customRender: 'PrehomoConfirmation' }
|
||||
},
|
||||
{
|
||||
title: this.$t('verificationAndConformityconfirmation'),
|
||||
children: [
|
||||
{
|
||||
title: this.$t('TaskRequirements'),
|
||||
dataIndex: 'TaskRequirements',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('Sponsor'),
|
||||
dataIndex: 'Sponsor',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('TaskCutOffTime'),
|
||||
dataIndex: 'TaskCutOffTime',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: this.$t('status'),
|
||||
dataIndex: 'status',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
align: 'center',
|
||||
dataIndex: 'verificationAndConformityconfirmation',
|
||||
scopedSlots: { customRender: 'verificationAndConformityconfirmation' }
|
||||
},
|
||||
{
|
||||
title: this.$t('CertificationProgress'),
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: 'CertificationProgress',
|
||||
scopedSlots: { customRender: 'CertificationProgress' }
|
||||
},
|
||||
{
|
||||
title: this.$t('CurrentProjectStatusEvaluation'),
|
||||
align: 'center',
|
||||
width: 150,
|
||||
dataIndex: 'CurrentProjectStatusEvaluation',
|
||||
scopedSlots: { customRender: 'CurrentProjectStatusEvaluation' }
|
||||
}
|
||||
@@ -177,7 +160,7 @@
|
||||
queryParam: {},
|
||||
url: {},
|
||||
loading: false,
|
||||
dataSource: []
|
||||
dataSource: [{}]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -196,7 +179,7 @@
|
||||
|
||||
},
|
||||
CertificationDirectory() {
|
||||
this.$refs.certificationDirectoryRef.addModel()
|
||||
this.$refs.certificationDirectoryRef.addModel()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,6 +237,61 @@
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.box-left {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.content-box {
|
||||
position: absolute;
|
||||
width: calc(100% + 32px);
|
||||
height: calc(100% + 32px);
|
||||
top: -16px;
|
||||
left: -16px;
|
||||
border: 1px seagreen solid;
|
||||
}
|
||||
|
||||
.content-box-jiao {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-right: 30px solid red;
|
||||
border-bottom: 30px solid transparent
|
||||
}
|
||||
|
||||
.box-content {
|
||||
margin-bottom: 8px;
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.box-content-color {
|
||||
padding: 6px 14px;
|
||||
box-sizing: border-box;
|
||||
background: #1ABBC4;
|
||||
color: #2F8DF3;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.Current-color {
|
||||
display: inline-block;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
border: 1px red solid;
|
||||
}
|
||||
|
||||
.Current-color-box {
|
||||
display: inline-block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background: red;
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.box-input .ant-select-selection {
|
||||
|
||||
@@ -603,7 +603,7 @@
|
||||
methods: {
|
||||
...mapGetters(['userInfo']),
|
||||
handleModule() {
|
||||
downloadFile(this.url.exportTemplate, '模板下载.xls', {})
|
||||
downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {})
|
||||
},
|
||||
handleExport() {
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
@@ -613,7 +613,7 @@
|
||||
...this.queryParamQuery,
|
||||
projectLibraryId: this.$route.query.id
|
||||
}
|
||||
downloadFile(this.url.exportData, this.$route.query.projectName + '法规清单.zip', query, this.Deselect)
|
||||
downloadFile(this.url.exportData, this.$route.query.projectName + this.$t('listOfRegulations') + '.zip', query, this.Deselect)
|
||||
},
|
||||
//复制
|
||||
copyClick() {
|
||||
|
||||
@@ -1,61 +1,350 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinLoading">
|
||||
<a-form-model
|
||||
class="tag-module"
|
||||
ref="ruleForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-model-item :label="$t('Module')" prop="isModel">
|
||||
<!-- <j-dict-select-tag type="list" v-model="form.isModel" dictCode="module" :placeholder="$t('PleaseSelectModule')" />-->
|
||||
</a-form-model-item>
|
||||
<a-form-model-item ref="showArea" :label="$t('DisplayArea')" prop="showArea">
|
||||
<!-- <a-input-->
|
||||
<!-- v-model="form.showArea"-->
|
||||
<!-- @blur="-->
|
||||
<!-- () => {-->
|
||||
<!-- $refs.showArea.onFieldBlur();-->
|
||||
<!-- }-->
|
||||
<!-- "-->
|
||||
<!-- />-->
|
||||
</a-form-model-item>
|
||||
<a-form-model-item ref="enName" :label="$t('enName')" prop="enName">
|
||||
<!-- <a-input
|
||||
v-model="form.enName"
|
||||
@blur="
|
||||
<div class="diolag-area">
|
||||
<div class="table-operator">
|
||||
<div class="operator-text">
|
||||
{{$t('parameterTemplate')}}
|
||||
</div>
|
||||
</div>
|
||||
<a-spin :spinning="spinLoading">
|
||||
<a-form-model
|
||||
class="tag-module"
|
||||
ref="ruleForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-model-item :label="$t('Module')" prop="isModel">
|
||||
<j-dict-select-tag type="list" v-model="form.isModel" dictCode="module" :placeholder="$t('PleaseSelectModule')" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item ref="showArea" :label="$t('DisplayArea')" prop="showArea">
|
||||
<a-input
|
||||
v-model="form.showArea"
|
||||
@blur="
|
||||
() => {
|
||||
$refs.showArea.onFieldBlur();
|
||||
}
|
||||
"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item ref="enName" :label="$t('enName')" prop="enName">
|
||||
<a-input
|
||||
v-model="form.enName"
|
||||
@blur="
|
||||
() => {
|
||||
$refs.enName.onFieldBlur();
|
||||
}
|
||||
"
|
||||
/>-->
|
||||
</a-form-model-item>
|
||||
<a-form-model-item ref="sort" :label="$t('SortNumber')" prop="sort">
|
||||
<!-- <a-input-number v-decorator="['input-number', { initialValue: 3 }]" :min="1" :max="100" />-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- style="width:100%"-->
|
||||
<!-- v-model="form.sort"-->
|
||||
<!-- :min="1"-->
|
||||
<!-- :formatter="limitNumber"-->
|
||||
<!-- :parser="limitNumber"-->
|
||||
<!-- @blur="-->
|
||||
<!-- () => {-->
|
||||
<!-- $refs.sort.onFieldBlur();-->
|
||||
<!-- }-->
|
||||
<!-- "-->
|
||||
<!-- />-->
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item ref="sort" :label="$t('SortNumber')" prop="sort">
|
||||
<a-input-number
|
||||
style="width:100%"
|
||||
v-model="form.sort"
|
||||
:min="1"
|
||||
:formatter="limitNumber"
|
||||
:parser="limitNumber"
|
||||
@blur="
|
||||
() => {
|
||||
$refs.sort.onFieldBlur();
|
||||
}
|
||||
"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
<a-table
|
||||
class="table-area"
|
||||
ref="table"
|
||||
size="middle"
|
||||
rowKey="id"
|
||||
:columns="columns"
|
||||
:dataSource="areaTable"
|
||||
:pagination="false"
|
||||
:loading="loading"
|
||||
:scroll="{x: 600}"
|
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
||||
@change="handleTableChange">
|
||||
<a slot="name" slot-scope="text">{{ text }}</a>
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a class="action-edit" @click="editArea(record.id)" v-has="'area:edit'" >{{$t('edit')}}</a>
|
||||
<a style="color:red" href="javascript:;" @click=" deleteArea(record.id)" v-has="'area:delete'">{{$t('delete')}}</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ParameterTemplate',
|
||||
data() {
|
||||
return {
|
||||
spinLoading: false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
import { putAction,postAction,getAction,deleteAction } from '@/api/manage'
|
||||
export default {
|
||||
name: 'diolagArea',
|
||||
components:{
|
||||
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
title:this.$t('add'),
|
||||
queryParams:{
|
||||
pageNo:1,
|
||||
pageSize:10
|
||||
},
|
||||
total:0,
|
||||
selectedRowKeys: [],
|
||||
loading: false,
|
||||
ipagination:true,
|
||||
editId:'',
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('zoneOfApplication'),
|
||||
dataIndex: 'showArea',
|
||||
key: 'showArea',
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: this.$t('parameterTemplate'),
|
||||
align: "center",
|
||||
dataIndex: 'enName',
|
||||
ellipsis: true,
|
||||
}
|
||||
],
|
||||
newVisible:false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 14 },
|
||||
},
|
||||
form: {
|
||||
isModel:'1',
|
||||
showArea:'',
|
||||
enName:'',
|
||||
sort:''
|
||||
},
|
||||
rules: {
|
||||
isModel:[
|
||||
{ required: true, message: this.$t('PleaseSelectModule'), trigger: 'change' },
|
||||
|
||||
],
|
||||
enName:[
|
||||
{ max: 100, message: this.$t('CannotExceed100characters'), trigger: 'blur' },
|
||||
|
||||
],
|
||||
showArea:[
|
||||
{ required: true, message: this.$t('enterDisplayArea'), trigger: 'blur' },
|
||||
{ min:1, max: 50, message: this.$t('charactersLength'), trigger: 'blur' },
|
||||
],
|
||||
sort:[
|
||||
{ required: true, message: this.$t('enterSortingNumber'), trigger: 'change' },
|
||||
]
|
||||
},
|
||||
areaTable:[],
|
||||
flag:false, //表单提交标识
|
||||
spinLoading:false,
|
||||
}
|
||||
},
|
||||
props:{
|
||||
// areaTable:Array
|
||||
},
|
||||
mounted() {
|
||||
this.loadData()
|
||||
},
|
||||
methods:{
|
||||
loadData(){
|
||||
this.loading=true
|
||||
let params={
|
||||
...this.queryParams
|
||||
}
|
||||
postAction(`tag/onlCgformArea/page`,params).then(res=>{
|
||||
if(res.success){
|
||||
this.areaTable=[...res.result.records]
|
||||
this.total=res.result.total
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.loading=false
|
||||
})
|
||||
},
|
||||
onSelectChange(selectedRowKeys) {
|
||||
// console.log('selectedRowKeys changed: ', selectedRowKeys);
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
},
|
||||
handleTableChange(){
|
||||
|
||||
},
|
||||
showModal() {
|
||||
this.title=this.$t('add')
|
||||
this.newVisible = true;
|
||||
this.form={
|
||||
|
||||
}
|
||||
},
|
||||
//新增
|
||||
hideModal() {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.flag=true
|
||||
this.spinLoading=true
|
||||
//编辑
|
||||
if(this.form.id){
|
||||
putAction(`tag/onlCgformArea/edit`,this.form).then((res)=>{
|
||||
if(res.success){
|
||||
this.$message.success(this.$t('OperationSuccessful'));
|
||||
this.loadData()
|
||||
this.form={
|
||||
isModel:'',
|
||||
showArea:'',
|
||||
enName:'',
|
||||
sort:''
|
||||
}
|
||||
}else{
|
||||
this.$message.warning(res.message)
|
||||
this.form={
|
||||
isModel:'',
|
||||
showArea:'',
|
||||
enName:'',
|
||||
sort:''
|
||||
}
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.flag=false
|
||||
this.spinLoading=false
|
||||
this.newVisible = false;
|
||||
this.form={
|
||||
isModel:'',
|
||||
showArea:'',
|
||||
enName:'',
|
||||
sort:''
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//新增
|
||||
postAction(`/tag/onlCgformArea/add`,this.form).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success( this.$t('OperationSuccessful'));
|
||||
this.loadData()
|
||||
this.form={
|
||||
isModel:'',
|
||||
showArea:'',
|
||||
enName:'',
|
||||
sort:''
|
||||
}
|
||||
}else{
|
||||
// this.$message.warning(this.$t('operationFailed'))
|
||||
this.$message.warning(res.message)
|
||||
|
||||
}
|
||||
}
|
||||
).finally(()=>{
|
||||
this.flag=false
|
||||
this.spinLoading=false
|
||||
this.newVisible = false;
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
// console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
cancelModel(){
|
||||
this.newVisible=false
|
||||
this.$refs.ruleForm.resetFields();
|
||||
},
|
||||
//删除按钮
|
||||
deleteArea(val){
|
||||
this.$confirm({
|
||||
title: this.$t('confirmDeletion'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
getAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'));
|
||||
if(this.areaTable.length==1&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
this.loadData()
|
||||
}else{
|
||||
// this.$message.warning(res.message)
|
||||
if(res.message=='该展示区域有关联数据,无法删除!'){
|
||||
this.$message.warning(this.$t('noDelete'))
|
||||
}else{
|
||||
this.$message.warning(this.$t('operationFailed'));
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑按钮
|
||||
editArea(val){
|
||||
this.title=this.$t('edit')
|
||||
this.newVisible = true;
|
||||
let params={
|
||||
id:val
|
||||
}
|
||||
getAction(`tag/onlCgformArea/queryById`, params).then((res) => {
|
||||
if(res.success){
|
||||
this.form={...res.result}
|
||||
// this.$emit('updateOk',res.result)
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
//点击页数
|
||||
onChangePage(page,pageSize){
|
||||
this.queryParams.pageNo = page
|
||||
this.loadData()
|
||||
},
|
||||
//一页显示条数
|
||||
SizeChange(page,pageSize){
|
||||
this.queryParams.pageSize = pageSize
|
||||
this.queryParams.pageNo=1
|
||||
this.loadData()
|
||||
},
|
||||
//正则替换小数点
|
||||
limitNumber(value) {
|
||||
if (typeof value === 'string') {
|
||||
return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
|
||||
} else if (typeof value === 'number') {
|
||||
return !isNaN(value) ? String(value).replace(/\./g, '') : 0
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
.diolag-area{
|
||||
.table-area{
|
||||
margin: 20px 0;
|
||||
.action-edit{
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.table-del{
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="less">
|
||||
.area-module{
|
||||
.ant-modal-wrap{
|
||||
.ant-modal{
|
||||
.ant-modal-content{
|
||||
.ant-modal-footer{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user