diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/xml/OnlCgformCollectionMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/xml/OnlCgformCollectionMapper.xml index 8bee10736..445bf7e94 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/xml/OnlCgformCollectionMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/xml/OnlCgformCollectionMapper.xml @@ -30,7 +30,10 @@ and bdl.title like concat(concat('%',#{params.title}),'%') - and bdl.state = #{params.state} + and bdl.state in + + #{item} + order by occ.create_time desc diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/service/impl/OnlCgformCollectionServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/service/impl/OnlCgformCollectionServiceImpl.java index ee96074c8..e213739b2 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/service/impl/OnlCgformCollectionServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/service/impl/OnlCgformCollectionServiceImpl.java @@ -14,6 +14,8 @@ import com.jero.modules.collection.entity.OnlCgformCollection; import com.jero.modules.collection.mapper.OnlCgformCollectionMapper; import com.jero.modules.collection.service.IOnlCgformCollectionService; import com.jero.modules.ocr.util.LineHumpUtil; +import com.jero.modules.subscribe.entity.OnlCgformSubscribe; +import com.jero.modules.subscribe.mapper.OnlCgformSubscribeMapper; import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import org.apache.commons.collections4.CollectionUtils; @@ -21,6 +23,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.*; @@ -40,6 +43,8 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl documentIdList = new ArrayList<>(); + documentIdList.add(onlCgformCollection.getDocumentId()); + + //删除订阅 + deleteSubscribe(documentIdList); + + removeById(id); + }catch (Exception ex){ + log.error("取消收藏失败:" + ex.getMessage()); + throw new JeroBootException("取消收藏失败!"); + } } /** @@ -77,6 +95,7 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl ids) { for (String id : ids) { boolean checkData = checkData(id); @@ -84,7 +103,20 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(OnlCgformCollection::getId,ids); + List onlCgformCollections = super.baseMapper.selectList(queryWrapper); + List documentIdList = onlCgformCollections.stream().map(OnlCgformCollection::getDocumentId).distinct().collect(Collectors.toList()); + + //删除订阅 + deleteSubscribe(documentIdList); + + removeByIds(ids); + }catch (Exception ex){ + log.error("批量取消收藏失败:" + ex.getMessage()); + throw new JeroBootException("批量取消收藏失败!"); + } } /** @@ -196,25 +228,31 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl> records = result.getRecords(); - dataDispose(records); + dataDispose(records,params); return result; } - public void dataDispose(List> datas){ + public void dataDispose(List> datas, Map params){ if(CollectionUtils.isNotEmpty(datas)){ List sysDictItems = sysDictItemServiceImpl.selectItemsAll(); //获取所有文本状态数据字典 List stateList = sysDictItems.stream() - .filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals("file_type")) + .filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals("state")) .collect(Collectors.toList()); SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); + + String cut = (String) params.get("cut"); for (Map data : datas) { Date createTime = (Date) data.get("createTime"); data.put("createTime",sdf.format(createTime)); String state = (String) data.get("state"); for (SysDictItem sysDictItem : stateList) { if(StringUtils.equals(state,sysDictItem.getItemValue())){ - data.put("state",sysDictItem.getItemText()); + if(StringUtils.equals(cut,"cn")){ + data.put("state",sysDictItem.getItemText()); + }else { + data.put("state",sysDictItem.getEnName()); + } break; } } @@ -246,4 +284,17 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl docIdList){ + try { + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + QueryWrapper deleteWarpper = new QueryWrapper<>(); + deleteWarpper.lambda().in(OnlCgformSubscribe::getDocumentId,docIdList); + deleteWarpper.lambda().eq(OnlCgformSubscribe::getCreateBy,sysUser.getUsername()); + onlCgformSubscribeMapper.delete(deleteWarpper); + }catch (Exception ex){ + log.error("删除订阅信息失败:" + ex.getMessage()); + throw new JeroBootException("删除订阅信息失败!"); + } + } } \ No newline at end of file diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/domain/controller/DomainUserRelController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/domain/controller/DomainUserRelController.java index f13f3a736..1cb5937fe 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/domain/controller/DomainUserRelController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/domain/controller/DomainUserRelController.java @@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Map; + /** * 领域与用户关系 @@ -41,4 +43,11 @@ public class DomainUserRelController { public Result queryList(){ return domainUserRelService.queryList(); } + + @AutoLog(value = "查询领域、文档关联的用户Id") + @ApiOperation(value="查询领域、文档关联的用户Id", notes="查询领域、文档关联的用户Id") + @PostMapping("/queryDomainUserRelInfo") + public Result queryDomainUserRelInfo(@RequestBody Map params){ + return Result.ok(domainUserRelService.queryDomainUserRelInfo(params)); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/mapper/xml/OnlCgformSubscribeMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/mapper/xml/OnlCgformSubscribeMapper.xml index bafb9b1bb..cd8d88f85 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/mapper/xml/OnlCgformSubscribeMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/mapper/xml/OnlCgformSubscribeMapper.xml @@ -31,7 +31,10 @@ and bdl.title like concat(concat('%',#{params.title}),'%') - and bdl.state = #{params.state} + and bdl.state in + + #{item} + order by ocs.create_time desc diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/service/impl/OnlCgformSubscribeServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/service/impl/OnlCgformSubscribeServiceImpl.java index cf0f1db43..58323e8bd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/service/impl/OnlCgformSubscribeServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/service/impl/OnlCgformSubscribeServiceImpl.java @@ -210,7 +210,7 @@ public class OnlCgformSubscribeServiceImpl extends ServiceImpl> records = result.getRecords(); - dataDispose(records); + dataDispose(records,params); return result; } @@ -241,21 +241,28 @@ public class OnlCgformSubscribeServiceImpl extends ServiceImpl> datas){ + public void dataDispose(List> datas,Map params){ if(CollectionUtils.isNotEmpty(datas)){ List sysDictItems = sysDictItemServiceImpl.selectItemsAll(); //获取所有文本状态数据字典 List stateList = sysDictItems.stream() - .filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals("file_type")) + .filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals("state")) .collect(Collectors.toList()); SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); + + //cut: cn 中文 en 英文 + String cut = (String) params.get("cut"); for (Map data : datas) { Date createTime = (Date) data.get("createTime"); data.put("createTime",sdf.format(createTime)); String state = (String) data.get("state"); for (SysDictItem sysDictItem : stateList) { if(StringUtils.equals(state,sysDictItem.getItemValue())){ - data.put("state",sysDictItem.getItemText()); + if(StringUtils.equals(cut,"cn")){ + data.put("state",sysDictItem.getItemText()); + }else { + data.put("state",sysDictItem.getEnName()); + } break; } }