| | |
| | | import com.moral.api.pojo.bean.BaseInvalidEntity; |
| | | import com.moral.api.pojo.dto.allocation.AllocationUnitViewDto; |
| | | import com.moral.api.pojo.enums.*; |
| | | import com.moral.api.pojo.ext.allocation.AllocationExcelExt; |
| | | import com.moral.api.pojo.ext.allocation.AllocationExt; |
| | | import com.moral.api.pojo.ext.allocation.AllocationListExt; |
| | | import com.moral.api.pojo.ext.allocation.AllocationPageExt; |
| | |
| | | import com.moral.api.pojo.vo.app.AppAuthority; |
| | | import com.moral.api.pojo.vo.user.QxUser; |
| | | import com.moral.api.service.*; |
| | | import com.moral.api.utils.BeanConverts; |
| | | import com.moral.constant.Constants; |
| | | import com.moral.constant.RedisConstants; |
| | | import com.moral.util.DateUtils; |
| | |
| | | } |
| | | } |
| | | |
| | | // Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo(); |
| | | // Object unitId = userInfo.get("unitId"); |
| | | // Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization"); |
| | | // Integer orgId = (Integer) orgInfo.get("id"); |
| | | // if (!ObjectUtils.isEmpty(map.get("unitId"))){ |
| | | // wrapper.in("unit_id",map.get("unitId").toString()); |
| | | // }else { |
| | | // if (orgId!=24){ |
| | | // if (ObjectUtils.isEmpty(unitId)){ |
| | | // return null; |
| | | // } |
| | | // ResponsibilityUnit responsibilityUnit1 = responsibilityUnitMapper.selectById(Integer.parseInt(unitId.toString())); |
| | | // Integer areaCode = responsibilityUnit1.getAreaCode(); |
| | | // List<ResponsibilityUnit> responsibilityUnits = responsibilityUnitService.selectUnit(areaCode); |
| | | // if (ObjectUtils.isEmpty(responsibilityUnits)){ |
| | | // List<ResponsibilityUnit> responsibilityUnits1 = responsibilityUnitService.selectAreaUnit(areaCode); |
| | | // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits1.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); |
| | | // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); |
| | | // wrapper.in("unit_id",collect1); |
| | | // }else { |
| | | // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); |
| | | // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); |
| | | // wrapper.in("unit_id",collect1); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | HashMap<String, Object> rsMap = new HashMap<>(); |
| | | ArrayList<Map<String, Object>> polluteArrayList = new ArrayList<>(); |
| | | ArrayList<Map<String, Object>> escalationTypeList = new ArrayList<>(); |
| | | ArrayList<AllocationUnitViewDto> allocationUnitViewDtos = new ArrayList<>(); |
| | | |
| | | Object number1 = map.get("number"); |
| | | String number1 = map.get("number").toString(); |
| | | String startTime=null; |
| | | String endTime=null; |
| | | if (!ObjectUtils.isEmpty(map.get("startTime")) || !ObjectUtils.isEmpty(map.get("endTime"))){ |
| | | startTime = map.get("startTime").toString(); |
| | | endTime = map.get("endTime").toString(); |
| | | // endTime = map.get("endTime").toString(); |
| | | endTime = DateUtils.getDateOfDay(map.get("endTime").toString(), 1, DateUtils.yyyy_MM_dd_EN); |
| | | |
| | | } |
| | | if (!ObjectUtils.isEmpty(number1)){ |
| | | if (!number1.equals("0")){ |
| | | String s = "-"+number1; |
| | | //获取当前时间 |
| | | endTime = DateUtils.getCurDateTime(); |
| | |
| | | } |
| | | } |
| | | } |
| | | // Map<String, Object> userInfo = (Map<String, Object>) TokenUtils.getUserInfo(); |
| | | // Object unitId = userInfo.get("unitId"); |
| | | // Map<String, Object> orgInfo = (Map<String, Object>) userInfo.get("organization"); |
| | | // Integer orgId = (Integer) orgInfo.get("id"); |
| | | // |
| | | // if (ObjectUtils.isEmpty(unitId)){ |
| | | // return null; |
| | | // } |
| | | // if (orgId!=24){ |
| | | // ResponsibilityUnit responsibilityUnit1 = responsibilityUnitMapper.selectById(Integer.parseInt(unitId.toString())); |
| | | // Integer areaCode = responsibilityUnit1.getAreaCode(); |
| | | // List<ResponsibilityUnit> responsibilityUnits = responsibilityUnitService.selectUnit(areaCode); |
| | | // if (ObjectUtils.isEmpty(responsibilityUnits)){ |
| | | // List<ResponsibilityUnit> responsibilityUnits1 = responsibilityUnitService.selectAreaUnit(areaCode); |
| | | // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits1.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); |
| | | // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); |
| | | // wrapper.in("unit_id",collect1); |
| | | // }else { |
| | | // Map<Integer, List<ResponsibilityUnit>> collect = responsibilityUnits.stream().collect(Collectors.groupingBy(o -> o.getUnitId())); |
| | | // List<Integer> collect1 = collect.keySet().stream().collect(Collectors.toList()); |
| | | // wrapper.in("unit_id",collect1); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | ArrayList<Map<String, Object>> rsMap = new ArrayList<>(); |
| | | Object number1 = map.get("number"); |
| | |
| | | |
| | | @Override |
| | | public Page<AllocationPageExt> extPage(AllocationPageCond allocationPageCond) { |
| | | List<Integer> unitAuthority = this.getUnitAuthority(SysDictTypeEnum.SYS_AMEND.value); |
| | | List<Integer> unitList = unitResult(); |
| | | Integer codeId = unitAreaCode(); |
| | | allocationPageCond.setUnitList(unitList); |
| | |
| | | }else { |
| | | it.setIsApprove(0); |
| | | } |
| | | it.setIsCode(ObjectUtils.isEmpty(unitAuthority)?"2":"1"); |
| | | }); |
| | | } |
| | | return page; |
| | |
| | | return allocationLogs; |
| | | } |
| | | |
| | | /** |
| | | * 根据字典名称获取权限 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Integer> getUnitAuthority(String code) { |
| | | QxUser user = UserHelper.getCurrentUser(); |
| | | List<Integer> userList = responsibilityUnitMapper.selectCodeList(code,user.getUserId()); |
| | | return userList; |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> unitResult() { |
| | | QxUser user = UserHelper.getCurrentUser(); |
| | |
| | | return responsibilityUnit; |
| | | } |
| | | |
| | | @Override |
| | | public List<AllocationExcelExt> listExcel(List<Integer> id) { |
| | | List<AllocationExcelExt> list = new ArrayList<>(); |
| | | for(Integer i : id){ |
| | | AllocationExt allocationExt = oneAllocation(i); |
| | | AllocationExcelExt allocationExcelExt = BeanConverts.convert(allocationExt,AllocationExcelExt.class); |
| | | allocationExcelExt.setFileBaseList(fileTableService.list(i,FileTableEnum.ALLOCATION_FOUNDATION.value,FileType.PICTURE.getValue())); |
| | | allocationExcelExt.setFileChangeList(fileTableService.list(i,FileTableEnum.ALLOCATION_RECTIFICATION.value,FileType.PICTURE.getValue())); |
| | | list.add(allocationExcelExt); |
| | | } |
| | | return list; |
| | | } |
| | | } |