| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.TravelCount; |
| | | import com.ruoyi.service.TravelCountDownlService; |
| | | import com.ruoyi.service.TravelCountService; |
| | | import com.ruoyi.service.TravelCountSharService; |
| | | import com.ruoyi.service.TravelDetailSharService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | |
| | | @Autowired |
| | | private TravelCountService travelCountService; |
| | | |
| | | @Autowired |
| | | private TravelCountDownlService travelCountDownlService; |
| | | |
| | | @Autowired |
| | | private TravelCountSharService travelCountSharService; |
| | | |
| | | @GetMapping("/all") |
| | | public AjaxResult listAll(TravelCount travelCount, String happenStartTime, String happenEndTime) throws ParseException { |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | if (! (travelCountDownlService.deleteData(ids) && travelCountSharService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | travelCountService.removeData(Arrays.asList(ids)); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.TravelDetail; |
| | | import com.ruoyi.service.TravelCountSharService; |
| | | import com.ruoyi.service.TravelDetailDownlService; |
| | | import com.ruoyi.service.TravelDetailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | TravelDetailService travelDetailService; |
| | | |
| | | @Autowired |
| | | TravelDetailDownlService travelDetailDownlService; |
| | | |
| | | @Autowired |
| | | TravelCountSharService travelCountSharService; |
| | | |
| | | @GetMapping("/{cid}") |
| | | public AjaxResult getDataByCid(@PathVariable("cid") Long cid,TravelDetail travelDetail){ |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | if (! (travelDetailDownlService.deleteData(ids) && travelCountSharService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | travelDetailService.removeByIds(Arrays.asList(ids)); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZHonor; |
| | | import com.ruoyi.service.ZHonorDownloadService; |
| | | import com.ruoyi.service.ZHonorService; |
| | | import com.ruoyi.service.ZHonorShareService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public class ZHonorController extends BaseController { |
| | | @Autowired |
| | | private ZHonorService zHonorService; |
| | | |
| | | @Autowired |
| | | private ZHonorDownloadService zHonorDownloadService; |
| | | |
| | | @Autowired |
| | | private ZHonorShareService zHonorShareService; |
| | | |
| | | /** |
| | | * 查询所有记录 |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | if (! (zHonorDownloadService.deleteData(ids) && zHonorShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | return toAjax(zHonorService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZIdea; |
| | | import com.ruoyi.service.ZIdeaDownloadService; |
| | | import com.ruoyi.service.ZIdeaService; |
| | | import com.ruoyi.service.ZIdeaShareService; |
| | | import com.ruoyi.service.ZPropertyDownloadService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private ZIdeaService zIdeaService; |
| | | |
| | | @Autowired |
| | | private ZIdeaDownloadService zIdeaDownloadService; |
| | | |
| | | @Autowired |
| | | private ZIdeaShareService zIdeaShareService; |
| | | |
| | | |
| | | /** |
| | | * 查询所有记录 |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | |
| | | if (! (zIdeaDownloadService.deleteData(ids) && zIdeaShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | return toAjax(zIdeaService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZProperty; |
| | | import com.ruoyi.domain.ZfEconomy; |
| | | import com.ruoyi.service.ZPropertyDownloadService; |
| | | import com.ruoyi.service.ZPropertyService; |
| | | import com.ruoyi.service.ZPropertyShareService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public class ZPropertyController extends BaseController { |
| | | @Autowired |
| | | private ZPropertyService zPropertyService; |
| | | |
| | | @Autowired |
| | | private ZPropertyDownloadService zPropertyDownloadService; |
| | | |
| | | @Autowired |
| | | private ZPropertyShareService zPropertyShareService; |
| | | |
| | | /** |
| | | * 查询所有记录 |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | if (! (zPropertyDownloadService.deleteData(ids) && zPropertyShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | return toAjax(zPropertyService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZSecret; |
| | | import com.ruoyi.service.ZSecretDownloadService; |
| | | import com.ruoyi.service.ZSecretService; |
| | | import com.ruoyi.service.ZSecretShareService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public class ZSecretController extends BaseController { |
| | | @Autowired |
| | | private ZSecretService zSecretService; |
| | | |
| | | @Autowired |
| | | private ZSecretShareService zSecretShareService; |
| | | |
| | | @Autowired |
| | | private ZSecretDownloadService zSecretDownloadService; |
| | | |
| | | /** |
| | | * 查询所有记录 |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | if (! (zSecretDownloadService.deleteData(ids) && zSecretShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | return toAjax(zSecretService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.ZSelfNote; |
| | | import com.ruoyi.service.ZSelfNoteDownloadService; |
| | | import com.ruoyi.service.ZSelfNoteService; |
| | | import com.ruoyi.service.ZSelfNoteShareService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.websocket.server.PathParam; |
| | | import java.util.Arrays; |
| | |
| | | public class ZSelfNoteController extends BaseController { |
| | | @Autowired |
| | | private ZSelfNoteService zSelfNoteService; |
| | | |
| | | @Autowired |
| | | private ZSelfNoteShareService zSelfNoteShareService; |
| | | |
| | | @Autowired |
| | | private ZSelfNoteDownloadService zSelfNoteDownloadService; |
| | | |
| | | |
| | | /** |
| | | * 查询所有记录 |
| | |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | if (! (zSelfNoteDownloadService.deleteData(ids) && zSelfNoteShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | return toAjax(zSelfNoteService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | |
| | | @PostMapping("/share") |
| | | public AjaxResult share(@RequestBody ShareMore zfDoctor){ |
| | | zfDoctor.setSysMenuId(2062L); |
| | | zfDoctor.setSysMenuId(2010L); |
| | | return zSelfNoteShareService.saveZa(zfDoctor); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/getInfoByUserId") |
| | | public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){ |
| | | zfDoctor.setSysMenuId(2062L); |
| | | zfDoctor.setSysMenuId(2010L); |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zSelfNoteShareService.listByFidAid(zfDoctor,pageNo,pageSize) ; |
| | |
| | | */ |
| | | @PostMapping("/deleteInfoByUserId") |
| | | public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){ |
| | | zfDoctor.setSysMenuId(2062L); |
| | | zfDoctor.setSysMenuId(2010L); |
| | | return zSelfNoteShareService.deleteZa(zfDoctor); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/downloadDate") |
| | | public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){ |
| | | zfDownload.setSysMenuId(2062L); |
| | | zfDownload.setSysMenuId(2010L); |
| | | return zSelfNoteDownloadService.addData(zfDownload); |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping("/all") |
| | | public AjaxResult data(ZfDownload zfDownload){ |
| | | zfDownload.setSysMenuId(2062L); |
| | | zfDownload.setSysMenuId(2010L); |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zSelfNoteDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize); |
| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.text.Convert; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.domain.ShareMore; |
| | | import com.ruoyi.domain.ZfDownload; |
| | |
| | | public interface IZfPropertyDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | } |
| | |
| | | AjaxResult listUserId(Integer pageNo ,Integer pageSize); |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface TravelCountDownlService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | |
| | | } |
| | |
| | | public interface TravelDetailDownlService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | |
| | | } |
| | |
| | | public interface ZHonorDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | } |
| | |
| | | AjaxResult listUserId(Integer pageNo ,Integer pageSize); |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | } |
| | |
| | | public interface ZIdeaDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | } |
| | |
| | | |
| | | |
| | | AjaxResult selectShareUserInfo(Integer user_id, Long menuId); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | } |
| | |
| | | public interface ZPropertyDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | } |
| | |
| | | AjaxResult listUserId(Integer pageNo ,Integer pageSize); |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface ZSecretDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | } |
| | |
| | | AjaxResult listUserId(Integer pageNo ,Integer pageSize); |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | } |
| | |
| | | public interface ZSelfNoteDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | } |
| | |
| | | AjaxResult listUserId(Integer pageNo ,Integer pageSize); |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface ZfCleanDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface ZfCollectionDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface ZfContactDownlService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface ZfDoctorDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface ZfEconomyDownlService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | } |
| | |
| | | public interface ZfEquipDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | } |
| | |
| | | public interface ZfEventDownloadService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | } |
| | |
| | | AjaxResult listUserId(Integer pageNo ,Integer pageSize); |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | } |
| | |
| | | public interface ZfPetDownlService extends IService<ZfDownload> { |
| | | AjaxResult addData(ZfDownload zfDownload); |
| | | |
| | | AjaxResult deleteData(Long[] ids); |
| | | Boolean deleteData(Long[] ids); |
| | | |
| | | AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize); |
| | | |
| | |
| | | |
| | | Long getShareId(ZfDownload zfDownload); |
| | | |
| | | Boolean deleteByContentId(Long[] ids); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (iZfPropertyShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2002L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println("111111111111111111111111111111111111111111111111111111"+zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭资产管理删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | private IZfPropertyDownloadService zfPropertyDownloadService; |
| | | |
| | | @Resource |
| | | private IZfPropertyShareService iZfPropertyShareService; |
| | | |
| | | |
| | | // private LambdaQueryWrapper<ZfProperty> buildCondition(ZfProperty zfProperty) { |
| | | // LambdaQueryWrapper<ZfProperty> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | |
| | | List<ZfProperty> zfPropertys = listByIds(Arrays.asList(ids)); |
| | | |
| | | if (! (zfPropertyDownloadService.deleteData(ids) && iZfPropertyShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | if (zfPropertyService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | | //删除es中的数据 |
| | |
| | | throw new RuntimeException(e); |
| | | }} |
| | | }); |
| | | System.out.println("15165132165346153246153"); |
| | | |
| | | return AjaxResult.success(); |
| | | }else { |
| | | return AjaxResult.error(); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | System.out.println("5555555555555555555555555555555555555555555555555555555555555555"); |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2002L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare: zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭资产管理分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (travelCountService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2056L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游统计表下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | TravelDetailService travelDetailService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2056L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游统计表分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (travelDetailService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2055L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游费用表下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.domain.TravelCount; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.TravelDetail; |
| | | import com.ruoyi.domain.ZfCollection; |
| | | import com.ruoyi.mapper.TravelDetailMapper; |
| | | import com.ruoyi.service.TravelDetailDownlService; |
| | | import com.ruoyi.service.TravelDetailService; |
| | | import com.ruoyi.service.TravelDetailSharService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class TravelDetailServiceImpl extends ServiceImpl<TravelDetailMapper, TravelDetail> implements TravelDetailService { |
| | | @Resource |
| | | private TravelDetailDownlService travelDetailDownlService; |
| | | |
| | | @Resource |
| | | private TravelDetailSharService travelDetailSharService; |
| | | |
| | | @Override |
| | | public List<TravelDetail> getDataByCid(Long cid,TravelDetail travelDetail) { |
| | |
| | | |
| | | @Override |
| | | public void removeBatchByCid(List<Long> cid) { |
| | | List<TravelDetail> lqw1 = new ArrayList<>(); |
| | | |
| | | |
| | | for (Long c : cid) { |
| | | LambdaQueryWrapper<TravelDetail> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(TravelDetail::getCid,c); |
| | | lqw1.addAll(list(lqw)); |
| | | remove(lqw); |
| | | } |
| | | if (lqw1.size() == 0) return; |
| | | Long[] id = new Long[lqw1.size()]; |
| | | for (int i = 0; i < lqw1.size(); i++) { |
| | | id[i] = lqw1.get(i).getId(); |
| | | } |
| | | travelDetailDownlService.deleteData(id) ; |
| | | travelDetailSharService.deleteByContentId(id) ; |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | TravelCountSharService travelCountSharService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2055L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "旅游费用表分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zHonorShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2030L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "证书荣耀资质下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "证书荣耀资质下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | HashMap<Long,List<ZHonor>> bs = new HashMap<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2053L); |
| | | lqw.eq(ZfShare::getSysMenuId,2030L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | List<ZHonor> b1 = new ArrayList<>(); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | |
| | | List<ZHonor> bs = new ArrayList<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2053L); |
| | | lqw.eq(ZfShare::getSysMenuId,2030L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | ZHonor bs2 = zHonorService.getById(beanRecord.getShareContent()); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2030L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | |
| | | if (zIdeaShareService.removeByIds(Arrays.asList(ids))) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2027L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import com.ruoyi.service.ZIdeaShareService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZIdeaService; |
| | | import com.ruoyi.service.ZIdeaShareService; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private ZfShareMapper zfShareMapper; |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | return AjaxResult.success(zInfoUsers); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2027L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zPropertyShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2026L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id) ){ |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.ZPropertyService; |
| | | import com.ruoyi.service.ZPropertyShareService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.*; |
| | | import com.ruoyi.service.ZPropertyShareService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Service |
| | | public class ZPropertyShareServiceImpl extends ServiceImpl<ZfShareMapper,ZfShare> implements ZPropertyShareService { |
| | | |
| | | |
| | | |
| | | @Resource |
| | | ZPropertyService zPropertyService; |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | Long userId = user.getUserId(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,userId); |
| | | lqw.eq(ZfShare::getShareId, userId); |
| | | |
| | | return list(lqw); |
| | | } |
| | | |
| | | public Long getUserId(){ |
| | | public Long getUserId() { |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | return myself.getUserId(); |
| | | |
| | | } |
| | | |
| | | public void addData(ZfShare za) |
| | | { |
| | | public void addData(ZfShare za) { |
| | | LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za); |
| | | List<ZfShare> list = list(lqw); |
| | | |
| | | if(list.size()>0){ |
| | | if (list.size() > 0) { |
| | | throw new RuntimeException("请勿分享重复数据"); |
| | | } |
| | | else { |
| | | } else { |
| | | save(za); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public AjaxResult saveZa(ShareMore shareMore) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long [] shareContents = shareMore.getShareContents(); |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | Long[] shareContents = shareMore.getShareContents(); |
| | | for (Long shareId : shareIds) { |
| | | for (Long shareContent : shareContents) { |
| | | ZfShare za = new ZfShare(); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | List<ZProperty> beanRecord3 = new ArrayList<>(); |
| | | for (Long shareId : shareIds) { |
| | | { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,shareId) |
| | | .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId()) |
| | | lqw.eq(ZfShare::getShareId, shareId) |
| | | .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId()) |
| | | .eq(ZfShare::getUserId, getUserId()); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | beanRecord3.add(zPropertyService.getById(beanRecord.getShareContent())); |
| | | } |
| | | } |
| | | } |
| | | List<ZProperty> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | List<ZProperty> record = beanRecord3.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (beanRecord3.size() -1) / pageSize +1; |
| | | int totalPage = (beanRecord3.size() - 1) / pageSize + 1; |
| | | |
| | | Page<ZProperty> zPropertyPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zPropertyPage, record,beanRecord3.size()); |
| | | Page<ZProperty> zPropertyPage = new Page<>(pageNo, pageSize, totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zPropertyPage, record, beanRecord3.size()); |
| | | |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteZa(ShareMore shareMore) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long [] shareContents = shareMore.getShareContents(); |
| | | for(Long shareId : shareIds) |
| | | for(Long shareContent: shareContents) |
| | | { |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | Long[] shareContents = shareMore.getShareContents(); |
| | | for (Long shareId : shareIds) |
| | | for (Long shareContent : shareContents) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,shareId) |
| | | lqw.eq(ZfShare::getShareId, shareId) |
| | | .eq(ZfShare::getShareContent, shareContent) |
| | | .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId()) |
| | | .eq(ZfShare::getUserId, getUserId()); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listByUserId() { |
| | | HashMap<Long,List<ZProperty>> bs = new HashMap<>(); |
| | | HashMap<Long, List<ZProperty>> bs = new HashMap<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2026L); |
| | | lqw.eq(ZfShare::getShareId, getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId, 2026L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | List<ZProperty> b1 = new ArrayList<>(); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | b1.add(zPropertyService.getById(beanRecord.getShareContent())); |
| | | bs.put(beanRecord.getUserId(),b1); |
| | | bs.put(beanRecord.getUserId(), b1); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | return AjaxResult.success(bs); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listUserId(Integer pageNo, Integer pageSize) { |
| | | List<ZProperty> bs = new ArrayList<>(); |
| | | List<ZProperty> bs = new ArrayList<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2026L); |
| | | lqw.eq(ZfShare::getShareId, getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId, 2026L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | ZProperty bs2 = zPropertyService.getById(beanRecord.getShareContent()); |
| | | bs2.setShareId(beanRecord.getUserId().intValue()); |
| | | bs.add(bs2); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | List<ZProperty> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | List<ZProperty> record = bs.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (bs.size() -1) / pageSize +1; |
| | | int totalPage = (bs.size() - 1) / pageSize + 1; |
| | | |
| | | Page<ZProperty> zPropertyPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zPropertyPage, record,bs.size()); |
| | | Page<ZProperty> zPropertyPage = new Page<>(pageNo, pageSize, totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zPropertyPage, record, bs.size()); |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | |
| | | .eq(ZfShare::getShareContent, zfDownload.getDownloadContent()) |
| | | .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId()); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | if (beanRecords.size() != 0){ |
| | | if (beanRecords.size() != 0) { |
| | | return beanRecords.get(0).getUserId(); |
| | | } |
| | | else { |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2026L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人财产分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zSecretShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2031L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "隐私下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "隐私下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.EsService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZSecretService; |
| | | import com.ruoyi.service.ZSecretShareService; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId()); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2031L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "隐私分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zSelfNoteShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2010L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人记事本下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人记事本下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.ZSelfNoteService; |
| | | import com.ruoyi.service.*; |
| | | import com.ruoyi.service.ZSelfNoteShareService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZSelfNoteShareService; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2010L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "个人记事本分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zfCleanShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2020L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "保洁收纳下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "保洁收纳下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | ZfCleanShareService zfCleanShareService; |
| | | |
| | | @Resource |
| | | ZfCleanDownloadService zfCleanDownloadService; |
| | | |
| | | private LambdaQueryWrapper<ZfClean> buildCondition(ZfClean zfClean,List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfClean> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.orderByDesc(ZfClean::getCreateTime); |
| | |
| | | } |
| | | |
| | | List<ZfClean> zfCleans = listByIds(Arrays.asList(ids)); |
| | | |
| | | if (! (zfCleanDownloadService.deleteData(ids) && zfCleanShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | if (zfCleanService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | | //删除es中的数据 |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2020L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare: zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "保洁收纳分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | |
| | | if (zfCollectionShareService.removeByIds(Arrays.asList(ids))) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2018L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "收藏与荣耀"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "收藏与荣耀下载的删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | ZfCollectionShareService zfCollectionShareService; |
| | | |
| | | @Resource |
| | | ZfCollectionDownloadService zfCollectionDownloadService; |
| | | |
| | | private LambdaQueryWrapper<ZfCollection> buildCondition(ZfCollection zfCollection,List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfCollection> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.orderByDesc(ZfCollection::getCreateTime); |
| | |
| | | } |
| | | |
| | | List<ZfCollection> zfCollections = listByIds(Arrays.asList(ids)); |
| | | |
| | | if (! ( zfCollectionDownloadService.deleteData(ids) && zfCollectionShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | if (zfCollectionService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | | //删除es中的数据 |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2018L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare: zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "收藏和荣誉分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zfContactShraService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2021L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | ZfContactShraServiceImpl zfContactShraService; |
| | | |
| | | @Resource |
| | | ZfContactDownlService zfContactDownlService; |
| | | |
| | | |
| | | private LambdaQueryWrapper<ZfContact> buildCondition(ZfContact zfContact,List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfContact> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | |
| | | List<ZfContact> zfContacts = listByIds(Arrays.asList(ids)); |
| | | |
| | | if (! (zfContactDownlService.deleteData(ids) && zfContactShraService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | if (zfContactService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | | //删除es中的数据 |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfCollectionService; |
| | | import com.ruoyi.service.ZfContactService; |
| | | import com.ruoyi.service.ZfContactShraService; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | Long userId = user.getUserId(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,userId); |
| | | lqw.eq(ZfShare::getShareId, userId); |
| | | |
| | | return list(lqw); |
| | | } |
| | | |
| | | public Long getUserId(){ |
| | | public Long getUserId() { |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | return myself.getUserId(); |
| | | |
| | | } |
| | | |
| | | public void addData(ZfShare za) |
| | | { |
| | | public void addData(ZfShare za) { |
| | | LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za); |
| | | List<ZfShare> list = list(lqw); |
| | | |
| | | if(list.size()>0){ |
| | | if (list.size() > 0) { |
| | | throw new RuntimeException("请勿分享重复数据"); |
| | | } |
| | | else { |
| | | } else { |
| | | save(za); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public AjaxResult saveZa(ShareMore shareMore) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long [] shareContents = shareMore.getShareContents(); |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | Long[] shareContents = shareMore.getShareContents(); |
| | | for (Long shareId : shareIds) { |
| | | for (Long shareContent : shareContents) { |
| | | ZfShare za = new ZfShare(); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | List<ZfContact> beanRecord3 = new ArrayList<>(); |
| | | for (Long shareId : shareIds) { |
| | | { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,shareId) |
| | | .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId()) |
| | | lqw.eq(ZfShare::getShareId, shareId) |
| | | .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId()) |
| | | .eq(ZfShare::getUserId, getUserId()); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | beanRecord3.add(zfContactService.getById(beanRecord.getShareContent())); |
| | | } |
| | | } |
| | | } |
| | | List<ZfContact> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | List<ZfContact> record = beanRecord3.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (beanRecord3.size() -1) / pageSize +1; |
| | | int totalPage = (beanRecord3.size() - 1) / pageSize + 1; |
| | | |
| | | Page<ZfContact> zfContactPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfContactPage, record,beanRecord3.size()); |
| | | Page<ZfContact> zfContactPage = new Page<>(pageNo, pageSize, totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfContactPage, record, beanRecord3.size()); |
| | | |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteZa(ShareMore shareMore) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long [] shareContents = shareMore.getShareContents(); |
| | | for(Long shareId : shareIds) |
| | | for(Long shareContent: shareContents) |
| | | { |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | Long[] shareContents = shareMore.getShareContents(); |
| | | for (Long shareId : shareIds) |
| | | for (Long shareContent : shareContents) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,shareId) |
| | | lqw.eq(ZfShare::getShareId, shareId) |
| | | .eq(ZfShare::getShareContent, shareContent) |
| | | .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId()) |
| | | .eq(ZfShare::getUserId, getUserId()); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listByUserId() { |
| | | HashMap<Long,List<ZfContact>> bs = new HashMap<>(); |
| | | HashMap<Long, List<ZfContact>> bs = new HashMap<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2021L); |
| | | lqw.eq(ZfShare::getShareId, getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId, 2021L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | List<ZfContact> b1 = new ArrayList<>(); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | b1.add(zfContactService.getById(beanRecord.getShareContent())); |
| | | bs.put(beanRecord.getUserId(),b1); |
| | | bs.put(beanRecord.getUserId(), b1); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | return AjaxResult.success(bs); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listUserId(Integer pageNo, Integer pageSize) { |
| | | List<ZfContact> bs = new ArrayList<>(); |
| | | List<ZfContact> bs = new ArrayList<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2021L); |
| | | lqw.eq(ZfShare::getShareId, getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId, 2021L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | ZfContact bs2 = zfContactService.getById(beanRecord.getShareContent()); |
| | | bs2.setShareId(beanRecord.getUserId().intValue()); |
| | | bs.add(bs2); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | List<ZfContact> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | List<ZfContact> record = bs.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (bs.size() -1) / pageSize +1; |
| | | int totalPage = (bs.size() - 1) / pageSize + 1; |
| | | |
| | | Page<ZfContact> zfCollectionPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfCollectionPage, record,bs.size()); |
| | | Page<ZfContact> zfCollectionPage = new Page<>(pageNo, pageSize, totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfCollectionPage, record, bs.size()); |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | |
| | | .eq(ZfShare::getShareContent, zfDownload.getDownloadContent()) |
| | | .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId()); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | if (beanRecords.size() != 0){ |
| | | if (beanRecords.size() != 0) { |
| | | return beanRecords.get(0).getUserId(); |
| | | } |
| | | else { |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2021L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zfDoctorShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2019L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | ZfDoctorShareService zfDoctorShareService; |
| | | |
| | | @Resource |
| | | ZfDoctorDownloadService zfDoctorDownloadService; |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult selectDoctorList(ZfDoctor zfDoctor, Integer pageNum, Integer pageSize) { |
| | |
| | | } |
| | | } |
| | | List<ZfDoctor> zfDoctors = listByIds(Arrays.asList(ids)); |
| | | |
| | | if (! (zfDoctorDownloadService.deleteData(ids) && zfDoctorShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | if (zfDoctorService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | | //删除es中的数据 |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.EsService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfDoctorService; |
| | | import com.ruoyi.service.ZfDoctorShareService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2019L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare: zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "小医生分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zfEconomyShaService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2023L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭收支台账下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭收支台账下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | @Resource |
| | | RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | ZfEconomyShaService zfEconomyShaService; |
| | | |
| | | @Resource |
| | | ZfEconomyDownlService zfEconomyDownlService; |
| | | |
| | | private LambdaQueryWrapper<ZfEconomy> buildCondition(ZfEconomy zfEconomy,List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfEconomy> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.orderByDesc(ZfEconomy::getCreateTime); |
| | |
| | | } |
| | | } |
| | | List<ZfEconomy> zfEconomys = listByIds(Arrays.asList(ids)); |
| | | |
| | | if (! (zfEconomyDownlService.deleteData(ids) && zfEconomyShaService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | if (zfEconomyService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | | //删除es中的数据 |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2023L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭台账收支分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zfEquipShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2017L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | System.out.println("15102120202121212122222222221"); |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | System.out.println("4535468486525852"); |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭设备下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭设备下载删除" ); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfEconomyService; |
| | | import com.ruoyi.service.ZfEquipShareService; |
| | | import com.ruoyi.service.ZfEquipmentService; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2017L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare: zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家大事记分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | private ZfEquipShareService zfEquipShareService; |
| | | |
| | | @Resource |
| | | private ZfEquipDownloadService zfEquipDownloadService; |
| | | |
| | | private LambdaQueryWrapper<ZfEquipment> buildCondition(ZfEquipment zfEquipment,List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfEquipment> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.orderByDesc(ZfEquipment::getCreateTime); |
| | |
| | | } |
| | | |
| | | List<ZfEquipment> zfEquipments = listByIds(Arrays.asList(ids)); |
| | | if (! (zfEquipDownloadService.deleteData(ids) && zfEquipShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | if (zfEquipmentService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return AjaxResult.success(); |
| | | }else { |
| | | return AjaxResult.error(); |
| | |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | esModel.setId(uuid); |
| | | esModel.setCtId(Long.valueOf(inte)); |
| | | esModel.setCtTableName("家庭小医生"); |
| | | esModel.setCtTableName("家大事记"); |
| | | |
| | | esModel.setBy1(String.valueOf(zfDownload.getDownloadId())); |
| | | esModel.setBy2(String.valueOf(zfDownload.getDownloadContent())); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zfEventShareService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2013L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家庭小医生下载"); |
| | | |
| | | zfDownloads.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家大事记下载删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | private EsService esSer; |
| | | |
| | | @Resource |
| | | private ZfEventDownloadService zfEventDownloadService; |
| | | |
| | | @Resource |
| | | private ZfEventShareService zfEventShareService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | private LambdaQueryWrapper<ZfEvent> buildCondition(ZfEvent zfEvent,List<Long> familyIdList) { |
| | | LambdaQueryWrapper<ZfEvent> lqw = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | List<ZfEvent> zfEvents = listByIds(Arrays.asList(ids)); |
| | | if (! (zfEventDownloadService.deleteData(ids) && zfEventShareService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | if (zfEventService.removeByIds(Arrays.asList(ids))) { |
| | | |
| | | //删除es中的数据 |
| | | zfEvents.stream().forEach(zfEvent -> { |
| | | EsModel esModel = esSer.findByCtId(zfEvent.getId(), "家大事记"); |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | return AjaxResult.success(); |
| | | }else { |
| | | return AjaxResult.error(); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfDoctorShareService; |
| | | import com.ruoyi.service.ZfEventService; |
| | | import com.ruoyi.service.ZfEventShareService; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2013L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare: zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "家大事记分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteData(Long[] ids) { |
| | | List<ZfDownload> zfDownloads = listByIds(Arrays.asList(ids)); |
| | | public Boolean deleteData(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | if (zfPetService.removeByIds(Arrays.asList(ids))) { |
| | | LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfDownload::getDownloadContent, ids) |
| | | .eq(ZfDownload::getSysMenuId, 2022L); |
| | | |
| | | List<ZfDownload> zfDownloads = list(lqw); |
| | | System.out.println(zfDownloads); |
| | | if (zfDownloads.size() == 0){ |
| | | return true; |
| | | } |
| | | for (ZfDownload zfDownload: zfDownloads) { |
| | | id.add(zfDownload.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | |
| | | if (removeByIds(id)) { |
| | | |
| | | //删除es中的数据 |
| | | zfDownloads.stream().forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载"); |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "通讯录下载删除"); |
| | | |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | |
| | | } |
| | | } |
| | | }); |
| | | return AjaxResult.success(); |
| | | return true; |
| | | } else { |
| | | return AjaxResult.error(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | @Resource |
| | | ZAuthorityService zAuthorityService; |
| | | |
| | | @Resource |
| | | ZfPetSharService zfPetSharService; |
| | | |
| | | @Resource |
| | | ZfPetDownlService zfPetDownlService; |
| | | @Override |
| | | public AjaxResult selectDataList(ZfPet zfPet, Integer pageNum, Integer pageSize) { |
| | | // LambdaQueryWrapper<ZfPet> lqw = buildCondition(zfPet); |
| | |
| | | throw new RuntimeException("你没有权限操作此家庭的数据"); |
| | | } |
| | | } |
| | | if (! (zfPetDownlService.deleteData(ids) && zfPetSharService.deleteByContentId(ids) ) ){ |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | if (zfPetService.removeByIds(Arrays.asList(ids))) { |
| | | return AjaxResult.success(); |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.mapper.ZfShareMapper; |
| | | import com.ruoyi.service.TravelDetailService; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfPetService; |
| | | import com.ruoyi.service.ZfPetSharService; |
| | | import com.ruoyi.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.elasticsearch.action.delete.DeleteRequest; |
| | | import org.elasticsearch.client.RequestOptions; |
| | | import org.elasticsearch.client.RestHighLevelClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | private ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | EsService esService; |
| | | |
| | | private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(StringUtils.isNotEmpty(String.valueOf(zfShare.getShareId())), ZfShare::getShareId, zfShare.getShareId()); |
| | |
| | | Long userId = user.getUserId(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,userId); |
| | | lqw.eq(ZfShare::getShareId, userId); |
| | | |
| | | return list(lqw); |
| | | } |
| | | |
| | | public Long getUserId(){ |
| | | public Long getUserId() { |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | return myself.getUserId(); |
| | | |
| | | } |
| | | |
| | | public void addData(ZfShare za) |
| | | { |
| | | public void addData(ZfShare za) { |
| | | LambdaQueryWrapper<ZfShare> lqw = uniqueCondition(za); |
| | | List<ZfShare> list = list(lqw); |
| | | |
| | | if(list.size()>0){ |
| | | if (list.size() > 0) { |
| | | throw new RuntimeException("请勿分享重复数据"); |
| | | } |
| | | else { |
| | | } else { |
| | | save(za); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public AjaxResult saveZa(ShareMore shareMore) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long [] shareContents = shareMore.getShareContents(); |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | Long[] shareContents = shareMore.getShareContents(); |
| | | for (Long shareId : shareIds) { |
| | | for (Long shareContent : shareContents) { |
| | | ZfShare za = new ZfShare(); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listByFidAid(ShareMore shareMore, Integer pageNo, Integer pageSize) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | List<ZfPet> beanRecord3 = new ArrayList<>(); |
| | | for (Long shareId : shareIds) { |
| | | { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,shareId) |
| | | .eq(ZfShare::getSysMenuId,shareMore.getSysMenuId()) |
| | | lqw.eq(ZfShare::getShareId, shareId) |
| | | .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId()) |
| | | .eq(ZfShare::getUserId, getUserId()); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | beanRecord3.add(zfPetService.getById(beanRecord.getShareContent())); |
| | | } |
| | | } |
| | | } |
| | | List<ZfPet> record = beanRecord3.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | List<ZfPet> record = beanRecord3.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (beanRecord3.size() -1) / pageSize +1; |
| | | int totalPage = (beanRecord3.size() - 1) / pageSize + 1; |
| | | |
| | | Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, record,beanRecord3.size()); |
| | | Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize, totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, record, beanRecord3.size()); |
| | | |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult deleteZa(ShareMore shareMore) { |
| | | Long [] shareIds = shareMore.getShareIds(); |
| | | Long [] shareContents = shareMore.getShareContents(); |
| | | for(Long shareId : shareIds) |
| | | for(Long shareContent: shareContents) |
| | | { |
| | | Long[] shareIds = shareMore.getShareIds(); |
| | | Long[] shareContents = shareMore.getShareContents(); |
| | | for (Long shareId : shareIds) |
| | | for (Long shareContent : shareContents) { |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,shareId) |
| | | lqw.eq(ZfShare::getShareId, shareId) |
| | | .eq(ZfShare::getShareContent, shareContent) |
| | | .eq(ZfShare::getSysMenuId, shareMore.getSysMenuId()) |
| | | .eq(ZfShare::getUserId, getUserId()); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listByUserId() { |
| | | HashMap<Long,List<ZfPet>> bs = new HashMap<>(); |
| | | HashMap<Long, List<ZfPet>> bs = new HashMap<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2022L); |
| | | lqw.eq(ZfShare::getShareId, getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId, 2022L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | List<ZfPet> b1 = new ArrayList<>(); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | b1.add(zfPetService.getById(beanRecord.getShareContent())); |
| | | bs.put(beanRecord.getUserId(),b1); |
| | | bs.put(beanRecord.getUserId(), b1); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | return AjaxResult.success(bs); |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listUserId(Integer pageNo, Integer pageSize) { |
| | | List<ZfPet> bs = new ArrayList<>(); |
| | | List<ZfPet> bs = new ArrayList<>(); |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(ZfShare::getShareId,getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId,2022L); |
| | | lqw.eq(ZfShare::getShareId, getUserId()); |
| | | lqw.eq(ZfShare::getSysMenuId, 2022L); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | for (ZfShare beanRecord : beanRecords ) { |
| | | for (ZfShare beanRecord : beanRecords) { |
| | | ZfPet bs2 = zfPetService.getById(beanRecord.getShareContent()); |
| | | bs2.setShareId(beanRecord.getUserId().intValue()); |
| | | bs.add(bs2); |
| | | } |
| | | log.info("从数据库中查到的为:{}", bs); |
| | | List<ZfPet> record = bs.stream().skip((pageNo-1)*pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | List<ZfPet> record = bs.stream().skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | |
| | | int totalPage = (bs.size() -1) / pageSize +1; |
| | | int totalPage = (bs.size() - 1) / pageSize + 1; |
| | | |
| | | Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize,totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, record,bs.size()); |
| | | Page<ZfPet> zfPetPage = new Page<>(pageNo, pageSize, totalPage); |
| | | HashMap<String, Object> data = MapUtils.getShareResult(zfPetPage, record, bs.size()); |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | |
| | | .eq(ZfShare::getShareContent, zfDownload.getDownloadContent()) |
| | | .eq(ZfShare::getSysMenuId, zfDownload.getSysMenuId()); |
| | | List<ZfShare> beanRecords = list(lqw); |
| | | if (beanRecords.size() != 0){ |
| | | if (beanRecords.size() != 0) { |
| | | return beanRecords.get(0).getUserId(); |
| | | } |
| | | else { |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByContentId(Long[] ids) { |
| | | List<Long> id = new ArrayList<>(); |
| | | |
| | | LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(ids != null, ZfShare::getShareContent, ids) |
| | | .eq(ZfShare::getSysMenuId, 2022L); |
| | | |
| | | List<ZfShare> zfShares = list(lqw); |
| | | if (zfShares.size() == 0) { |
| | | return true; |
| | | } |
| | | for (ZfShare zfShare : zfShares) { |
| | | id.add(zfShare.getId()); |
| | | } |
| | | |
| | | System.out.println(id); |
| | | if (removeByIds(id)) { |
| | | //删除es中的数据 |
| | | zfShares.forEach(zfDoctorDownload -> { |
| | | EsModel esModel = esService.findByCtId(zfDoctorDownload.getId().intValue(), "宠物分享删除"); |
| | | if (esModel != null) { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | System.out.println(deleteRequest); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest, RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |