diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java index 844252322..01933e2bc 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java @@ -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 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index 25f53f5c9..6d0d6e35f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -2363,7 +2363,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl userIdList, String content, String contentInfo) { + public SysAnnouncement getSysAnnouncement(List userIdList, String content, String contentInfo) { SysAnnouncement sysAnnouncement = new SysAnnouncement(); sysAnnouncement.setDelFlag("0"); sysAnnouncement.setSendStatus("0"); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/IDummyReadEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/IDummyReadEOService.java index 9937f66b0..0cfb5b9bc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/IDummyReadEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/IDummyReadEOService.java @@ -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 { * @param dummyReadEO * @return */ - void add(DummyReadEO dummyReadEO); + void add(DummyReadEO dummyReadEO); /** * 更新 @@ -26,7 +27,7 @@ public interface IDummyReadEOService extends IService { * @param dummyReadEO * @return */ - void editById(DummyReadEO dummyReadEO); + void editById(DummyReadEO dummyReadEO); /** * 通过id删除 @@ -34,7 +35,7 @@ public interface IDummyReadEOService extends IService { * @param id * @return */ - void deleteById(String id); + void deleteById(String id); /** * 批量删除 @@ -42,7 +43,7 @@ public interface IDummyReadEOService extends IService { * @param ids * @return */ - void deleteByIds(List ids); + void deleteByIds(List ids); /** * 通过id查询 @@ -50,12 +51,16 @@ public interface IDummyReadEOService extends IService { * @param id * @return */ - DummyReadEO queryById(String id); + DummyReadEO queryById(String id); - /** + /** * 列表查询 * * @return */ - List queryList(); + List queryList(); + + + /**查询订阅虚拟清单的用户*/ + List queryReadUserInfo(String dummyInventoryBaseId); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java index c2dce9736..c74e3b024 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java @@ -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发消息,删除dummy_content_change中上一次存入的数据,将本次数据存入 //没有变化-->不发消息,数据不处理 @@ -257,7 +277,6 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl infoDiff = null; + List> infoDiffList=null; + String addSerialNumber=null; + String deleteSerialNumber=null; + List addSerialNumberList =null; + List deleteSerialNumberList =null; + //对比,获取值不同的字段 + for(DummyContentChangeEO dummyContentChangeEO : dummyContentChangeEOInfoList) { String infoCJ = dummyContentChangeEO.getContentJson(); - List infoCJList = JSONArray.parseArray(infoCJ,DummyInventoryInfoEO.class);//json转list - //对比,获取值不同的字段 - Map 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 infoCJList = JSONArray.parseArray(infoCJ, DummyInventoryInfoEO.class);//json转list + //获取数据库和传入同时存在的编号 + List infoCJBaseSerialNumberList = infoCJList.stream().map(e -> e.getSerialNumber()).collect(Collectors.toList()); + List 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 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 baseDiff, String idTemp,Map infoDiff,String addSerialNumber,String deleteSerialNumber) { + + String baseName=queryById(idTemp).getName();//基础表id + List userNameList = dummyReadEOService.queryReadUserInfo(idTemp); + List userIdList=sysUserService.queryUserIdListByNameList(userNameList).stream().map(e->e.getId()).collect(Collectors.toList()); + //给发送消息的用户 + if(userIdList.size() == 0){ + return; + } + List sysUsers = sysUserService.listByIds(userIdList); + List 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 baseDiff,Map infoDiff,String addSerialNumber,String deleteSerialNumber) { + int row = 1; + //设置虚拟清单列表的修改消息 + if(MapUtils.isNotEmpty(baseDiff)) { + //虚拟清单名称 + if (StringUtils.isNotBlank(baseDiff.get("name"))) { + List 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 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 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 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 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 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 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 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 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 infoDiff, String field,int row){ + + if (StringUtils.isNotBlank(infoDiff.get(field))) { + List 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++; + } + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyReadEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyReadEOServiceImpl.java index 0a416f321..28f98395f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyReadEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyReadEOServiceImpl.java @@ -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 implements IDummyReadEOService { + @Autowired + private DummyReadEOMapper dummyReadEOMapper; + /** * 保存 @@ -24,12 +32,12 @@ public class DummyReadEOServiceImpl extends ServiceImpl ids) { - removeByIds(ids); - } + public void deleteByIds(List ids) { + removeByIds(ids); + } /** * 通过id查询 @@ -73,17 +81,35 @@ public class DummyReadEOServiceImpl extends ServiceImpl queryList() { - return list(); - } + public List queryList() { + return list(); + } + + /** + * 查询订阅虚拟清单的用户 + * + * @return + */ + @Override + public List queryReadUserInfo(String dummyInventoryBaseId) { + //获取订阅该虚拟清单的所有用户信息 + if(StringUtils.isNotEmpty(dummyInventoryBaseId)){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("create_by").eq("dummy_inventory_base_id",dummyInventoryBaseId); + List readUserList = list(queryWrapper).stream().map(e -> e.getCreateBy()).distinct().collect(Collectors.toList()); + return readUserList; + }else{ + throw new JeroBootException("The virtual inventory is not subscribed.");//该虚拟清单未被订阅 + } + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/util/ListDiff.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/util/ListDiff.java index 65f855bea..2986bef8f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/util/ListDiff.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/util/ListDiff.java @@ -19,8 +19,8 @@ public class ListDiff { 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 { result.put(f.getName(), v1String.append(",").append(v2String).toString()); - System.out.println("zlzl"); + } } return result; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskInventoryEOController.java index 875529992..1cc62f664 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectTaskInventoryEOController.java @@ -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 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); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/MsgTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/MsgTypeEnum.java index 7684c1f02..83b5b50d5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/MsgTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/MsgTypeEnum.java @@ -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; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java index 7fb37f152..db22b91d7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java @@ -18,6 +18,7 @@ public enum OperatorTypeEnum { TASK_AFFIRM_QUERY("任务确认流程,查询法规清单信息","taskAffirmQuery"), + ADD_TASK_INVENTORY_DETAIL("添加法规清单明细信息","addTaskInventoryDetail"), ; String name; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java index c3a989e5c..cae7a657c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java @@ -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()); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java index 2cc6fbef1..b13e63b72 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java @@ -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 queryList(ProjectTaskInventoryEO projectTaskInventoryEO, HttpServletRequest req); + + /** + * 项目库-任务清单表-流程调用 + * @param jsonObject + * @return + */ + Result processCall(JSONObject jsonObject); + + /** + * 项目库-任务清单表-提醒办理 + * @param jsonObject + * @return + */ + Result remindDispose(JSONObject jsonObject); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java index c0abe9436..0af3ffb81 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java @@ -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 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 userIdList = new ArrayList<>(); + + ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper() + .lambda().eq(ProjectLibraryBase::getId, projectLibraryId)); + + QueryWrapper 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() + .lambda().eq(ProjectLibraryBase::getId, projectLibraryId)); + + QueryWrapper projectNameInfoEOQueryWrapper = new QueryWrapper<>(); + projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId()); + ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper); + + SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper().lambda().eq(SysUser::getId, currentUserId)); + + String msgContentEN = ""; + List 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); + } + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/util/SendMessageUtils.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/util/SendMessageUtils.java new file mode 100644 index 000000000..22e78ee15 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/util/SendMessageUtils.java @@ -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 userIdList, String projectLibraryId) { + String idTemp = projectLibraryId; + + List sysUsers = sysUserService.listByIds(userIdList); + List 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 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()); + } + +} diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 167f675b5..b9dba09d0 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -752,4 +752,7 @@ module.exports = { notEvaluated:'Not evaluated', cannotExceed:'cannot exceed', Characters:'Characters', + standardInformation:'standardInformation', + VirtualList:'VirtualList', + importTemplate:'import template', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index dda63194b..0f3b73146 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -580,6 +580,7 @@ module.exports = { selectDisplayList: '请选择是否列表展示', documentSplitDisplay: '文档拆分模块展示', VirtualListName: '虚拟清单名称', + VirtualList:'虚拟清单', listStatus: '清单状态', creater: '创建人', withdraw: '撤回', @@ -757,4 +758,6 @@ module.exports = { notEvaluated:'未评估', cannotExceed:'不能超出', Characters:'个字符', + standardInformation:'标准信息', + importTemplate:'导入模板', } \ No newline at end of file diff --git a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue index e703343cd..78812a1f0 100644 --- a/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue +++ b/jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue @@ -138,7 +138,7 @@ {{$t('deleteLib')}} - {{text && text.length > 20 ? text.slice(0,19)+'...':text}} + {{text && text.length > 10 ? text.slice(0,9)+'...':text}} {{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 = [] diff --git a/jero-web/src/views/projectManagement/components/TaskList.vue b/jero-web/src/views/projectManagement/components/TaskList.vue index 6fe7f565c..02e2c0a3a 100644 --- a/jero-web/src/views/projectManagement/components/TaskList.vue +++ b/jero-web/src/views/projectManagement/components/TaskList.vue @@ -43,14 +43,49 @@
+ +
+ 1212sdfdsf
+ 责任领土 +
+
+ 截止时间: 2022-06-01
+ 流程状态: 待审核
+ 待追踪 +
+
+
+
+
+ 截止时间: 2022-06-01
+ 流程状态: 待审核
+ 待追踪 +
+
+ 截止时间: 2022-06-01
+ 流程状态: 待审核
+ 待追踪 +
+
+ + 实验通过 + +
+
+
+
+
+
@@ -59,9 +94,10 @@ \ No newline at end of file +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 + } + } + } +} + + + + \ No newline at end of file