| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | TDriverResp tDriverResp = new TDriverResp(); |
| | | BeanUtils.copyProperties(tDriver,tDriverResp); |
| | | |
| | | if(Objects.nonNull(tDriverResp.getFirstCertificateTime())){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String format1 = format.format(tDriverResp.getFirstCertificateTime()); |
| | | tDriverResp.setFirstCertificateTimeStr(format1); |
| | | } |
| | | // tDriverResp.setFirstCertificateTime(format.parse(format1)); |
| | | |
| | | // 查询邀请人 |
| | | TDriver tDriver1 = tDriverService.selectById(tDriver.getInviterId()); |
| | | if(Objects.nonNull(tDriver1)){ |
| | |
| | | TRegion city = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tDriver.getCityCode()) |
| | | .last("LIMIT 1")); |
| | | |
| | | tDriverResp.setArea(tDriver.getProvinceName()+"/"+tDriver.getCityName()+"/"+tDriver.getAreaName()); |
| | | if(Objects.nonNull(district) && Objects.nonNull(city)){ |
| | | tDriverResp.setAreaId(city.getParentId()+"/"+city.getId()+"/"+district.getId()); |
| | | // tDriverResp.setArea(tDriver.getProvinceName()+"/"+tDriver.getCityName()+"/"+tDriver.getAreaName()); |
| | | // if(Objects.nonNull(district) && Objects.nonNull(city)){ |
| | | // tDriverResp.setAreaId(city.getParentId()+"/"+city.getId()+"/"+district.getId()); |
| | | // } |
| | | if(StringUtils.hasLength(tDriver.getAreaName()) && !tDriver.getAreaName().equals(tDriver.getCityName())){ |
| | | tDriverResp.setArea(tDriver.getProvinceName()+"/"+tDriver.getCityName()+"/"+tDriver.getAreaName()); |
| | | }else { |
| | | tDriverResp.setArea(tDriver.getProvinceName()+"/"+tDriver.getCityName()); |
| | | } |
| | | |
| | | if(Objects.nonNull(city)){ |
| | | if(Objects.nonNull(district) && !district.getCode().equals(city.getCode())){ |
| | | tDriverResp.setAreaId(city.getParentId()+"/"+city.getId()+"/"+district.getId()); |
| | | }else { |
| | | tDriverResp.setAreaId(city.getParentId()+"/"+city.getId()); |
| | | } |
| | | } |
| | | |
| | | model.addAttribute("item",tDriverResp); |
| | | model.addAttribute("driver",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_edit.html"; |
| | | } |
| | |
| | | String[] split = area.split("/"); |
| | | model.addAttribute("provinceName",split[0]); |
| | | model.addAttribute("cityName",split[1]); |
| | | model.addAttribute("districtName",split[2]); |
| | | if(split.length>2){ |
| | | model.addAttribute("districtName",split[2]); |
| | | }else { |
| | | model.addAttribute("districtName",""); |
| | | } |
| | | |
| | | String[] split1 = areaId.split("/"); |
| | | model.addAttribute("provinceId",split1[0]); |
| | | model.addAttribute("cityId",split1[1]); |
| | | model.addAttribute("districtId",split1[2]); |
| | | if(split1.length>2) { |
| | | model.addAttribute("districtId", split1[2]); |
| | | }else { |
| | | model.addAttribute("districtId", ""); |
| | | } |
| | | |
| | | |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取详情中的汇总数据查询 |
| | | * @param id |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySummaryData") |
| | | public Object querySummaryData(Integer id, String time){ |
| | | return tDriverService.querySummaryData(id, time); |
| | | } |
| | | } |