| | |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.dto.community.CommunityDto; |
| | | import com.java110.dto.file.FileRelDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.intf.common.IFileRelInnerServiceSMO; |
| | | import com.java110.intf.community.ICommunityV1InnerServiceSMO; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerV1InnerServiceSMO; |
| | |
| | | |
| | | @Autowired |
| | | private IOwnerV1InnerServiceSMO ownerV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private ICommunityV1InnerServiceSMO communityV1InnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | |
| | | ownerRepairs.add(repairDto); |
| | | } |
| | | refreshRepair(ownerRepairs); |
| | | |
| | | refreshCommunityName(ownerRepairs); |
| | | } else { |
| | | ownerRepairs = new ArrayList<>(); |
| | | } |
| | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | private void refreshCommunityName(List<RepairDto> ownerRepairs) { |
| | | |
| | | if(ListUtil.isNull(ownerRepairs)){ |
| | | return; |
| | | } |
| | | |
| | | List<String> communityIds = new ArrayList<>(); |
| | | for (RepairDto repairDto : ownerRepairs) { |
| | | communityIds.add(repairDto.getCommunityId()); |
| | | } |
| | | |
| | | if(ListUtil.isNull(communityIds)){ |
| | | return ; |
| | | } |
| | | CommunityDto communityDto = new CommunityDto(); |
| | | communityDto.setCommunityIds(communityIds.toArray(new String[communityIds.size()])); |
| | | List<CommunityDto> communityDtos = communityV1InnerServiceSMOImpl.queryCommunitys(communityDto); |
| | | if(ListUtil.isNull(communityDtos)){ |
| | | return; |
| | | } |
| | | for (RepairDto tmpRepairDto : ownerRepairs) { |
| | | for (CommunityDto tCommunityDto : communityDtos) { |
| | | if (!tmpRepairDto.getCommunityId().equals(tCommunityDto.getCommunityId())) { |
| | | continue; |
| | | } |
| | | tmpRepairDto.setCommunityName(tCommunityDto.getName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void ifHasTime(RepairDto ownerRepairDto) { |
| | | |
| | | if (StringUtil.isEmpty(ownerRepairDto.getEndTime())) { |