|
@@ -0,0 +1,166 @@
|
|
|
+package com.jeeplus.workbench;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.jeeplus.aop.logging.annotation.ApiLog;
|
|
|
+import com.jeeplus.circulation2.service.GwCirculationCard2Service;
|
|
|
+import com.jeeplus.circulation2.service.dto.GwCirculationCard2DTO;
|
|
|
+import com.jeeplus.circulation2.service.mapstruct.GwCirculationCard2Wrapper;
|
|
|
+import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
+import com.jeeplus.sys.domain.DictValue;
|
|
|
+import com.jeeplus.sys.service.dto.DictValueDTO;
|
|
|
+import com.jeeplus.sys.service.dto.RoleDTO;
|
|
|
+import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
+import com.jeeplus.sys.utils.UserUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.collections.map.HashedMap;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+@Api(tags ="工作台")
|
|
|
+@RestController
|
|
|
+@RequestMapping(value = "/workbench/index")
|
|
|
+public class WorkBenchController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private GwCirculationCard2Service gwCirculationCard2Service;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private GwCirculationCard2Wrapper gwCirculationCard2Wrapper;
|
|
|
+
|
|
|
+ @ApiLog("一键搜")
|
|
|
+ @ApiOperation(value = "一键搜")
|
|
|
+ @GetMapping("queryOneSearch")
|
|
|
+ public ResponseEntity<Map<String,Object>> queryOneSearch(HttpServletRequest request, String searchContent) throws Exception{
|
|
|
+ Map<String,Object> map = new HashedMap();
|
|
|
+ List<WorkBenchDTO> workBenchList = new ArrayList<>();
|
|
|
+
|
|
|
+ UserDTO userDTO= UserUtils.getCurrentUserDTO();
|
|
|
+ List<RoleDTO> list=userDTO.getRoleDTOList();
|
|
|
+ boolean isadmin=false;
|
|
|
+ for (RoleDTO aa:list) {
|
|
|
+ if(aa.getName().equals("租户管理员")||aa.getName().equals("管理员")){
|
|
|
+ isadmin=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //来文机关/日期/摘要内容/附件名称
|
|
|
+ List<HashMap<String, Object>> result=gwCirculationCard2Service.findListByStr (searchContent,userDTO.getId(),isadmin);
|
|
|
+ for(HashMap<String, Object> gw1:result){
|
|
|
+ WorkBenchDTO workBenchDTO = new WorkBenchDTO();
|
|
|
+ workBenchDTO.setTitle("年度:["+gw1.get("yearNum")+"]"+gw1.get("cardNum")+"号 来文机关:"+gw1.get("sendingAgency"));
|
|
|
+
|
|
|
+ String aa=gw1.get("contentSummary").toString();
|
|
|
+ if(aa.length()>60){
|
|
|
+ aa=aa.substring(0,60)+"...";
|
|
|
+ }
|
|
|
+ workBenchDTO.setContent("内容摘要:"+aa+" 收文时间:"+gw1.get("receivingTime")+" 文件来源:"+gw1.get("fileSource")+" 文件字号:"+gw1.get("docFontSize"));
|
|
|
+ workBenchDTO.setId(gw1.get("id").toString());
|
|
|
+ workBenchDTO.setType("cs");
|
|
|
+ workBenchList.add(workBenchDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// for(ReligiousSitesInfoDTO sitesInfoDTO:result){
|
|
|
+// WorkBenchDTO workBenchDTO = new WorkBenchDTO();
|
|
|
+// sitesInfoDTO.setSiteDetailInfo("联系人:"+sitesInfoDTO.getContact()+" 联系方式:"+sitesInfoDTO.getContactNumber()+" 所属地区:"+sitesInfoDTO.getPlaceSelectName()+" 地点:"+sitesInfoDTO.getPlace());
|
|
|
+// workBenchDTO.setTitle(sitesInfoDTO.getName()+"(场所)");
|
|
|
+// workBenchDTO.setContent(sitesInfoDTO.getSiteDetailInfo());
|
|
|
+// workBenchDTO.setId(sitesInfoDTO.getId());
|
|
|
+// workBenchDTO.setType("cs");
|
|
|
+// workBenchList.add(workBenchDTO);
|
|
|
+// }
|
|
|
+// map.put("siteList",siteList);
|
|
|
+// Map<String,Object> rymap = new HashedMap();
|
|
|
+// //人员搜索
|
|
|
+// rymap.put("name",searchContent);
|
|
|
+// rymap.put("idcard",searchContent);
|
|
|
+// rymap.put("phone",searchContent);
|
|
|
+// rymap.put("nativePlace",searchContent);
|
|
|
+// rymap.put("currentResidence",searchContent);
|
|
|
+// List<UserManagementDTO> ryList = ""==searchContent?new ArrayList<>(): userManagementService.findCountsByParama(rymap);
|
|
|
+// List<DictValueDTO> list = dictValueService.lambdaQuery ().
|
|
|
+// eq ( DictValue::getDictTypeId, "1574590144800018433").
|
|
|
+// orderByAsc (DictValue::getSort).list ().stream ().
|
|
|
+// map (dictValueWrapper::toDTO).collect (Collectors.toList ());
|
|
|
+// for(UserManagementDTO userDto:ryList){
|
|
|
+// WorkBenchDTO workBenchDTO = new WorkBenchDTO();
|
|
|
+// StringBuffer sb1 = new StringBuffer();
|
|
|
+// String personnelType = userDto.getPersonnelType();
|
|
|
+// if (null != personnelType && !"".equals(personnelType)) {
|
|
|
+// String[] personnelTypes = personnelType.split(",");
|
|
|
+// for (int j = 0; j < personnelTypes.length; j++) {
|
|
|
+// for (int k = 0; k < list.size(); k++) {
|
|
|
+// DictValueDTO dictValueDTO = list.get(k);
|
|
|
+// if(personnelTypes[j].equals(dictValueDTO.getValue())){
|
|
|
+// sb1.append(dictValueDTO.getLabel());
|
|
|
+// if(j+1<personnelTypes.length){
|
|
|
+// sb1.append(",");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if("1".equals(userDto.getSex())){
|
|
|
+// String phone = userDto.getPhone()==null?"无":userDto.getPhone();
|
|
|
+// userDto.setRyDetailInfo("性别:男"+" 身份证号:"+userDto.getIdNumber()+" 联系方式:"+phone+" 人员类型:"+sb1.toString()+" 籍贯:"+userDto.getNativePlace()+" 现居地:"+userDto.getCurrentResidence());
|
|
|
+// }else{
|
|
|
+// String phone = userDto.getPhone()==null?"无":userDto.getPhone();
|
|
|
+// userDto.setRyDetailInfo("性别:女"+" 身份证号:"+userDto.getIdNumber()+" 联系方式:"+phone+" 人员类型:"+sb1.toString()+" 籍贯:"+userDto.getNativePlace()+" 现居地:"+userDto.getCurrentResidence());
|
|
|
+// }
|
|
|
+// workBenchDTO.setTitle(userDto.getName()+"(人员)");
|
|
|
+// workBenchDTO.setContent(userDto.getRyDetailInfo());
|
|
|
+// workBenchDTO.setId(userDto.getId());
|
|
|
+// workBenchDTO.setType("ry");
|
|
|
+// workBenchList.add(workBenchDTO);
|
|
|
+// }
|
|
|
+// map.put("ryList",ryList);
|
|
|
+// //组织搜索
|
|
|
+// Map<String,Object> zzmap = new HashedMap();
|
|
|
+// zzmap.put("name",searchContent);
|
|
|
+// zzmap.put("organization",searchContent);
|
|
|
+// zzmap.put("organizationPhone",searchContent);
|
|
|
+// List<ReligionDTO> religionList = ""==searchContent?new ArrayList<>():religionService.findByName(zzmap);
|
|
|
+// for(ReligionDTO religionDTO:religionList){
|
|
|
+// WorkBenchDTO workBenchDTO = new WorkBenchDTO();
|
|
|
+// religionDTO.setReDetailInfo("组织负责人:"+religionDTO.getOrganization()+" 负责人联系方式:"+religionDTO.getOrganizationPhone()+" 组织规模:"+religionDTO.getOrganizationSize()+" 所属区域:"+religionDTO.getPlaceSelectName()+" 详细地址:"+religionDTO.getPlaceDetailed());
|
|
|
+// workBenchDTO.setTitle(religionDTO.getOrganizationName()+"(组织)");
|
|
|
+// workBenchDTO.setContent(religionDTO.getReDetailInfo());
|
|
|
+// workBenchDTO.setId(religionDTO.getId());
|
|
|
+// workBenchDTO.setType("zz");
|
|
|
+// workBenchList.add(workBenchDTO);
|
|
|
+// }
|
|
|
+// map.put("religionList",religionList);
|
|
|
+// //待办搜索
|
|
|
+// AssignWorkOrderDTO assignWorkOrderDTO = new AssignWorkOrderDTO();
|
|
|
+// QueryWrapper queryWrapper = QueryWrapperGenerator.buildQueryCondition ( assignWorkOrderDTO, AssignWorkOrderDTO.class);
|
|
|
+// queryWrapper.like("problem_content",searchContent);
|
|
|
+// Page<AssignWorkOrderDTO> page = new Page<AssignWorkOrderDTO>();
|
|
|
+// IPage<AssignWorkOrderDTO> result = assignWorkOrderService.findTop (page, queryWrapper);
|
|
|
+// List<AssignWorkOrderDTO> orderDTOList = ""==searchContent?new ArrayList<>():result.getRecords();
|
|
|
+// for(AssignWorkOrderDTO workOrderDTO:orderDTOList){
|
|
|
+// WorkBenchDTO workBenchDTO = new WorkBenchDTO();
|
|
|
+// workOrderDTO.setWorkDetailInfo("问题发生地区:"+workOrderDTO.getAreaSelectName()+" 问题发生时间:"+workOrderDTO.getProblemTime());
|
|
|
+// workBenchDTO.setTitle("待办事项"+"(待办)");
|
|
|
+// workBenchDTO.setContent(workOrderDTO.getWorkDetailInfo());
|
|
|
+// workBenchDTO.setId(workOrderDTO.getId());
|
|
|
+// workBenchDTO.setType("db");
|
|
|
+// workBenchList.add(workBenchDTO);
|
|
|
+// }
|
|
|
+// map.put("dbList",orderDTOList);
|
|
|
+ map.put("totalList",workBenchList);
|
|
|
+ return ResponseEntity.ok(map);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|