Commit 2f9d5394185bbdb6b8fa1bcbd642a0ddbb71a31c
1 parent
cab1c386
优化功能;订单无法导出、小程序打包过大、H5地图无法使用
Showing
54 changed files
with
2265 additions
and
443 deletions
trash-admin/src/main/resources/static/company.png
0 → 100644
9.72 KB
trash-admin/src/main/resources/static/driver.png
0 → 100644
29.9 KB
trash-admin/src/main/resources/static/handler.png
0 → 100644
12.6 KB
trash-admin/src/main/resources/static/manager.png
0 → 100644
3.5 KB
trash-admin/src/main/resources/static/role/company.png
0 → 100644
9.72 KB
trash-admin/src/main/resources/static/role/disposal.png
0 → 100644
14.5 KB
trash-admin/src/main/resources/static/role/handler.png
0 → 100644
14.8 KB
trash-admin/src/main/resources/static/role/user.png
0 → 100644
10 KB
trash-admin/src/main/resources/static/user.png
0 → 100644
10.1 KB
trash-garbage/src/main/java/com/trash/garbage/controller/GarCarController.java
0 → 100644
| 1 | +package com.trash.garbage.controller; | |
| 2 | + | |
| 3 | +import cn.hutool.core.convert.Convert; | |
| 4 | +import cn.hutool.http.HttpRequest; | |
| 5 | +import com.alibaba.fastjson.JSON; | |
| 6 | +import com.alibaba.fastjson.JSONArray; | |
| 7 | +import com.alibaba.fastjson.JSONObject; | |
| 8 | +import com.github.pagehelper.PageInfo; | |
| 9 | +import com.trash.carInfo.domain.CarDriverRelation; | |
| 10 | +import com.trash.carInfo.domain.CarInfo; | |
| 11 | +import com.trash.carInfo.domain.vo.CarInfoVo; | |
| 12 | +import com.trash.carInfo.service.impl.CarInfoServiceImpl; | |
| 13 | +import com.trash.common.constant.HttpStatus; | |
| 14 | +import com.trash.common.core.page.TableDataInfo; | |
| 15 | +import com.trash.driver.domain.Driver; | |
| 16 | +import com.trash.driver.domain.vo.DriverVo; | |
| 17 | +import com.trash.driver.service.IDriverService; | |
| 18 | +import com.trash.enterprise.domain.TransportationEnterprise; | |
| 19 | +import com.trash.garbage.pojo.dto.GarCarInfoVo; | |
| 20 | +import javafx.scene.control.SplitPane; | |
| 21 | +import lombok.extern.slf4j.Slf4j; | |
| 22 | +import org.apache.commons.collections4.CollectionUtils; | |
| 23 | +import org.apache.commons.lang3.StringUtils; | |
| 24 | +import org.apache.commons.lang3.time.FastDateFormat; | |
| 25 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 26 | +import org.springframework.beans.factory.annotation.Value; | |
| 27 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 28 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 29 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 30 | +import org.springframework.web.bind.annotation.RestController; | |
| 31 | + | |
| 32 | +import java.text.ParseException; | |
| 33 | +import java.util.*; | |
| 34 | +import java.util.stream.Collectors; | |
| 35 | + | |
| 36 | +@RestController | |
| 37 | +@RequestMapping("/gar/car") | |
| 38 | +@Slf4j | |
| 39 | +public class GarCarController { | |
| 40 | + private final CarInfoServiceImpl carInfoServiceImpl; | |
| 41 | + private String contentType = "application/json"; | |
| 42 | + | |
| 43 | + @Value("${trash.token}") | |
| 44 | + private String authorization; | |
| 45 | + @Value("${trash.remotePath}") | |
| 46 | + private String remotePath; | |
| 47 | + | |
| 48 | + @Autowired | |
| 49 | + private IDriverService driverService; | |
| 50 | + | |
| 51 | + private final static FastDateFormat FAST_DATE_FORMAT = FastDateFormat.getInstance("yyyy-MM-dd"); | |
| 52 | + | |
| 53 | + public GarCarController(CarInfoServiceImpl carInfoServiceImpl) { | |
| 54 | + this.carInfoServiceImpl = carInfoServiceImpl; | |
| 55 | + } | |
| 56 | + | |
| 57 | + @PostMapping("/list/group/by/carType") | |
| 58 | + public TableDataInfo listGroupByCarTypePost(GarCarInfoVo carInfo) throws ParseException{ | |
| 59 | + return listGroupByCarType(carInfo); | |
| 60 | + } | |
| 61 | + @GetMapping("/list/group/by/carType") | |
| 62 | + public TableDataInfo listGroupByCarType(GarCarInfoVo carInfo) throws ParseException { | |
| 63 | + Map<String, String> headers = new HashMap<>(); | |
| 64 | + headers.put("Authorization", authorization); | |
| 65 | + headers.put("Content-Type", contentType); | |
| 66 | + | |
| 67 | + Map<String, Object> params = new HashMap<>(); | |
| 68 | + if (Objects.nonNull(carInfo.getCompanyId())) { | |
| 69 | + if (StringUtils.length(carInfo.getCompanyId()) < 5) { | |
| 70 | + params.put("companyID", "zxljqy" + carInfo.getCompanyId()); | |
| 71 | + } else { | |
| 72 | + params.put("companyID", carInfo.getCompanyId()); | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 76 | + params.put("valid", 0); | |
| 77 | + params.put("tag", 1); | |
| 78 | + params.put("page", 1); | |
| 79 | + params.put("size", 100); | |
| 80 | + | |
| 81 | + String json = null; | |
| 82 | + List<GarCarInfoVo> list = new ArrayList<>(); | |
| 83 | + try { | |
| 84 | + String paramStr = JSON.toJSONString(params); | |
| 85 | + json = HttpRequest.get(remotePath + "/api/gpsservice/cs/basevehicle/ledger/list").header("Authorization", authorization).header("Content-Type", contentType) | |
| 86 | + .timeout(15000).body(paramStr).execute().body(); | |
| 87 | + log.info("/api/gpsservice/cs/basevehicle/ledger/list;params:[{}],returnJson:[{}]", paramStr, json); | |
| 88 | + } catch (Exception e) { | |
| 89 | + log.error("请求公司车辆信息异常", e); | |
| 90 | + } | |
| 91 | + | |
| 92 | + if (StringUtils.isNotEmpty(json)) { | |
| 93 | + Map<String, Object> hash = JSON.parseObject(json, HashMap.class); | |
| 94 | + if (Objects.nonNull(hash)) { | |
| 95 | + if (Objects.nonNull(hash.get("code")) && StringUtils.equals(hash.get("code").toString(), "200")) { | |
| 96 | + if (Objects.nonNull(hash.get("result")) && hash.get("result") instanceof JSONObject) { | |
| 97 | + JSONObject resultObj = (JSONObject) hash.get("result"); | |
| 98 | + if (Objects.nonNull(resultObj) && Objects.nonNull(resultObj.get("list")) && resultObj.get("list") instanceof JSONArray) { | |
| 99 | + JSONArray jsonArray = (JSONArray) resultObj.get("list"); | |
| 100 | + for (Object object : jsonArray) { | |
| 101 | + JSONObject jsonObject = (JSONObject) object; | |
| 102 | + | |
| 103 | + GarCarInfoVo vo = new GarCarInfoVo(); | |
| 104 | + vo.setCarBrank(jsonObject.getString("brandName")); | |
| 105 | + vo.setCarCode(jsonObject.getString("licenseplateNo")); | |
| 106 | + vo.setCarColor(jsonObject.getString("")); | |
| 107 | + vo.setCarIdentification(jsonObject.getString("licenseplateNo")); | |
| 108 | + vo.setCarType(jsonObject.getString("energyTypeName")); | |
| 109 | + if (Objects.nonNull(jsonObject.getString("companyID"))) { | |
| 110 | + vo.setCompanyId(StringUtils.replace(jsonObject.getString("companyID").toString(), "zxljqy", "")); | |
| 111 | + } | |
| 112 | + vo.setCompanyName(jsonObject.getString("companyName")); | |
| 113 | + vo.setContainerVolume(jsonObject.getString("containerVolume")); | |
| 114 | + vo.setEmissionStandard(jsonObject.getString("emissionStanName")); | |
| 115 | + vo.setFarmeNumber(jsonObject.getString("frmaeNo")); | |
| 116 | + vo.setId(StringUtils.replace(jsonObject.getString("id"), "zxljcl", "")); | |
| 117 | + vo.setStatus(jsonObject.getInteger("auditStatus")); | |
| 118 | + if (StringUtils.isNotEmpty(jsonObject.getString("transportCertValid"))) { | |
| 119 | + vo.setRoadTransportDate(FAST_DATE_FORMAT.parse(jsonObject.getString("transportCertValid"))); | |
| 120 | + } | |
| 121 | + if (StringUtils.isNotEmpty(jsonObject.getString("registerAt"))) { | |
| 122 | + vo.setEnterDate(FAST_DATE_FORMAT.parse(jsonObject.getString("registerAt"))); | |
| 123 | + } | |
| 124 | + | |
| 125 | + if (Objects.nonNull(jsonObject.get("drivers")) && jsonObject.get("drivers") instanceof JSONArray) { | |
| 126 | + JSONArray das = (JSONArray) jsonObject.get("drivers"); | |
| 127 | + int length = CollectionUtils.size(das); | |
| 128 | + if (length > 0) { | |
| 129 | + if (Objects.nonNull(das.get(0)) && das.get(0) instanceof JSONObject) { | |
| 130 | + JSONObject dro = (JSONObject) das.get(0); | |
| 131 | + vo.setDrivers(StringUtils.replace(dro.getString("driverId").toString(), "zxljjsy", "")); | |
| 132 | + vo.setDriversName(dro.getString("driverName")); | |
| 133 | + } | |
| 134 | + | |
| 135 | + Set<DriverVo> driverVoList = new HashSet<>(); | |
| 136 | + for (Object da : das) { | |
| 137 | + JSONObject dro = (JSONObject) da; | |
| 138 | + DriverVo driverVo = new DriverVo(); | |
| 139 | + driverVo.setName(dro.getString("driverName")); | |
| 140 | + driverVo.setPhoneNo(dro.getString("driverPhone")); | |
| 141 | + driverVo.setId(StringUtils.replace(dro.getString("driverId"), "zxljjsy", "")); | |
| 142 | + driverVoList.add(driverVo); | |
| 143 | + } | |
| 144 | + vo.setDriverVoList(driverVoList); | |
| 145 | + } | |
| 146 | + } | |
| 147 | + | |
| 148 | + | |
| 149 | + if (StringUtils.isNotEmpty(vo.getCarType())) { | |
| 150 | + list.add(vo); | |
| 151 | + } | |
| 152 | + } | |
| 153 | + } | |
| 154 | + } | |
| 155 | + } | |
| 156 | + } | |
| 157 | + } | |
| 158 | + | |
| 159 | + saveOrUpdateCarInfoAndDriver(list); | |
| 160 | + | |
| 161 | + TableDataInfo data = getDataTable(list); | |
| 162 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 163 | + Map<String, List<GarCarInfoVo>> carMap = list.stream().map(car -> { | |
| 164 | + if (Objects.equals(car.getCarType(), "轻型货车")) { | |
| 165 | + car.setCarLeft("car_1.png"); | |
| 166 | + car.setRemark("箱体长2.6m,宽1.7m,高1.5m;最多可容纳约90袋装修垃圾(75cm*5cm每袋)"); | |
| 167 | + } else if (Objects.equals(car.getCarType(), "中型货车")) { | |
| 168 | + car.setCarLeft("car_2.png"); | |
| 169 | + car.setRemark("箱体长3.2m,宽1.5m,高1.5m;最多可容纳约110袋装修垃圾(75cm*45cm每袋)"); | |
| 170 | + } else if (Objects.equals(car.getCarType(), "大中型货车")) { | |
| 171 | + car.setCarLeft("car_3.png"); | |
| 172 | + car.setRemark("箱体长3.2m,宽1.9m,高1.9m;最多可容纳约150袋装修垃圾(75cm*45cm每袋)"); | |
| 173 | + } | |
| 174 | + return car; | |
| 175 | + }).collect(Collectors.groupingBy(GarCarInfoVo::getCarType)); | |
| 176 | + | |
| 177 | + List<GarCarInfoVo> carList = new ArrayList<>(); | |
| 178 | + for (Map.Entry<String, List<GarCarInfoVo>> entry : carMap.entrySet()) { | |
| 179 | + if (CollectionUtils.isNotEmpty(entry.getValue())) { | |
| 180 | + Optional<GarCarInfoVo> opt = entry.getValue().stream().filter(car -> Objects.equals(car.getCarEquipment(), "4") || Objects.equals(car.getCarEquipment(), "6") || Objects.equals(car.getCarEquipment(), "8")).findFirst(); | |
| 181 | + if (opt.isPresent()) { | |
| 182 | + carList.add(opt.get()); | |
| 183 | + } else { | |
| 184 | + carList.add(entry.getValue().get(0)); | |
| 185 | + } | |
| 186 | + | |
| 187 | + } | |
| 188 | + } | |
| 189 | + carList = carList.stream().sorted(Comparator.comparing(GarCarInfoVo::convertContainerVolumeDefaultMaxValue)).collect(Collectors.toList()); | |
| 190 | + | |
| 191 | + data.setRows(carList); | |
| 192 | + } | |
| 193 | + | |
| 194 | + return data; | |
| 195 | + } | |
| 196 | + | |
| 197 | + private void saveOrUpdateCarInfoAndDriver(List<GarCarInfoVo> carInfoVos) { | |
| 198 | + if (CollectionUtils.isNotEmpty(carInfoVos)) { | |
| 199 | + new Thread(new Runnable() { | |
| 200 | + @Override | |
| 201 | + public void run() { | |
| 202 | + for (GarCarInfoVo vo : carInfoVos) { | |
| 203 | + try { | |
| 204 | + CarInfo carInfo = carInfoServiceImpl.selectCarInfoByIdStr(vo.getId()); | |
| 205 | + CarInfo ci = new CarInfo(); | |
| 206 | + ci.setId(vo.getId()); | |
| 207 | + ci.setCarBrank(vo.getCarBrank()); | |
| 208 | + ci.setCarCode(vo.getCarCode()); | |
| 209 | + ci.setCarCode(vo.getCarCode()); | |
| 210 | + ci.setCarIdentification(vo.getCarIdentification()); | |
| 211 | + ci.setCarType(vo.getCarType()); | |
| 212 | + ci.setCompanyId(vo.getCompanyId()); | |
| 213 | + ci.setContainerVolume(vo.getContainerVolume()); | |
| 214 | + ci.setEmissionStandard(vo.getEmissionStandard()); | |
| 215 | + ci.setFarmeNumber(vo.getFarmeNumber()); | |
| 216 | + ci.setId(vo.getId()); | |
| 217 | + ci.setStatus(vo.getStatus()); | |
| 218 | + ci.setRoadTransportDate(vo.getRoadTransportDate()); | |
| 219 | + ci.setEnterDate(vo.getEnterDate()); | |
| 220 | + | |
| 221 | + | |
| 222 | + if (Objects.isNull(carInfo)) { | |
| 223 | + carInfoServiceImpl.save(ci); | |
| 224 | + } else { | |
| 225 | + CarInfo source = new CarInfo(); | |
| 226 | + source.setCarBrank(carInfo.getCarBrank()); | |
| 227 | + source.setCarCode(carInfo.getCarCode()); | |
| 228 | + source.setCarCode(carInfo.getCarCode()); | |
| 229 | + source.setCarIdentification(carInfo.getCarIdentification()); | |
| 230 | + source.setCarType(carInfo.getCarType()); | |
| 231 | + source.setCompanyId(carInfo.getCompanyId()); | |
| 232 | + source.setContainerVolume(carInfo.getContainerVolume()); | |
| 233 | + source.setEmissionStandard(carInfo.getEmissionStandard()); | |
| 234 | + source.setFarmeNumber(carInfo.getFarmeNumber()); | |
| 235 | + source.setId(carInfo.getId()); | |
| 236 | + source.setStatus(carInfo.getStatus()); | |
| 237 | + source.setRoadTransportDate(carInfo.getRoadTransportDate()); | |
| 238 | + source.setEnterDate(carInfo.getEnterDate()); | |
| 239 | + | |
| 240 | + if (!StringUtils.equals(JSON.toJSONString(source), JSON.toJSONString(ci))) { | |
| 241 | + carInfoServiceImpl.updateById(ci); | |
| 242 | + } | |
| 243 | + } | |
| 244 | + | |
| 245 | + if (CollectionUtils.isNotEmpty(vo.getDriverVoList())) { | |
| 246 | + for (DriverVo driverVo : vo.getDriverVoList()) { | |
| 247 | + Driver driver = new Driver(); | |
| 248 | + driver.setId(driverVo.getId()); | |
| 249 | + driver.setCompanyId(vo.getCompanyId()); | |
| 250 | + driver.setName(driverVo.getName()); | |
| 251 | + driver.setPhoneNo(driverVo.getPhoneNo()); | |
| 252 | + driver.setStatus(1); | |
| 253 | + | |
| 254 | + Driver source = driverService.selectDriverById(driver.getId()); | |
| 255 | + if (Objects.isNull(source)) { | |
| 256 | + driverService.save(driver,ci.getId()); | |
| 257 | + }else{ | |
| 258 | + Driver source1 = new Driver(); | |
| 259 | + source1.setId(source.getId()); | |
| 260 | + source1.setCompanyId(source.getCompanyId()); | |
| 261 | + source1.setName(source.getName()); | |
| 262 | + source1.setPhoneNo(source.getPhoneNo()); | |
| 263 | + source1.setStatus(source.getStatus()); | |
| 264 | + | |
| 265 | + if(!StringUtils.equals(JSON.toJSONString(source1),JSON.toJSONString(driver))){ | |
| 266 | + driverService.updateById(driver,ci.getId()); | |
| 267 | + } | |
| 268 | + } | |
| 269 | + } | |
| 270 | + } | |
| 271 | + | |
| 272 | + } catch (Exception e) { | |
| 273 | + log.error(e.getMessage(),e); | |
| 274 | + } | |
| 275 | + } | |
| 276 | + } | |
| 277 | + }).start(); | |
| 278 | + } | |
| 279 | + } | |
| 280 | + | |
| 281 | + /** | |
| 282 | + * 响应请求分页数据 | |
| 283 | + */ | |
| 284 | + @SuppressWarnings({"rawtypes", "unchecked"}) | |
| 285 | + protected TableDataInfo getDataTable(List<?> list) { | |
| 286 | + TableDataInfo rspData = new TableDataInfo(); | |
| 287 | + rspData.setCode(HttpStatus.SUCCESS); | |
| 288 | + rspData.setMsg("查询成功"); | |
| 289 | + rspData.setRows(list); | |
| 290 | + rspData.setTotal(new PageInfo(list).getTotal()); | |
| 291 | + return rspData; | |
| 292 | + } | |
| 293 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageCarController.java
0 → 100644
| 1 | +package com.trash.garbage.controller; | |
| 2 | + | |
| 3 | +import com.trash.common.annotation.Log; | |
| 4 | +import com.trash.common.core.domain.AjaxResult; | |
| 5 | +import com.trash.common.enums.BusinessType; | |
| 6 | +import com.trash.garbage.global.Result; | |
| 7 | +import com.trash.garbage.pojo.domain.DockingQRCodeEntity; | |
| 8 | +import com.trash.garbage.pojo.dto.DockingQRCodeDTO; | |
| 9 | +import com.trash.garbage.pojo.dto.OrderDto; | |
| 10 | +import com.trash.garbage.service.GarOrderService; | |
| 11 | +import lombok.extern.slf4j.Slf4j; | |
| 12 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 13 | +import org.springframework.validation.BindingResult; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 16 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 17 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 18 | +import org.springframework.web.bind.annotation.RestController; | |
| 19 | + | |
| 20 | +import java.util.List; | |
| 21 | + | |
| 22 | +@RestController | |
| 23 | +@RequestMapping("/car/order") | |
| 24 | +@Slf4j | |
| 25 | +public class GarbageCarController { | |
| 26 | + @Autowired | |
| 27 | + private GarOrderService garOrderService; | |
| 28 | + | |
| 29 | + @PostMapping("/processing") | |
| 30 | + public Result<?> saveOrder(@Validated @RequestBody DockingQRCodeDTO dto, BindingResult bindingResult) { | |
| 31 | + if (bindingResult.hasErrors()) { | |
| 32 | + return Result.ERROR(bindingResult.getFieldError().getDefaultMessage()); | |
| 33 | + } | |
| 34 | + List<DockingQRCodeEntity> entities = garOrderService.queryReportByCarCode(dto.getCarCode()); | |
| 35 | + | |
| 36 | + return Result.OK(entities); | |
| 37 | + } | |
| 38 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java
| 1 | 1 | package com.trash.garbage.controller; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import cn.hutool.core.convert.Convert; | |
| 5 | +import cn.hutool.http.HttpRequest; | |
| 6 | +import com.alibaba.fastjson.JSON; | |
| 4 | 7 | import com.github.pagehelper.PageHelper; |
| 8 | +import com.trash.carInfo.domain.vo.CarInfoVo; | |
| 5 | 9 | import com.trash.common.annotation.Log; |
| 6 | 10 | import com.trash.common.config.trashConfig; |
| 7 | 11 | import com.trash.common.core.domain.AjaxResult; |
| ... | ... | @@ -13,6 +17,7 @@ import com.trash.common.enums.BusinessType; |
| 13 | 17 | import com.trash.common.utils.ServletUtils; |
| 14 | 18 | import com.trash.common.utils.StringUtils; |
| 15 | 19 | import com.trash.common.utils.file.FileUploadUtils; |
| 20 | +import com.trash.common.utils.file.FileUtils; | |
| 16 | 21 | import com.trash.common.utils.poi.ExcelUtil; |
| 17 | 22 | import com.trash.common.utils.sql.SqlUtil; |
| 18 | 23 | import com.trash.enterprise.domain.TransportationEnterprise; |
| ... | ... | @@ -37,11 +42,10 @@ import org.springframework.validation.annotation.Validated; |
| 37 | 42 | import org.springframework.web.bind.annotation.*; |
| 38 | 43 | import org.springframework.web.multipart.MultipartFile; |
| 39 | 44 | |
| 45 | +import javax.servlet.http.HttpServletRequest; | |
| 46 | +import javax.servlet.http.HttpServletResponse; | |
| 40 | 47 | import java.io.IOException; |
| 41 | -import java.util.HashMap; | |
| 42 | -import java.util.List; | |
| 43 | -import java.util.Map; | |
| 44 | -import java.util.Objects; | |
| 48 | +import java.util.*; | |
| 45 | 49 | |
| 46 | 50 | /** |
| 47 | 51 | * 订单控制 |
| ... | ... | @@ -86,20 +90,25 @@ public class GarbageOrderController { |
| 86 | 90 | } |
| 87 | 91 | |
| 88 | 92 | |
| 89 | - @RequestMapping("upload") | |
| 93 | + @RequestMapping("/upload") | |
| 90 | 94 | public Result<?> uploadFile(@RequestParam("file") MultipartFile file) { |
| 95 | + log.info("上传文件"); | |
| 91 | 96 | String fileName = null; |
| 92 | 97 | try { // 上传文件路径 |
| 93 | 98 | String filePath = trashConfig.getUploadPath(); |
| 94 | 99 | // 上传并返回新文件名称 |
| 95 | 100 | fileName = FileUploadUtils.upload(filePath, file); |
| 96 | 101 | } catch (IOException e) { |
| 102 | + e.printStackTrace(); | |
| 103 | + System.out.println("上传文件失败"); | |
| 104 | + log.error("上传文件失败,请稍后再试",e); | |
| 97 | 105 | throw new BizException(ResultCode.CODE_400, ResultCode.CODE_400.getMsg()); |
| 98 | 106 | } |
| 99 | 107 | String url = serverConfig.getUrl() + fileName; |
| 100 | 108 | Map<String, String> urlMap = new HashMap<>(); |
| 101 | 109 | urlMap.put("url", url); |
| 102 | 110 | urlMap.put("fileName", fileName); |
| 111 | + log.info("上传文件完成"); | |
| 103 | 112 | return Result.OK(urlMap, "图片上传成功"); |
| 104 | 113 | } |
| 105 | 114 | |
| ... | ... | @@ -171,6 +180,12 @@ public class GarbageOrderController { |
| 171 | 180 | return Result.OK(garOrderService.queryDispatch(orderId)); |
| 172 | 181 | } |
| 173 | 182 | |
| 183 | + @GetMapping("/queryDispatch/dss/{orderId}") | |
| 184 | + public Result<?> queryDispatchDss(@PathVariable("orderId") String orderId) { | |
| 185 | + | |
| 186 | + return Result.OK(garOrderService.queryDispatch(orderId)); | |
| 187 | + } | |
| 188 | + | |
| 174 | 189 | @GetMapping("/queryDisposalDispatch/{orderId}") |
| 175 | 190 | public Result<?> queryDisposalDispatch(@PathVariable("orderId") String orderId) { |
| 176 | 191 | return Result.OK(garOrderService.queryDisposalDispatch(orderId)); |
| ... | ... | @@ -193,10 +208,32 @@ public class GarbageOrderController { |
| 193 | 208 | @PreAuthorize("@ss.hasPermi('garbage:order:export')") |
| 194 | 209 | @Log(title = "清运订单", businessType = BusinessType.EXPORT) |
| 195 | 210 | @GetMapping("/export") |
| 196 | - public AjaxResult export(GarOrder garOrder) { | |
| 211 | + public AjaxResult export(GarOrder garOrder, HttpServletResponse response, HttpServletRequest request) { | |
| 197 | 212 | List<GarOrder> list = garOrderService.queryOrderListByGarOrder(garOrder); |
| 198 | 213 | ExcelUtil<GarOrder> util = new ExcelUtil<GarOrder>(GarOrder.class); |
| 199 | - return util.exportExcel(list, "order"); | |
| 214 | + AjaxResult ajaxResult = util.exportExcel(list, "order"); | |
| 215 | + | |
| 216 | + return ajaxResult; | |
| 217 | +// try | |
| 218 | +// { | |
| 219 | +// String fileName = String.valueOf(ajaxResult.get(AjaxResult.MSG_TAG)); | |
| 220 | +// if (!FileUtils.isValidFilename(fileName)) | |
| 221 | +// { | |
| 222 | +// throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName)); | |
| 223 | +// } | |
| 224 | +// String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); | |
| 225 | +// String filePath = trashConfig.getDownloadPath() + fileName; | |
| 226 | +// | |
| 227 | +// response.setCharacterEncoding("utf-8"); | |
| 228 | +// response.setContentType("multipart/form-data"); | |
| 229 | +// response.setHeader("Content-Disposition", | |
| 230 | +// "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName)); | |
| 231 | +// FileUtils.writeBytes(filePath, response.getOutputStream()); | |
| 232 | +// } | |
| 233 | +// catch (Exception e) | |
| 234 | +// { | |
| 235 | +// log.error("下载文件失败", e); | |
| 236 | +// } | |
| 200 | 237 | } |
| 201 | 238 | |
| 202 | 239 | @GetMapping("list") |
| ... | ... | @@ -224,7 +261,7 @@ public class GarbageOrderController { |
| 224 | 261 | SysUser user = loginUser.getUser(); |
| 225 | 262 | if (Objects.nonNull(user)) { |
| 226 | 263 | if (Objects.equals(dto.getUserTypeValue(), 2)) { |
| 227 | - Long id = garOrderService.queryCarIdOfDriver(user.getPhonenumber()); | |
| 264 | + String id = garOrderService.queryCarIdOfDriver(user.getPhonenumber()); | |
| 228 | 265 | dto.setId(id); |
| 229 | 266 | } else if (Objects.equals(dto.getUserTypeValue(), 3)) { |
| 230 | 267 | dto.setServicePhone(user.getPhonenumber()); |
| ... | ... | @@ -237,6 +274,26 @@ public class GarbageOrderController { |
| 237 | 274 | return Result.OK(garOrderService.queryEnterpriseList(dto)); |
| 238 | 275 | } |
| 239 | 276 | |
| 277 | + @GetMapping("/docking/up/company") | |
| 278 | + public Result<?> dockingUpCompany(TransportationEnterprise dto){ | |
| 279 | + if (ArrayUtils.contains(USER_TYP_SELF_COMPANY, dto.getUserTypeValue())) { | |
| 280 | + LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); | |
| 281 | + if (Objects.nonNull(loginUser)) { | |
| 282 | + SysUser user = loginUser.getUser(); | |
| 283 | + if (Objects.nonNull(user)) { | |
| 284 | +// if (Objects.equals(dto.getUserTypeValue(), 2)) { | |
| 285 | +// Long id = garOrderService.queryCarIdOfDriver(user.getPhonenumber()); | |
| 286 | +// dto.setId(id); | |
| 287 | +// } else if (Objects.equals(dto.getUserTypeValue(), 3)) { | |
| 288 | +// dto.setServicePhone(user.getPhonenumber()); | |
| 289 | +// } | |
| 290 | + dto.setServicePhone(user.getPhonenumber()); | |
| 291 | + } | |
| 292 | + } | |
| 293 | + } | |
| 294 | + return Result.OK(garOrderService.dockingUpEnterpriseList(dto)); | |
| 295 | + } | |
| 296 | + | |
| 240 | 297 | @GetMapping("/search/history") |
| 241 | 298 | public Result<?> querySearchHistory() { |
| 242 | 299 | return Result.OK(garOrderService.querySearchHistory()); |
| ... | ... | @@ -247,6 +304,8 @@ public class GarbageOrderController { |
| 247 | 304 | return Result.OK(garOrderService.queryBadgeByType(type)); |
| 248 | 305 | } |
| 249 | 306 | |
| 307 | + | |
| 308 | + | |
| 250 | 309 | protected void startPage() { |
| 251 | 310 | PageDomain pageDomain = TableSupport.buildPageRequest(); |
| 252 | 311 | Integer pageNum = pageDomain.getPageNum(); | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/controller/Test.java
0 → 100644
| 1 | +package com.trash.garbage.controller; | |
| 2 | + | |
| 3 | +import cn.hutool.http.HttpRequest; | |
| 4 | +import cn.hutool.http.HttpResponse; | |
| 5 | +import cn.hutool.http.HttpUtil; | |
| 6 | +import cn.hutool.http.Method; | |
| 7 | +import com.alibaba.fastjson.JSON; | |
| 8 | +import org.apache.commons.collections4.MapUtils; | |
| 9 | +import org.apache.commons.lang3.StringUtils; | |
| 10 | +import org.apache.http.client.HttpClient; | |
| 11 | +import org.apache.http.client.methods.CloseableHttpResponse; | |
| 12 | +import org.apache.http.client.methods.HttpGet; | |
| 13 | +import org.apache.http.client.methods.HttpPost; | |
| 14 | +import org.apache.http.client.utils.HttpClientUtils; | |
| 15 | +import org.apache.http.entity.StringEntity; | |
| 16 | +import org.apache.http.impl.client.CloseableHttpClient; | |
| 17 | +import org.apache.http.impl.client.DefaultHttpClient; | |
| 18 | +import org.apache.http.impl.client.HttpClients; | |
| 19 | +import org.apache.http.util.EntityUtils; | |
| 20 | + | |
| 21 | +import java.io.IOException; | |
| 22 | +import java.io.UnsupportedEncodingException; | |
| 23 | +import java.util.HashMap; | |
| 24 | +import java.util.Map; | |
| 25 | + | |
| 26 | +public class Test { | |
| 27 | + public static void main(String[] args) { | |
| 28 | + String json = null; | |
| 29 | + String url = "http://127.0.0.1:8100/dss/keybox/yarnCabinetState/page"; | |
| 30 | + String authorization = "eyJhbGciOiJIUzUxMiJ9.eyJlcXVpcG1lbnRfa2V5IjoiMTExYzNiMzUtYWM1Yy00Mjc3LWE1NDgtYzU5NTkwNzRmMzc5In0.VDAyrdtPOLkn4nV7TG-9sACHZk1dL5ynSW7nBsMrxUyBUO5NdGB2ifb5rffBbEk4VFSiqen5nc7IIsjQ5kUgzA"; | |
| 31 | + try { | |
| 32 | + Map<String, Object> params = new HashMap<>(); | |
| 33 | + params.put("device", "111111"); | |
| 34 | + params.put("pageSize", 10); | |
| 35 | + params.put("pageNum", 1); | |
| 36 | + | |
| 37 | + Map<String,String> headMap = new HashMap<>(); | |
| 38 | + headMap.put("Authorization",authorization); | |
| 39 | + headMap.put("Content-Type","application/json"); | |
| 40 | + | |
| 41 | + | |
| 42 | + json =doPost(url,headMap,JSON.toJSONString(params)); | |
| 43 | + | |
| 44 | + System.out.println(json); | |
| 45 | + } catch (Exception e) { | |
| 46 | + e.printStackTrace(); | |
| 47 | + } | |
| 48 | + } | |
| 49 | + | |
| 50 | + public static String doPost(String url, Map<String, String> headers, String body) throws IOException { | |
| 51 | + HttpPost post = new HttpPost(url); | |
| 52 | + CloseableHttpClient client = HttpClients.createDefault(); | |
| 53 | + if (MapUtils.isNotEmpty(headers)) { | |
| 54 | + for (Map.Entry<String, String> entry : headers.entrySet()) { | |
| 55 | + post.addHeader(entry.getKey(), entry.getValue()); | |
| 56 | + } | |
| 57 | + } | |
| 58 | + | |
| 59 | + if (StringUtils.isNotEmpty(body)) { | |
| 60 | + post.setEntity(new StringEntity(body)); | |
| 61 | + } | |
| 62 | + CloseableHttpResponse response = client.execute(post); | |
| 63 | + if (response.getStatusLine().getStatusCode() == 200) { | |
| 64 | + String content = EntityUtils.toString(response.getEntity()); | |
| 65 | + | |
| 66 | + System.out.println(content); | |
| 67 | + return content; | |
| 68 | + } | |
| 69 | + return null; | |
| 70 | + } | |
| 71 | + | |
| 72 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderEvaluateMapper.java
| ... | ... | @@ -15,7 +15,7 @@ import java.util.List; |
| 15 | 15 | */ |
| 16 | 16 | public interface GarOrderEvaluateMapper extends BaseMapper<GarOrderEvaluate> { |
| 17 | 17 | |
| 18 | - List<GarOrderEvaluate> queryEvaluateByEnterpriseIds(@Param("list") List<Long> enterpriseIds, @Param("type") Integer value); | |
| 18 | + List<GarOrderEvaluate> queryEvaluateByEnterpriseIds(@Param("list") List<String> enterpriseIds, @Param("type") Integer value); | |
| 19 | 19 | |
| 20 | 20 | List<GarOrderEvaluate> countIdGroupByOrderId(@Param("list") Collection<String> orderIds,@Param("type") Integer type); |
| 21 | 21 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMapper.java
| 1 | 1 | package com.trash.garbage.mapper; |
| 2 | 2 | |
| 3 | +import com.trash.garbage.pojo.domain.DockingQRCodeEntity; | |
| 3 | 4 | import com.trash.garbage.pojo.domain.GarOrder; |
| 4 | 5 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | 6 | import com.trash.garbage.pojo.vo.GarOrderDisposalVo; |
| ... | ... | @@ -18,7 +19,7 @@ import java.util.List; |
| 18 | 19 | */ |
| 19 | 20 | public interface GarOrderMapper extends BaseMapper<GarOrder> { |
| 20 | 21 | |
| 21 | - List<GarOrder> queryCleanNumberByEnterpriseIds(@Param("list") List<Long> list,@Param("status") Integer value); | |
| 22 | + List<GarOrder> queryCleanNumberByEnterpriseIds(@Param("list") List<String> list,@Param("status") Integer value); | |
| 22 | 23 | |
| 23 | 24 | List<GarOrderDriverVo> queryDriverOrderListByTelWithType(@Param("garUserTel") String garUserTel, @Param("type") Integer type, @Param("cancelFlag") Integer cancelFlag); |
| 24 | 25 | |
| ... | ... | @@ -38,7 +39,9 @@ public interface GarOrderMapper extends BaseMapper<GarOrder> { |
| 38 | 39 | |
| 39 | 40 | Integer queryDisposalOrderListByTelWithTypeCount(@Param("garUserTel") String garUserTel, @Param("type") Integer type, @Param("cancelFlag") Integer value); |
| 40 | 41 | |
| 41 | - Long queryCompanyIdByPhone(@Param("phone")String phone); | |
| 42 | + String queryCompanyIdByPhone(@Param("phone")String phone); | |
| 43 | + | |
| 44 | + List<DockingQRCodeEntity> queryReportByCarCode(@Param("carCode") String carCode); | |
| 42 | 45 | } |
| 43 | 46 | |
| 44 | 47 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMatchHandlerMapper.java
| ... | ... | @@ -17,7 +17,9 @@ import java.util.Set; |
| 17 | 17 | */ |
| 18 | 18 | public interface GarOrderMatchHandlerMapper extends BaseMapper<GarOrderMatchHandler> { |
| 19 | 19 | |
| 20 | - List<DispatchDriverVo> queryDriverListWithDispatchStatus(@Param("orderId") String orderId, @Param("companyId") Long id,@Param("containerVolumees") Set<String> containerVolumees); | |
| 20 | + List<DispatchDriverVo> queryDriverListWithDispatchStatus(@Param("orderId") String orderId, @Param("companyId") String id,@Param("containerVolumees") Set<String> containerVolumees); | |
| 21 | + | |
| 22 | + List<GarOrderMatchHandler> queryGarOrderMatchHandler(@Param("orderId") String orderId); | |
| 21 | 23 | } |
| 22 | 24 | |
| 23 | 25 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/DockingQRCodeEntity.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.domain; | |
| 2 | + | |
| 3 | +public class DockingQRCodeEntity implements java.io.Serializable { | |
| 4 | + | |
| 5 | + private String garOrderAddress;//订单所属区域 | |
| 6 | + private String garOrderAddressDetails;//订单详细地址 | |
| 7 | + private String garOrderAgreementTime;//订单预约时间 | |
| 8 | + private String garUserName;//下单用户名 | |
| 9 | + private String garUserTel;//下单用户手机号 | |
| 10 | + private String containerVolume;//运输量 单位方 | |
| 11 | + private String dsAddress;//场地地址 | |
| 12 | + private String dsLocalArea;//场地所属区域 | |
| 13 | + private String dsName;//处置场所名称 | |
| 14 | + | |
| 15 | + | |
| 16 | + public String getGarOrderAddress() { | |
| 17 | + return garOrderAddress; | |
| 18 | + } | |
| 19 | + | |
| 20 | + public void setGarOrderAddress(String garOrderAddress) { | |
| 21 | + this.garOrderAddress = garOrderAddress; | |
| 22 | + } | |
| 23 | + | |
| 24 | + public String getGarOrderAddressDetails() { | |
| 25 | + return garOrderAddressDetails; | |
| 26 | + } | |
| 27 | + | |
| 28 | + public void setGarOrderAddressDetails(String garOrderAddressDetails) { | |
| 29 | + this.garOrderAddressDetails = garOrderAddressDetails; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public String getGarOrderAgreementTime() { | |
| 33 | + return garOrderAgreementTime; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public void setGarOrderAgreementTime(String garOrderAgreementTime) { | |
| 37 | + this.garOrderAgreementTime = garOrderAgreementTime; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public String getGarUserName() { | |
| 41 | + return garUserName; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public void setGarUserName(String garUserName) { | |
| 45 | + this.garUserName = garUserName; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public String getGarUserTel() { | |
| 49 | + return garUserTel; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public void setGarUserTel(String garUserTel) { | |
| 53 | + this.garUserTel = garUserTel; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public String getContainerVolume() { | |
| 57 | + return containerVolume; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setContainerVolume(String containerVolume) { | |
| 61 | + this.containerVolume = containerVolume; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public String getDsAddress() { | |
| 65 | + return dsAddress; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setDsAddress(String dsAddress) { | |
| 69 | + this.dsAddress = dsAddress; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public String getDsLocalArea() { | |
| 73 | + return dsLocalArea; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setDsLocalArea(String dsLocalArea) { | |
| 77 | + this.dsLocalArea = dsLocalArea; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public String getDsName() { | |
| 81 | + return dsName; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setDsName(String dsName) { | |
| 85 | + this.dsName = dsName; | |
| 86 | + } | |
| 87 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrder.java
| ... | ... | @@ -6,31 +6,35 @@ import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | 7 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 8 | 8 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 9 | +import com.trash.common.annotation.Excel; | |
| 9 | 10 | import lombok.Data; |
| 10 | 11 | import org.springframework.format.annotation.DateTimeFormat; |
| 11 | 12 | |
| 12 | 13 | import java.io.Serializable; |
| 13 | 14 | import java.util.Date; |
| 15 | +import java.util.Objects; | |
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * 建筑垃圾—订单表 |
| 19 | + * | |
| 17 | 20 | * @TableName gar_order |
| 18 | 21 | */ |
| 19 | -@TableName(value ="gar_order") | |
| 22 | +@TableName(value = "gar_order") | |
| 20 | 23 | @Data |
| 21 | 24 | public class GarOrder implements Serializable { |
| 22 | 25 | /** |
| 23 | 26 | * 订单id |
| 24 | 27 | */ |
| 25 | 28 | @TableId |
| 29 | + @Excel(name = "订单号") | |
| 26 | 30 | private String garOrderId; |
| 27 | 31 | |
| 28 | - /** | |
| 29 | - * 新增的一列数据 用于存储count字段 | |
| 30 | - * 注解非常关键 | |
| 31 | - */ | |
| 32 | - @TableField(exist = false) | |
| 33 | - private Long count; | |
| 32 | + /** | |
| 33 | + * 新增的一列数据 用于存储count字段 | |
| 34 | + * 注解非常关键 | |
| 35 | + */ | |
| 36 | + @TableField(exist = false) | |
| 37 | + private Long count; | |
| 34 | 38 | |
| 35 | 39 | /** |
| 36 | 40 | * 用户id |
| ... | ... | @@ -39,24 +43,28 @@ public class GarOrder implements Serializable { |
| 39 | 43 | private String garOrderUserId; |
| 40 | 44 | |
| 41 | 45 | |
| 42 | - /** | |
| 46 | + /** | |
| 43 | 47 | * 订单地址 |
| 44 | 48 | */ |
| 49 | + @Excel(name = "订单地址") | |
| 45 | 50 | private String garOrderAddress; |
| 46 | 51 | |
| 47 | 52 | /** |
| 48 | 53 | * 订单详细地址 |
| 49 | 54 | */ |
| 55 | + @Excel(name = "订单详细地址") | |
| 50 | 56 | private String garOrderAddressDetails; |
| 51 | 57 | |
| 52 | 58 | /** |
| 53 | 59 | * 订单姓名 |
| 54 | 60 | */ |
| 61 | + @Excel(name = "用户姓名") | |
| 55 | 62 | private String garOrderContactName; |
| 56 | 63 | |
| 57 | 64 | /** |
| 58 | 65 | * 垃圾类型 |
| 59 | 66 | */ |
| 67 | + @Excel(name = "垃圾类型") | |
| 60 | 68 | private String garOrderTrashType; |
| 61 | 69 | private String garOrderCompanyUserId; |
| 62 | 70 | |
| ... | ... | @@ -64,6 +72,7 @@ public class GarOrder implements Serializable { |
| 64 | 72 | /** |
| 65 | 73 | * 订单人电话 |
| 66 | 74 | */ |
| 75 | + @Excel(name = "订单人电话") | |
| 67 | 76 | private String garOrderContactTel; |
| 68 | 77 | |
| 69 | 78 | /** |
| ... | ... | @@ -74,22 +83,28 @@ public class GarOrder implements Serializable { |
| 74 | 83 | /** |
| 75 | 84 | * 公司名称 |
| 76 | 85 | */ |
| 86 | + @Excel(name = "经营单位") | |
| 77 | 87 | private String garOrderCompanyName; |
| 78 | 88 | |
| 79 | 89 | /** |
| 80 | 90 | * 公司负责人电话 |
| 81 | 91 | */ |
| 92 | + @Excel(name = "公司负责人电话") | |
| 82 | 93 | private String garOrderCompanyTel; |
| 83 | 94 | |
| 84 | 95 | /** |
| 85 | 96 | * 处理状态 |
| 86 | 97 | */ |
| 98 | + | |
| 87 | 99 | private Integer garOrderHandlerStatus; |
| 100 | + @Excel(name = "处理状态") | |
| 101 | + @TableField(exist = false) | |
| 102 | + private String garOrderHandlerStatusStr; | |
| 88 | 103 | |
| 89 | - /** | |
| 90 | - * 实际派发车辆 | |
| 91 | - */ | |
| 92 | - private Integer garRealCarCount; | |
| 104 | + /** | |
| 105 | + * 实际派发车辆 | |
| 106 | + */ | |
| 107 | + private Integer garRealCarCount; | |
| 93 | 108 | |
| 94 | 109 | /** |
| 95 | 110 | * 约定时间 |
| ... | ... | @@ -127,358 +142,373 @@ public class GarOrder implements Serializable { |
| 127 | 142 | /** |
| 128 | 143 | * 备注 |
| 129 | 144 | */ |
| 145 | + @Excel(name = "备注") | |
| 130 | 146 | private String garRemark; |
| 131 | 147 | /** |
| 132 | 148 | * 取消标识 |
| 133 | 149 | */ |
| 134 | 150 | private Integer garCancelFlag; |
| 151 | + @Excel(name = "是否取消") | |
| 152 | + @TableField(exist = false) | |
| 153 | + private String garCancelFlagStr; | |
| 135 | 154 | |
| 136 | - /** | |
| 137 | - * 分配标识 | |
| 138 | - */ | |
| 139 | - private Integer garOrderScanHandlerFlag; | |
| 155 | + /** | |
| 156 | + * 分配标识 | |
| 157 | + */ | |
| 158 | + private Integer garOrderScanHandlerFlag; | |
| 140 | 159 | |
| 141 | - /** | |
| 142 | - * 经度 | |
| 143 | - */ | |
| 144 | - private Double garLongitude; | |
| 160 | + /** | |
| 161 | + * 经度 | |
| 162 | + */ | |
| 163 | + private Double garLongitude; | |
| 145 | 164 | |
| 146 | - /** | |
| 147 | - * 纬度 | |
| 148 | - */ | |
| 149 | - private Double garLatitude; | |
| 165 | + /** | |
| 166 | + * 纬度 | |
| 167 | + */ | |
| 168 | + private Double garLatitude; | |
| 150 | 169 | |
| 151 | - private String garCoordinate; | |
| 170 | + private String garCoordinate; | |
| 152 | 171 | |
| 153 | - private Boolean garInCarStore; | |
| 172 | + private Boolean garInCarStore; | |
| 154 | 173 | |
| 155 | - /** | |
| 174 | + /** | |
| 156 | 175 | * 评分标识 |
| 157 | 176 | */ |
| 158 | - private Integer garEvaluateFlag; | |
| 159 | - /** | |
| 160 | - * 处理人评分标识 | |
| 161 | - */ | |
| 162 | - private Integer garHandlerEvaluateFlag; | |
| 177 | + private Integer garEvaluateFlag; | |
| 178 | + /** | |
| 179 | + * 处理人评分标识 | |
| 180 | + */ | |
| 181 | + private Integer garHandlerEvaluateFlag; | |
| 163 | 182 | |
| 164 | 183 | |
| 165 | - /** | |
| 184 | + /** | |
| 166 | 185 | * 原因 |
| 167 | 186 | */ |
| 168 | 187 | private String garReason; |
| 169 | 188 | |
| 170 | - private Integer garTimeOutFlag; | |
| 171 | - | |
| 172 | - private String garEstimatedCost; | |
| 189 | + private Integer garTimeOutFlag; | |
| 173 | 190 | |
| 174 | - /** | |
| 175 | - * 是否有用户的评价,默认值是0,默认没有 | |
| 176 | - * | |
| 177 | - * @author liujun | |
| 178 | - * @date 2024/6/20 14:39 | |
| 179 | - */ | |
| 180 | - @TableField(exist = false) | |
| 181 | - private Integer haveEvaluateOfClient = 0; | |
| 191 | + private String garEstimatedCost; | |
| 182 | 192 | |
| 193 | + /** | |
| 194 | + * 是否有用户的评价,默认值是0,默认没有 | |
| 195 | + * | |
| 196 | + * @author liujun | |
| 197 | + * @date 2024/6/20 14:39 | |
| 198 | + */ | |
| 199 | + @TableField(exist = false) | |
| 200 | + private Integer haveEvaluateOfClient = 0; | |
| 183 | 201 | |
| 184 | 202 | |
| 185 | - @TableField(exist = false) | |
| 203 | + @TableField(exist = false) | |
| 186 | 204 | private static final long serialVersionUID = 1L; |
| 187 | 205 | |
| 188 | 206 | |
| 189 | - public Integer getGarHandlerEvaluateFlag() { | |
| 190 | - return garHandlerEvaluateFlag; | |
| 191 | - } | |
| 207 | + public Integer getGarHandlerEvaluateFlag() { | |
| 208 | + return garHandlerEvaluateFlag; | |
| 209 | + } | |
| 192 | 210 | |
| 193 | - public void setGarHandlerEvaluateFlag(Integer garHandlerEvaluateFlag) { | |
| 194 | - this.garHandlerEvaluateFlag = garHandlerEvaluateFlag; | |
| 195 | - } | |
| 211 | + public void setGarHandlerEvaluateFlag(Integer garHandlerEvaluateFlag) { | |
| 212 | + this.garHandlerEvaluateFlag = garHandlerEvaluateFlag; | |
| 213 | + } | |
| 196 | 214 | |
| 197 | 215 | |
| 198 | - public Integer getGarOrderScanHandlerFlag() { | |
| 199 | - return garOrderScanHandlerFlag; | |
| 200 | - } | |
| 216 | + public Integer getGarOrderScanHandlerFlag() { | |
| 217 | + return garOrderScanHandlerFlag; | |
| 218 | + } | |
| 201 | 219 | |
| 202 | - public void setGarOrderScanHandlerFlag(Integer garOrderScanHandlerFlag) { | |
| 203 | - this.garOrderScanHandlerFlag = garOrderScanHandlerFlag; | |
| 204 | - } | |
| 220 | + public void setGarOrderScanHandlerFlag(Integer garOrderScanHandlerFlag) { | |
| 221 | + this.garOrderScanHandlerFlag = garOrderScanHandlerFlag; | |
| 222 | + } | |
| 205 | 223 | |
| 206 | - public String getGarOrderId() { | |
| 207 | - return garOrderId; | |
| 208 | - } | |
| 224 | + public String getGarOrderId() { | |
| 225 | + return garOrderId; | |
| 226 | + } | |
| 209 | 227 | |
| 210 | 228 | |
| 211 | - public void setGarOrderId(String garOrderId) { | |
| 212 | - this.garOrderId = garOrderId; | |
| 213 | - } | |
| 229 | + public void setGarOrderId(String garOrderId) { | |
| 230 | + this.garOrderId = garOrderId; | |
| 231 | + } | |
| 214 | 232 | |
| 215 | 233 | |
| 216 | - public String getGarOrderUserId() { | |
| 217 | - return garOrderUserId; | |
| 218 | - } | |
| 234 | + public String getGarOrderUserId() { | |
| 235 | + return garOrderUserId; | |
| 236 | + } | |
| 219 | 237 | |
| 220 | 238 | |
| 221 | - public void setGarOrderUserId(String garOrderUserId) { | |
| 222 | - this.garOrderUserId = garOrderUserId; | |
| 223 | - } | |
| 239 | + public void setGarOrderUserId(String garOrderUserId) { | |
| 240 | + this.garOrderUserId = garOrderUserId; | |
| 241 | + } | |
| 224 | 242 | |
| 225 | - public String getGarOrderAddress() { | |
| 226 | - return garOrderAddress; | |
| 227 | - } | |
| 243 | + public String getGarOrderAddress() { | |
| 244 | + return garOrderAddress; | |
| 245 | + } | |
| 228 | 246 | |
| 229 | 247 | |
| 230 | - public void setGarOrderAddress(String garOrderAddress) { | |
| 231 | - this.garOrderAddress = garOrderAddress; | |
| 232 | - } | |
| 248 | + public void setGarOrderAddress(String garOrderAddress) { | |
| 249 | + this.garOrderAddress = garOrderAddress; | |
| 250 | + } | |
| 233 | 251 | |
| 234 | 252 | |
| 235 | - public String getGarOrderAddressDetails() { | |
| 236 | - return garOrderAddressDetails; | |
| 237 | - } | |
| 253 | + public String getGarOrderAddressDetails() { | |
| 254 | + return garOrderAddressDetails; | |
| 255 | + } | |
| 238 | 256 | |
| 239 | 257 | |
| 240 | - public void setGarOrderAddressDetails(String garOrderAddressDetails) { | |
| 241 | - this.garOrderAddressDetails = garOrderAddressDetails; | |
| 242 | - } | |
| 258 | + public void setGarOrderAddressDetails(String garOrderAddressDetails) { | |
| 259 | + this.garOrderAddressDetails = garOrderAddressDetails; | |
| 260 | + } | |
| 243 | 261 | |
| 244 | 262 | |
| 245 | - public String getGarOrderContactName() { | |
| 246 | - return garOrderContactName; | |
| 247 | - } | |
| 263 | + public String getGarOrderContactName() { | |
| 264 | + return garOrderContactName; | |
| 265 | + } | |
| 248 | 266 | |
| 249 | 267 | |
| 250 | - public void setGarOrderContactName(String garOrderContactName) { | |
| 251 | - this.garOrderContactName = garOrderContactName; | |
| 252 | - } | |
| 268 | + public void setGarOrderContactName(String garOrderContactName) { | |
| 269 | + this.garOrderContactName = garOrderContactName; | |
| 270 | + } | |
| 253 | 271 | |
| 254 | 272 | |
| 255 | - public String getGarOrderTrashType() { | |
| 256 | - return garOrderTrashType; | |
| 257 | - } | |
| 273 | + public String getGarOrderTrashType() { | |
| 274 | + return garOrderTrashType; | |
| 275 | + } | |
| 258 | 276 | |
| 259 | 277 | |
| 260 | - public void setGarOrderTrashType(String garOrderTrashType) { | |
| 261 | - this.garOrderTrashType = garOrderTrashType; | |
| 262 | - } | |
| 278 | + public void setGarOrderTrashType(String garOrderTrashType) { | |
| 279 | + this.garOrderTrashType = garOrderTrashType; | |
| 280 | + } | |
| 263 | 281 | |
| 264 | 282 | |
| 265 | - public String getGarOrderContactTel() { | |
| 266 | - return garOrderContactTel; | |
| 267 | - } | |
| 283 | + public String getGarOrderContactTel() { | |
| 284 | + return garOrderContactTel; | |
| 285 | + } | |
| 268 | 286 | |
| 269 | 287 | |
| 270 | - public void setGarOrderContactTel(String garOrderContactTel) { | |
| 271 | - this.garOrderContactTel = garOrderContactTel; | |
| 272 | - } | |
| 288 | + public void setGarOrderContactTel(String garOrderContactTel) { | |
| 289 | + this.garOrderContactTel = garOrderContactTel; | |
| 290 | + } | |
| 273 | 291 | |
| 274 | 292 | |
| 275 | - public String getGarOrderCompanyId() { | |
| 276 | - return garOrderCompanyId; | |
| 277 | - } | |
| 293 | + public String getGarOrderCompanyId() { | |
| 294 | + return garOrderCompanyId; | |
| 295 | + } | |
| 278 | 296 | |
| 279 | 297 | |
| 280 | - public void setGarOrderCompanyId(String garOrderCompanyId) { | |
| 281 | - this.garOrderCompanyId = garOrderCompanyId; | |
| 282 | - } | |
| 298 | + public void setGarOrderCompanyId(String garOrderCompanyId) { | |
| 299 | + this.garOrderCompanyId = garOrderCompanyId; | |
| 300 | + } | |
| 283 | 301 | |
| 284 | 302 | |
| 285 | - public String getGarOrderCompanyName() { | |
| 286 | - return garOrderCompanyName; | |
| 287 | - } | |
| 303 | + public String getGarOrderCompanyName() { | |
| 304 | + return garOrderCompanyName; | |
| 305 | + } | |
| 288 | 306 | |
| 289 | 307 | |
| 290 | - public void setGarOrderCompanyName(String garOrderCompanyName) { | |
| 291 | - this.garOrderCompanyName = garOrderCompanyName; | |
| 292 | - } | |
| 308 | + public void setGarOrderCompanyName(String garOrderCompanyName) { | |
| 309 | + this.garOrderCompanyName = garOrderCompanyName; | |
| 310 | + } | |
| 293 | 311 | |
| 294 | 312 | |
| 295 | - public String getGarOrderCompanyTel() { | |
| 296 | - return garOrderCompanyTel; | |
| 297 | - } | |
| 313 | + public String getGarOrderCompanyTel() { | |
| 314 | + return garOrderCompanyTel; | |
| 315 | + } | |
| 298 | 316 | |
| 299 | 317 | |
| 300 | - public void setGarOrderCompanyTel(String garOrderCompanyTel) { | |
| 301 | - this.garOrderCompanyTel = garOrderCompanyTel; | |
| 302 | - } | |
| 318 | + public void setGarOrderCompanyTel(String garOrderCompanyTel) { | |
| 319 | + this.garOrderCompanyTel = garOrderCompanyTel; | |
| 320 | + } | |
| 303 | 321 | |
| 304 | 322 | |
| 305 | - public Integer getGarOrderHandlerStatus() { | |
| 306 | - return garOrderHandlerStatus; | |
| 307 | - } | |
| 323 | + public Integer getGarOrderHandlerStatus() { | |
| 324 | + return garOrderHandlerStatus; | |
| 325 | + } | |
| 308 | 326 | |
| 309 | 327 | |
| 310 | - public void setGarOrderHandlerStatus(Integer garOrderHandlerStatus) { | |
| 311 | - this.garOrderHandlerStatus = garOrderHandlerStatus; | |
| 312 | - } | |
| 328 | + public void setGarOrderHandlerStatus(Integer garOrderHandlerStatus) { | |
| 329 | + this.garOrderHandlerStatus = garOrderHandlerStatus; | |
| 330 | + if (Objects.equals(garOrderHandlerStatus, 0)) { | |
| 331 | + garOrderHandlerStatusStr = "未处理"; | |
| 332 | + } else if (Objects.equals(garOrderHandlerStatus, 1)) { | |
| 333 | + garOrderHandlerStatusStr = "处理中"; | |
| 334 | + } else if (Objects.equals(garOrderHandlerStatus, 3)) { | |
| 335 | + garOrderHandlerStatusStr = "已处理"; | |
| 336 | + } | |
| 337 | + } | |
| 313 | 338 | |
| 314 | 339 | |
| 315 | - public String getGarOrderAgreementTime() { | |
| 316 | - return garOrderAgreementTime; | |
| 317 | - } | |
| 340 | + public String getGarOrderAgreementTime() { | |
| 341 | + return garOrderAgreementTime; | |
| 342 | + } | |
| 318 | 343 | |
| 319 | 344 | |
| 320 | - public void setGarOrderAgreementTime(String garOrderAgreementTime) { | |
| 321 | - this.garOrderAgreementTime = garOrderAgreementTime; | |
| 322 | - } | |
| 345 | + public void setGarOrderAgreementTime(String garOrderAgreementTime) { | |
| 346 | + this.garOrderAgreementTime = garOrderAgreementTime; | |
| 347 | + } | |
| 323 | 348 | |
| 324 | 349 | |
| 325 | - public Date getGarCreateTime() { | |
| 326 | - return garCreateTime; | |
| 327 | - } | |
| 350 | + public Date getGarCreateTime() { | |
| 351 | + return garCreateTime; | |
| 352 | + } | |
| 328 | 353 | |
| 329 | 354 | |
| 330 | - public void setGarCreateTime(Date garCreateTime) { | |
| 331 | - this.garCreateTime = garCreateTime; | |
| 332 | - } | |
| 355 | + public void setGarCreateTime(Date garCreateTime) { | |
| 356 | + this.garCreateTime = garCreateTime; | |
| 357 | + } | |
| 333 | 358 | |
| 334 | 359 | |
| 335 | - public Date getGarUpdateTime() { | |
| 336 | - return garUpdateTime; | |
| 337 | - } | |
| 360 | + public Date getGarUpdateTime() { | |
| 361 | + return garUpdateTime; | |
| 362 | + } | |
| 338 | 363 | |
| 339 | 364 | |
| 340 | - public void setGarUpdateTime(Date garUpdateTime) { | |
| 341 | - this.garUpdateTime = garUpdateTime; | |
| 342 | - } | |
| 365 | + public void setGarUpdateTime(Date garUpdateTime) { | |
| 366 | + this.garUpdateTime = garUpdateTime; | |
| 367 | + } | |
| 343 | 368 | |
| 344 | 369 | |
| 345 | - public String getGarCreateBy() { | |
| 346 | - return garCreateBy; | |
| 347 | - } | |
| 370 | + public String getGarCreateBy() { | |
| 371 | + return garCreateBy; | |
| 372 | + } | |
| 348 | 373 | |
| 349 | 374 | |
| 350 | - public void setGarCreateBy(String garCreateBy) { | |
| 351 | - this.garCreateBy = garCreateBy; | |
| 352 | - } | |
| 375 | + public void setGarCreateBy(String garCreateBy) { | |
| 376 | + this.garCreateBy = garCreateBy; | |
| 377 | + } | |
| 353 | 378 | |
| 354 | 379 | |
| 355 | - public String getGarUpdateBy() { | |
| 356 | - return garUpdateBy; | |
| 357 | - } | |
| 380 | + public String getGarUpdateBy() { | |
| 381 | + return garUpdateBy; | |
| 382 | + } | |
| 358 | 383 | |
| 359 | 384 | |
| 360 | - public void setGarUpdateBy(String garUpdateBy) { | |
| 361 | - this.garUpdateBy = garUpdateBy; | |
| 362 | - } | |
| 385 | + public void setGarUpdateBy(String garUpdateBy) { | |
| 386 | + this.garUpdateBy = garUpdateBy; | |
| 387 | + } | |
| 363 | 388 | |
| 364 | 389 | |
| 365 | - public String getGarRemark() { | |
| 366 | - return garRemark; | |
| 367 | - } | |
| 390 | + public String getGarRemark() { | |
| 391 | + return garRemark; | |
| 392 | + } | |
| 368 | 393 | |
| 369 | 394 | |
| 370 | - public void setGarRemark(String garRemark) { | |
| 371 | - this.garRemark = garRemark; | |
| 372 | - } | |
| 395 | + public void setGarRemark(String garRemark) { | |
| 396 | + this.garRemark = garRemark; | |
| 397 | + } | |
| 373 | 398 | |
| 374 | 399 | |
| 375 | - public Integer getGarCancelFlag() { | |
| 376 | - return garCancelFlag; | |
| 377 | - } | |
| 400 | + public Integer getGarCancelFlag() { | |
| 401 | + return garCancelFlag; | |
| 402 | + } | |
| 378 | 403 | |
| 379 | 404 | |
| 380 | - public void setGarCancelFlag(Integer garCancelFlag) { | |
| 381 | - this.garCancelFlag = garCancelFlag; | |
| 382 | - } | |
| 405 | + public void setGarCancelFlag(Integer garCancelFlag) { | |
| 406 | + this.garCancelFlag = garCancelFlag; | |
| 407 | + if (Objects.equals(0, garCancelFlag)) { | |
| 408 | + this.garCancelFlagStr = "未取消"; | |
| 409 | + } else if (Objects.equals(1, garCancelFlag)) { | |
| 410 | + this.garCancelFlagStr = "已取消"; | |
| 411 | + } | |
| 412 | + } | |
| 383 | 413 | |
| 384 | 414 | |
| 385 | - public Integer getGarEvaluateFlag() { | |
| 386 | - return garEvaluateFlag; | |
| 387 | - } | |
| 415 | + public Integer getGarEvaluateFlag() { | |
| 416 | + return garEvaluateFlag; | |
| 417 | + } | |
| 388 | 418 | |
| 389 | 419 | |
| 390 | - public void setGarEvaluateFlag(Integer garEvaluateFlag) { | |
| 391 | - this.garEvaluateFlag = garEvaluateFlag; | |
| 392 | - } | |
| 420 | + public void setGarEvaluateFlag(Integer garEvaluateFlag) { | |
| 421 | + this.garEvaluateFlag = garEvaluateFlag; | |
| 422 | + } | |
| 393 | 423 | |
| 394 | 424 | |
| 395 | - public String getGarReason() { | |
| 396 | - return garReason; | |
| 397 | - } | |
| 425 | + public String getGarReason() { | |
| 426 | + return garReason; | |
| 427 | + } | |
| 398 | 428 | |
| 399 | 429 | |
| 400 | - public void setGarReason(String garReason) { | |
| 401 | - this.garReason = garReason; | |
| 402 | - } | |
| 430 | + public void setGarReason(String garReason) { | |
| 431 | + this.garReason = garReason; | |
| 432 | + } | |
| 403 | 433 | |
| 404 | - public Long getCount() { | |
| 405 | - return count; | |
| 406 | - } | |
| 434 | + public Long getCount() { | |
| 435 | + return count; | |
| 436 | + } | |
| 407 | 437 | |
| 408 | - public void setCount(Long count) { | |
| 409 | - this.count = count; | |
| 410 | - } | |
| 438 | + public void setCount(Long count) { | |
| 439 | + this.count = count; | |
| 440 | + } | |
| 411 | 441 | |
| 412 | - public Double getGarLongitude() { | |
| 413 | - return garLongitude; | |
| 414 | - } | |
| 442 | + public Double getGarLongitude() { | |
| 443 | + return garLongitude; | |
| 444 | + } | |
| 415 | 445 | |
| 416 | - public void setGarLongitude(Double garLongitude) { | |
| 417 | - this.garLongitude = garLongitude; | |
| 418 | - } | |
| 446 | + public void setGarLongitude(Double garLongitude) { | |
| 447 | + this.garLongitude = garLongitude; | |
| 448 | + } | |
| 419 | 449 | |
| 420 | - public Double getGarLatitude() { | |
| 421 | - return garLatitude; | |
| 422 | - } | |
| 450 | + public Double getGarLatitude() { | |
| 451 | + return garLatitude; | |
| 452 | + } | |
| 423 | 453 | |
| 424 | - public void setGarLatitude(Double garLatitude) { | |
| 425 | - this.garLatitude = garLatitude; | |
| 426 | - } | |
| 454 | + public void setGarLatitude(Double garLatitude) { | |
| 455 | + this.garLatitude = garLatitude; | |
| 456 | + } | |
| 427 | 457 | |
| 428 | - public String getGarCoordinate() { | |
| 429 | - return garCoordinate; | |
| 430 | - } | |
| 458 | + public String getGarCoordinate() { | |
| 459 | + return garCoordinate; | |
| 460 | + } | |
| 431 | 461 | |
| 432 | - public void setGarCoordinate(String garCoordinate) { | |
| 433 | - this.garCoordinate = garCoordinate; | |
| 434 | - } | |
| 462 | + public void setGarCoordinate(String garCoordinate) { | |
| 463 | + this.garCoordinate = garCoordinate; | |
| 464 | + } | |
| 435 | 465 | |
| 436 | - public Integer getGarRealCarCount() { | |
| 437 | - return garRealCarCount; | |
| 438 | - } | |
| 466 | + public Integer getGarRealCarCount() { | |
| 467 | + return garRealCarCount; | |
| 468 | + } | |
| 439 | 469 | |
| 440 | - public void setGarRealCarCount(Integer garRealCarCount) { | |
| 441 | - this.garRealCarCount = garRealCarCount; | |
| 442 | - } | |
| 470 | + public void setGarRealCarCount(Integer garRealCarCount) { | |
| 471 | + this.garRealCarCount = garRealCarCount; | |
| 472 | + } | |
| 443 | 473 | |
| 444 | - public String getGarOrderCompanyUserId() { | |
| 445 | - return garOrderCompanyUserId; | |
| 446 | - } | |
| 474 | + public String getGarOrderCompanyUserId() { | |
| 475 | + return garOrderCompanyUserId; | |
| 476 | + } | |
| 447 | 477 | |
| 448 | - public void setGarOrderCompanyUserId(String garOrderCompanyUserId) { | |
| 449 | - this.garOrderCompanyUserId = garOrderCompanyUserId; | |
| 450 | - } | |
| 478 | + public void setGarOrderCompanyUserId(String garOrderCompanyUserId) { | |
| 479 | + this.garOrderCompanyUserId = garOrderCompanyUserId; | |
| 480 | + } | |
| 451 | 481 | |
| 452 | - public Boolean getGarInCarStore() { | |
| 453 | - return garInCarStore; | |
| 454 | - } | |
| 482 | + public Boolean getGarInCarStore() { | |
| 483 | + return garInCarStore; | |
| 484 | + } | |
| 455 | 485 | |
| 456 | - public void setGarInCarStore(Boolean garInCarStore) { | |
| 457 | - this.garInCarStore = garInCarStore; | |
| 458 | - } | |
| 486 | + public void setGarInCarStore(Boolean garInCarStore) { | |
| 487 | + this.garInCarStore = garInCarStore; | |
| 488 | + } | |
| 459 | 489 | |
| 460 | - public Integer getGarTimeOutFlag() { | |
| 461 | - return garTimeOutFlag; | |
| 462 | - } | |
| 490 | + public Integer getGarTimeOutFlag() { | |
| 491 | + return garTimeOutFlag; | |
| 492 | + } | |
| 463 | 493 | |
| 464 | - public void setGarTimeOutFlag(Integer garTimeOutFlag) { | |
| 465 | - this.garTimeOutFlag = garTimeOutFlag; | |
| 466 | - } | |
| 494 | + public void setGarTimeOutFlag(Integer garTimeOutFlag) { | |
| 495 | + this.garTimeOutFlag = garTimeOutFlag; | |
| 496 | + } | |
| 467 | 497 | |
| 468 | 498 | |
| 469 | - public Integer getHaveEvaluateOfClient() { | |
| 470 | - return haveEvaluateOfClient; | |
| 471 | - } | |
| 499 | + public Integer getHaveEvaluateOfClient() { | |
| 500 | + return haveEvaluateOfClient; | |
| 501 | + } | |
| 472 | 502 | |
| 473 | - public void setHaveEvaluateOfClient(Integer haveEvaluateOfClient) { | |
| 474 | - this.haveEvaluateOfClient = haveEvaluateOfClient; | |
| 475 | - } | |
| 503 | + public void setHaveEvaluateOfClient(Integer haveEvaluateOfClient) { | |
| 504 | + this.haveEvaluateOfClient = haveEvaluateOfClient; | |
| 505 | + } | |
| 476 | 506 | |
| 477 | - public String getGarEstimatedCost() { | |
| 478 | - return garEstimatedCost; | |
| 479 | - } | |
| 507 | + public String getGarEstimatedCost() { | |
| 508 | + return garEstimatedCost; | |
| 509 | + } | |
| 480 | 510 | |
| 481 | - public void setGarEstimatedCost(String garEstimatedCost) { | |
| 482 | - this.garEstimatedCost = garEstimatedCost; | |
| 483 | - } | |
| 511 | + public void setGarEstimatedCost(String garEstimatedCost) { | |
| 512 | + this.garEstimatedCost = garEstimatedCost; | |
| 513 | + } | |
| 484 | 514 | } |
| 485 | 515 | \ No newline at end of file | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderCar.java
| ... | ... | @@ -61,7 +61,7 @@ public class GarOrderCar implements Serializable { |
| 61 | 61 | @TableField(fill = FieldFill.INSERT_UPDATE) |
| 62 | 62 | private String garUpdateBy; |
| 63 | 63 | /**车辆ID*/ |
| 64 | - private Integer carId; | |
| 64 | + private String carId; | |
| 65 | 65 | /**车辆容积*/ |
| 66 | 66 | private String containerVolume; |
| 67 | 67 | |
| ... | ... | @@ -147,11 +147,11 @@ public class GarOrderCar implements Serializable { |
| 147 | 147 | this.garRemark = garRemark; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - public Integer getCarId() { | |
| 150 | + public String getCarId() { | |
| 151 | 151 | return carId; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - public void setCarId(Integer carId) { | |
| 154 | + public void setCarId(String carId) { | |
| 155 | 155 | this.carId = carId; |
| 156 | 156 | } |
| 157 | 157 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/DockingQRCodeDTO.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.dto; | |
| 2 | + | |
| 3 | +import javax.validation.constraints.NotEmpty; | |
| 4 | + | |
| 5 | +public class DockingQRCodeDTO implements java.io.Serializable { | |
| 6 | + @NotEmpty(message = "车辆编号不能为空") | |
| 7 | + private String carCode; | |
| 8 | + | |
| 9 | + public String getCarCode() { | |
| 10 | + return carCode; | |
| 11 | + } | |
| 12 | + | |
| 13 | + public void setCarCode(String carCode) { | |
| 14 | + this.carCode = carCode; | |
| 15 | + } | |
| 16 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/GarCarInfoVo.java
0 → 100644
| 1 | +package com.trash.garbage.pojo.dto; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonFormat; | |
| 4 | +import com.trash.common.annotation.Excel; | |
| 5 | +import com.trash.common.core.domain.BaseEntity; | |
| 6 | +import com.trash.common.utils.StringUtils; | |
| 7 | +import com.trash.driver.domain.vo.DriverVo; | |
| 8 | +import org.apache.commons.lang3.builder.ToStringBuilder; | |
| 9 | +import org.apache.commons.lang3.builder.ToStringStyle; | |
| 10 | + | |
| 11 | +import java.util.Collection; | |
| 12 | +import java.util.Date; | |
| 13 | +import java.util.List; | |
| 14 | + | |
| 15 | +public class GarCarInfoVo extends BaseEntity { | |
| 16 | + /** $column.columnComment */ | |
| 17 | + private String id; | |
| 18 | + | |
| 19 | + /** 所属公司 */ | |
| 20 | + @Excel(name = "所属公司") | |
| 21 | + private String companyId; | |
| 22 | + | |
| 23 | + /** 车辆类型 */ | |
| 24 | + @Excel(name = "车辆类型") | |
| 25 | + private String carType; | |
| 26 | + | |
| 27 | + /** 车牌号 */ | |
| 28 | + @Excel(name = "车牌号") | |
| 29 | + private String carCode; | |
| 30 | + | |
| 31 | + /** 车辆品牌 */ | |
| 32 | + @Excel(name = "车辆品牌") | |
| 33 | + private String carBrank; | |
| 34 | + | |
| 35 | + /** 排放标准 */ | |
| 36 | + @Excel(name = "排放标准") | |
| 37 | + private String emissionStandard; | |
| 38 | + | |
| 39 | + /** 道路运输证有效期 */ | |
| 40 | + @JsonFormat(pattern = "yyyy-MM-dd") | |
| 41 | + @Excel(name = "道路运输证有效期", width = 30, dateFormat = "yyyy-MM-dd") | |
| 42 | + private Date roadTransportDate; | |
| 43 | + | |
| 44 | + /** 行驶证有效期 */ | |
| 45 | + @JsonFormat(pattern = "yyyy-MM-dd") | |
| 46 | + @Excel(name = "行驶证有效期", width = 30, dateFormat = "yyyy-MM-dd") | |
| 47 | + private Date drivingLicenseDate; | |
| 48 | + | |
| 49 | + /** 录入日期 */ | |
| 50 | + @JsonFormat(pattern = "yyyy-MM-dd") | |
| 51 | + @Excel(name = "录入日期", width = 30, dateFormat = "yyyy-MM-dd") | |
| 52 | + private Date enterDate; | |
| 53 | + | |
| 54 | + /** 车架号 */ | |
| 55 | + @Excel(name = "车架号") | |
| 56 | + private String farmeNumber; | |
| 57 | + | |
| 58 | + /** 车辆标识牌 */ | |
| 59 | + @Excel(name = "车辆标识牌") | |
| 60 | + private String carIdentification; | |
| 61 | + | |
| 62 | + /** 货箱体积 */ | |
| 63 | + @Excel(name = "货箱体积") | |
| 64 | + private String containerVolume; | |
| 65 | + | |
| 66 | + /** 货箱长宽高 */ | |
| 67 | + @Excel(name = "货箱长宽高") | |
| 68 | + private String lengthWidthHeight; | |
| 69 | + | |
| 70 | + /** 车辆颜色 */ | |
| 71 | + @Excel(name = "车辆颜色") | |
| 72 | + private String carColor; | |
| 73 | + | |
| 74 | + /** 车辆设备 */ | |
| 75 | + @Excel(name = "车辆设备") | |
| 76 | + private String carEquipment; | |
| 77 | + | |
| 78 | + /** 道路运输证 */ | |
| 79 | + @Excel(name = "道路运输证") | |
| 80 | + private String roadTransport; | |
| 81 | + | |
| 82 | + /** 行驶证 */ | |
| 83 | + @Excel(name = "行驶证") | |
| 84 | + private String drivingLicense; | |
| 85 | + | |
| 86 | + /** 车辆正面照片 */ | |
| 87 | + @Excel(name = "车辆正面照片") | |
| 88 | + private String carFront; | |
| 89 | + | |
| 90 | + /** 车辆左侧照片 */ | |
| 91 | + @Excel(name = "车辆左侧照片") | |
| 92 | + private String carLeft; | |
| 93 | + | |
| 94 | + /** 车辆尾部照片 */ | |
| 95 | + @Excel(name = "车辆尾部照片") | |
| 96 | + private String carBehind; | |
| 97 | + | |
| 98 | + /** 车辆右侧照片 */ | |
| 99 | + @Excel(name = "车辆右侧照片") | |
| 100 | + private String carRight; | |
| 101 | + | |
| 102 | + /** 驾驶员 */ | |
| 103 | + @Excel(name = "驾驶员") | |
| 104 | + private String drivers; | |
| 105 | + | |
| 106 | + /** 审批状态,0=审批中,1=审批通过,2=被驳回 */ | |
| 107 | + @Excel(name = "审批状态",readConverterExp = "0=审批中,1=审批通过,2=被驳回") | |
| 108 | + private Integer status; | |
| 109 | + | |
| 110 | + /** 信用状态 */ | |
| 111 | + @Excel(name = "信用状态") | |
| 112 | + private String creditStatus; | |
| 113 | + | |
| 114 | + /** 二维码 */ | |
| 115 | + @Excel(name = "二维码") | |
| 116 | + private String qrCode; | |
| 117 | + | |
| 118 | + private int isDel; | |
| 119 | + | |
| 120 | + private String companyName; | |
| 121 | + | |
| 122 | + private String driversName; | |
| 123 | + | |
| 124 | + private String driverPhone; | |
| 125 | + | |
| 126 | + private Collection<DriverVo> driverVoList; | |
| 127 | + | |
| 128 | + public int getIsDel() { | |
| 129 | + return isDel; | |
| 130 | + } | |
| 131 | + | |
| 132 | + public void setIsDel(int isDel) { | |
| 133 | + this.isDel = isDel; | |
| 134 | + } | |
| 135 | + | |
| 136 | + public String getLengthWidthHeight() { | |
| 137 | + return lengthWidthHeight; | |
| 138 | + } | |
| 139 | + | |
| 140 | + public void setLengthWidthHeight(String lengthWidthHeight) { | |
| 141 | + this.lengthWidthHeight = lengthWidthHeight; | |
| 142 | + } | |
| 143 | + | |
| 144 | + public void setId(String id) | |
| 145 | + { | |
| 146 | + this.id = id; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public String getId() | |
| 150 | + { | |
| 151 | + return id; | |
| 152 | + } | |
| 153 | + public void setCompanyId(String companyId) | |
| 154 | + { | |
| 155 | + this.companyId = companyId; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public String getCompanyId() | |
| 159 | + { | |
| 160 | + return companyId; | |
| 161 | + } | |
| 162 | + public void setCarType(String carType) | |
| 163 | + { | |
| 164 | + this.carType = carType; | |
| 165 | + } | |
| 166 | + | |
| 167 | + public String getCarType() | |
| 168 | + { | |
| 169 | + return carType; | |
| 170 | + } | |
| 171 | + public void setCarCode(String carCode) | |
| 172 | + { | |
| 173 | + this.carCode = carCode; | |
| 174 | + } | |
| 175 | + | |
| 176 | + public String getCarCode() | |
| 177 | + { | |
| 178 | + return carCode; | |
| 179 | + } | |
| 180 | + public void setCarBrank(String carBrank) | |
| 181 | + { | |
| 182 | + this.carBrank = carBrank; | |
| 183 | + } | |
| 184 | + | |
| 185 | + public String getCarBrank() | |
| 186 | + { | |
| 187 | + return carBrank; | |
| 188 | + } | |
| 189 | + public void setEmissionStandard(String emissionStandard) | |
| 190 | + { | |
| 191 | + this.emissionStandard = emissionStandard; | |
| 192 | + } | |
| 193 | + | |
| 194 | + public String getEmissionStandard() | |
| 195 | + { | |
| 196 | + return emissionStandard; | |
| 197 | + } | |
| 198 | + public void setRoadTransportDate(Date roadTransportDate) | |
| 199 | + { | |
| 200 | + this.roadTransportDate = roadTransportDate; | |
| 201 | + } | |
| 202 | + | |
| 203 | + public Date getRoadTransportDate() | |
| 204 | + { | |
| 205 | + return roadTransportDate; | |
| 206 | + } | |
| 207 | + public void setDrivingLicenseDate(Date drivingLicenseDate) | |
| 208 | + { | |
| 209 | + this.drivingLicenseDate = drivingLicenseDate; | |
| 210 | + } | |
| 211 | + | |
| 212 | + public Date getDrivingLicenseDate() | |
| 213 | + { | |
| 214 | + return drivingLicenseDate; | |
| 215 | + } | |
| 216 | + public void setEnterDate(Date enterDate) | |
| 217 | + { | |
| 218 | + this.enterDate = enterDate; | |
| 219 | + } | |
| 220 | + | |
| 221 | + public Date getEnterDate() | |
| 222 | + { | |
| 223 | + return enterDate; | |
| 224 | + } | |
| 225 | + public void setFarmeNumber(String farmeNumber) | |
| 226 | + { | |
| 227 | + this.farmeNumber = farmeNumber; | |
| 228 | + } | |
| 229 | + | |
| 230 | + public String getFarmeNumber() | |
| 231 | + { | |
| 232 | + return farmeNumber; | |
| 233 | + } | |
| 234 | + public void setCarIdentification(String carIdentification) | |
| 235 | + { | |
| 236 | + this.carIdentification = carIdentification; | |
| 237 | + } | |
| 238 | + | |
| 239 | + public String getCarIdentification() | |
| 240 | + { | |
| 241 | + return carIdentification; | |
| 242 | + } | |
| 243 | + public void setContainerVolume(String containerVolume) | |
| 244 | + { | |
| 245 | + this.containerVolume = containerVolume; | |
| 246 | + } | |
| 247 | + | |
| 248 | + public String getContainerVolume() | |
| 249 | + { | |
| 250 | + return containerVolume; | |
| 251 | + } | |
| 252 | + public void setCarColor(String carColor) | |
| 253 | + { | |
| 254 | + this.carColor = carColor; | |
| 255 | + } | |
| 256 | + | |
| 257 | + public String getCarColor() | |
| 258 | + { | |
| 259 | + return carColor; | |
| 260 | + } | |
| 261 | + public void setCarEquipment(String carEquipment) | |
| 262 | + { | |
| 263 | + this.carEquipment = carEquipment; | |
| 264 | + } | |
| 265 | + | |
| 266 | + public String getCarEquipment() | |
| 267 | + { | |
| 268 | + return carEquipment; | |
| 269 | + } | |
| 270 | + public void setRoadTransport(String roadTransport) | |
| 271 | + { | |
| 272 | + this.roadTransport = roadTransport; | |
| 273 | + } | |
| 274 | + | |
| 275 | + public String getRoadTransport() | |
| 276 | + { | |
| 277 | + return roadTransport; | |
| 278 | + } | |
| 279 | + public void setDrivingLicense(String drivingLicense) | |
| 280 | + { | |
| 281 | + this.drivingLicense = drivingLicense; | |
| 282 | + } | |
| 283 | + | |
| 284 | + public String getDrivingLicense() | |
| 285 | + { | |
| 286 | + return drivingLicense; | |
| 287 | + } | |
| 288 | + public void setCarFront(String carFront) | |
| 289 | + { | |
| 290 | + this.carFront = carFront; | |
| 291 | + } | |
| 292 | + | |
| 293 | + public String getCarFront() | |
| 294 | + { | |
| 295 | + return carFront; | |
| 296 | + } | |
| 297 | + public void setCarLeft(String carLeft) | |
| 298 | + { | |
| 299 | + this.carLeft = carLeft; | |
| 300 | + } | |
| 301 | + | |
| 302 | + public String getCarLeft() | |
| 303 | + { | |
| 304 | + return carLeft; | |
| 305 | + } | |
| 306 | + public void setCarBehind(String carBehind) | |
| 307 | + { | |
| 308 | + this.carBehind = carBehind; | |
| 309 | + } | |
| 310 | + | |
| 311 | + public String getCarBehind() | |
| 312 | + { | |
| 313 | + return carBehind; | |
| 314 | + } | |
| 315 | + public void setCarRight(String carRight) | |
| 316 | + { | |
| 317 | + this.carRight = carRight; | |
| 318 | + } | |
| 319 | + | |
| 320 | + public String getCarRight() | |
| 321 | + { | |
| 322 | + return carRight; | |
| 323 | + } | |
| 324 | + public void setDrivers(String drivers) | |
| 325 | + { | |
| 326 | + this.drivers = drivers; | |
| 327 | + } | |
| 328 | + | |
| 329 | + public String getDrivers() | |
| 330 | + { | |
| 331 | + return drivers; | |
| 332 | + } | |
| 333 | + public void setStatus(Integer status) | |
| 334 | + { | |
| 335 | + this.status = status; | |
| 336 | + } | |
| 337 | + | |
| 338 | + public Integer getStatus() | |
| 339 | + { | |
| 340 | + return status; | |
| 341 | + } | |
| 342 | + public void setCreditStatus(String creditStatus) | |
| 343 | + { | |
| 344 | + this.creditStatus = creditStatus; | |
| 345 | + } | |
| 346 | + | |
| 347 | + public String getCreditStatus() | |
| 348 | + { | |
| 349 | + return creditStatus; | |
| 350 | + } | |
| 351 | + public void setQrCode(String qrCode) | |
| 352 | + { | |
| 353 | + this.qrCode = qrCode; | |
| 354 | + } | |
| 355 | + | |
| 356 | + public String getQrCode() | |
| 357 | + { | |
| 358 | + return qrCode; | |
| 359 | + } | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + public String getCompanyName() { | |
| 365 | + return companyName; | |
| 366 | + } | |
| 367 | + | |
| 368 | + public void setCompanyName(String companyName) { | |
| 369 | + this.companyName = companyName; | |
| 370 | + } | |
| 371 | + | |
| 372 | + public String getDriversName() { | |
| 373 | + return driversName; | |
| 374 | + } | |
| 375 | + | |
| 376 | + public void setDriversName(String driversName) { | |
| 377 | + this.driversName = driversName; | |
| 378 | + } | |
| 379 | + | |
| 380 | + public String getDriverPhone() { | |
| 381 | + return driverPhone; | |
| 382 | + } | |
| 383 | + | |
| 384 | + public void setDriverPhone(String driverPhone) { | |
| 385 | + this.driverPhone = driverPhone; | |
| 386 | + } | |
| 387 | + | |
| 388 | + public Integer convertContainerVolumeDefaultMaxValue(){ | |
| 389 | + try { | |
| 390 | + return StringUtils.isEmpty(org.apache.commons.lang3.StringUtils.trim(this.getContainerVolume())) ? Integer.MAX_VALUE : Integer.parseInt(this.getContainerVolume()); | |
| 391 | + }catch (Exception e){ | |
| 392 | + return Integer.MAX_VALUE; | |
| 393 | + } | |
| 394 | + } | |
| 395 | + | |
| 396 | + public Collection<DriverVo> getDriverVoList() { | |
| 397 | + return driverVoList; | |
| 398 | + } | |
| 399 | + | |
| 400 | + public void setDriverVoList(Collection<DriverVo> driverVoList) { | |
| 401 | + this.driverVoList = driverVoList; | |
| 402 | + } | |
| 403 | + | |
| 404 | + @Override | |
| 405 | + public String toString() { | |
| 406 | + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) | |
| 407 | + .append("id", getId()) | |
| 408 | + .append("companyId", getCompanyId()) | |
| 409 | + .append("carType", getCarType()) | |
| 410 | + .append("carCode", getCarCode()) | |
| 411 | + .append("carBrank", getCarBrank()) | |
| 412 | + .append("emissionStandard", getEmissionStandard()) | |
| 413 | + .append("roadTransportDate", getRoadTransportDate()) | |
| 414 | + .append("drivingLicenseDate", getDrivingLicenseDate()) | |
| 415 | + .append("enterDate", getEnterDate()) | |
| 416 | + .append("farmeNumber", getFarmeNumber()) | |
| 417 | + .append("carIdentification", getCarIdentification()) | |
| 418 | + .append("containerVolume", getContainerVolume()) | |
| 419 | + .append("carColor", getCarColor()) | |
| 420 | + .append("carEquipment", getCarEquipment()) | |
| 421 | + .append("remark", getRemark()) | |
| 422 | + .append("roadTransport", getRoadTransport()) | |
| 423 | + .append("drivingLicense", getDrivingLicense()) | |
| 424 | + .append("carFront", getCarFront()) | |
| 425 | + .append("carLeft", getCarLeft()) | |
| 426 | + .append("carBehind", getCarBehind()) | |
| 427 | + .append("carRight", getCarRight()) | |
| 428 | + .append("drivers", getDrivers()) | |
| 429 | + .append("status", getStatus()) | |
| 430 | + .append("createTime", getCreateTime()) | |
| 431 | + .append("createBy", getCreateBy()) | |
| 432 | + .append("updateTime", getUpdateTime()) | |
| 433 | + .append("updateBy", getUpdateBy()) | |
| 434 | + .append("creditStatus", getCreditStatus()) | |
| 435 | + .append("qrCode", getQrCode()) | |
| 436 | + .toString(); | |
| 437 | + } | |
| 438 | + | |
| 439 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderDto.java
| ... | ... | @@ -105,7 +105,7 @@ public class OrderDto { |
| 105 | 105 | * 车子类型 |
| 106 | 106 | */ |
| 107 | 107 | private String carType; |
| 108 | - private Integer id; | |
| 108 | + private String id; | |
| 109 | 109 | private String garOrderCarType; |
| 110 | 110 | |
| 111 | 111 | private String containerVolume; |
| ... | ... | @@ -137,11 +137,11 @@ public class OrderDto { |
| 137 | 137 | this.carType = carType; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - public Integer getId() { | |
| 140 | + public String getId() { | |
| 141 | 141 | return id; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - public void setId(Integer id) { | |
| 144 | + public void setId(String id) { | |
| 145 | 145 | this.id = id; |
| 146 | 146 | } |
| 147 | 147 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/DispatchDriverVo.java
| ... | ... | @@ -3,6 +3,7 @@ package com.trash.garbage.pojo.vo; |
| 3 | 3 | import lombok.EqualsAndHashCode; |
| 4 | 4 | import lombok.ToString; |
| 5 | 5 | |
| 6 | +import java.util.Collection; | |
| 6 | 7 | import java.util.List; |
| 7 | 8 | |
| 8 | 9 | /** |
| ... | ... | @@ -22,7 +23,7 @@ public class DispatchDriverVo { |
| 22 | 23 | */ |
| 23 | 24 | private String containerVolume; |
| 24 | 25 | |
| 25 | - private List<Personnel> personnelInfo; | |
| 26 | + private Collection<Personnel> personnelInfo; | |
| 26 | 27 | |
| 27 | 28 | /** |
| 28 | 29 | * 人员信息 |
| ... | ... | @@ -80,11 +81,11 @@ public class DispatchDriverVo { |
| 80 | 81 | } |
| 81 | 82 | } |
| 82 | 83 | |
| 83 | - public List<Personnel> getPersonnelInfo() { | |
| 84 | + public Collection<Personnel> getPersonnelInfo() { | |
| 84 | 85 | return personnelInfo; |
| 85 | 86 | } |
| 86 | 87 | |
| 87 | - public void setPersonnelInfo(List<Personnel> personnelInfo) { | |
| 88 | + public void setPersonnelInfo(Collection<Personnel> personnelInfo) { | |
| 88 | 89 | this.personnelInfo = personnelInfo; |
| 89 | 90 | } |
| 90 | 91 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderCarService.java
| ... | ... | @@ -2,6 +2,8 @@ package com.trash.garbage.service; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | 4 | import com.trash.garbage.pojo.domain.GarOrderCar; |
| 5 | +import com.trash.garbage.pojo.domain.GarOrderMatchHandler; | |
| 6 | +import org.apache.ibatis.annotations.Param; | |
| 5 | 7 | |
| 6 | 8 | import java.util.List; |
| 7 | 9 | |
| ... | ... | @@ -12,4 +14,6 @@ import java.util.List; |
| 12 | 14 | */ |
| 13 | 15 | public interface GarOrderCarService extends IService<GarOrderCar> { |
| 14 | 16 | List<GarOrderCar> queryByOrderId(String orderId); |
| 17 | + | |
| 18 | + List<GarOrderMatchHandler> queryGarOrderMatchHandler( String orderId); | |
| 15 | 19 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderEvaluateService.java
| ... | ... | @@ -13,7 +13,7 @@ import java.util.List; |
| 13 | 13 | */ |
| 14 | 14 | public interface GarOrderEvaluateService extends IService<GarOrderEvaluate> { |
| 15 | 15 | |
| 16 | - List<GarOrderEvaluate> queryEvaluateByEnterpriseIds( List<Long> enterpriseIds, Integer value); | |
| 16 | + List<GarOrderEvaluate> queryEvaluateByEnterpriseIds( List<String> enterpriseIds, Integer value); | |
| 17 | 17 | |
| 18 | 18 | Integer countId(GarOrderEvaluate evaluate); |
| 19 | 19 | /*** | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderMatchHandlerService.java
| ... | ... | @@ -14,5 +14,5 @@ import java.util.Set; |
| 14 | 14 | */ |
| 15 | 15 | public interface GarOrderMatchHandlerService extends IService<GarOrderMatchHandler> { |
| 16 | 16 | |
| 17 | - List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, Long companyId, Set<String> containerVolumees); | |
| 17 | + List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, String companyId, Set<String> containerVolumees); | |
| 18 | 18 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderService.java
| ... | ... | @@ -3,6 +3,7 @@ package com.trash.garbage.service; |
| 3 | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 4 | 4 | import com.github.pagehelper.PageInfo; |
| 5 | 5 | import com.trash.enterprise.domain.TransportationEnterprise; |
| 6 | +import com.trash.garbage.pojo.domain.DockingQRCodeEntity; | |
| 6 | 7 | import com.trash.garbage.pojo.domain.GarOrder; |
| 7 | 8 | import com.trash.garbage.pojo.domain.GarOrderEvaluate; |
| 8 | 9 | import com.trash.garbage.pojo.domain.GarOrderMatchHandler; |
| ... | ... | @@ -67,6 +68,8 @@ public interface GarOrderService extends IService<GarOrder> { |
| 67 | 68 | |
| 68 | 69 | PageInfo queryEnterpriseList(TransportationEnterprise dto); |
| 69 | 70 | |
| 71 | + PageInfo dockingUpEnterpriseList(TransportationEnterprise dto); | |
| 72 | + | |
| 70 | 73 | List<GarOrderEvaluate> queryEvaluateDetail(String orderId); |
| 71 | 74 | |
| 72 | 75 | void dispatchDriverOrders(DispatchDto dto); |
| ... | ... | @@ -103,5 +106,7 @@ public interface GarOrderService extends IService<GarOrder> { |
| 103 | 106 | |
| 104 | 107 | MyBargeVo queryBadgeByType(Integer type); |
| 105 | 108 | |
| 106 | - Long queryCarIdOfDriver(String phone); | |
| 109 | + String queryCarIdOfDriver(String phone); | |
| 110 | + | |
| 111 | + List<DockingQRCodeEntity>queryReportByCarCode(String carCode); | |
| 107 | 112 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderCarServiceImpl.java
| ... | ... | @@ -2,11 +2,15 @@ package com.trash.garbage.service.impl; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 4 | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 5 | +import com.trash.garbage.mapper.GarOrderMatchHandlerMapper; | |
| 5 | 6 | import com.trash.garbage.pojo.domain.GarOrderCar; |
| 7 | +import com.trash.garbage.pojo.domain.GarOrderMatchHandler; | |
| 6 | 8 | import com.trash.garbage.service.GarOrderCarService; |
| 7 | 9 | import com.trash.garbage.mapper.GarOrderCarMapper; |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | 11 | import org.springframework.stereotype.Service; |
| 9 | 12 | |
| 13 | +import java.util.Collections; | |
| 10 | 14 | import java.util.List; |
| 11 | 15 | |
| 12 | 16 | /** |
| ... | ... | @@ -18,12 +22,19 @@ import java.util.List; |
| 18 | 22 | public class GarOrderCarServiceImpl extends ServiceImpl<GarOrderCarMapper, GarOrderCar> |
| 19 | 23 | implements GarOrderCarService { |
| 20 | 24 | |
| 25 | + @Autowired | |
| 26 | + private GarOrderMatchHandlerMapper garOrderMatchHandlerMapper; | |
| 21 | 27 | @Override |
| 22 | 28 | public List<GarOrderCar> queryByOrderId(String orderId) { |
| 23 | 29 | LambdaQueryWrapper<GarOrderCar> wrapper = new LambdaQueryWrapper<>(); |
| 24 | 30 | wrapper.eq(GarOrderCar::getGarOrderId, orderId); |
| 25 | 31 | return list(wrapper); |
| 26 | 32 | } |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public List<GarOrderMatchHandler> queryGarOrderMatchHandler(String orderId) { | |
| 36 | + return garOrderMatchHandlerMapper.queryGarOrderMatchHandler(orderId); | |
| 37 | + } | |
| 27 | 38 | } |
| 28 | 39 | |
| 29 | 40 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderEvaluateServiceImpl.java
| ... | ... | @@ -23,7 +23,7 @@ public class GarOrderEvaluateServiceImpl extends ServiceImpl<GarOrderEvaluateMap |
| 23 | 23 | implements GarOrderEvaluateService{ |
| 24 | 24 | |
| 25 | 25 | @Override |
| 26 | - public List<GarOrderEvaluate> queryEvaluateByEnterpriseIds(List<Long> enterpriseIds, Integer value) { | |
| 26 | + public List<GarOrderEvaluate> queryEvaluateByEnterpriseIds(List<String> enterpriseIds, Integer value) { | |
| 27 | 27 | if (CollectionUtil.isEmpty(enterpriseIds)){ |
| 28 | 28 | return new ArrayList<>(); |
| 29 | 29 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderMatchHandlerServiceImpl.java
| ... | ... | @@ -20,7 +20,7 @@ public class GarOrderMatchHandlerServiceImpl extends ServiceImpl<GarOrderMatchHa |
| 20 | 20 | implements GarOrderMatchHandlerService { |
| 21 | 21 | |
| 22 | 22 | @Override |
| 23 | - public List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, Long id, Set<String> containerVolumees) { | |
| 23 | + public List<DispatchDriverVo> queryDriverListWithDispatchStatus(String orderId, String id, Set<String> containerVolumees) { | |
| 24 | 24 | return baseMapper.queryDriverListWithDispatchStatus(orderId, id,containerVolumees); |
| 25 | 25 | } |
| 26 | 26 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
| 1 | 1 | package com.trash.garbage.service.impl; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollectionUtil; |
| 4 | +import cn.hutool.core.convert.Convert; | |
| 5 | +import cn.hutool.http.HtmlUtil; | |
| 6 | +import cn.hutool.http.HttpRequest; | |
| 7 | +import cn.hutool.http.HttpResponse; | |
| 8 | +import com.alibaba.fastjson.JSON; | |
| 9 | +import com.alibaba.fastjson.JSONArray; | |
| 10 | +import com.alibaba.fastjson.JSONObject; | |
| 4 | 11 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 5 | 12 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 6 | 13 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 7 | 14 | import com.github.pagehelper.PageHelper; |
| 8 | 15 | import com.github.pagehelper.PageInfo; |
| 16 | +import com.trash.carInfo.domain.vo.CarInfoVo; | |
| 9 | 17 | import com.trash.common.core.redis.RedisCache; |
| 10 | 18 | import com.trash.common.utils.SecurityUtils; |
| 11 | 19 | import com.trash.common.utils.ServletUtils; |
| ... | ... | @@ -21,14 +29,18 @@ import com.trash.garbage.pojo.domain.*; |
| 21 | 29 | import com.trash.garbage.pojo.dto.*; |
| 22 | 30 | import com.trash.garbage.pojo.vo.*; |
| 23 | 31 | import com.trash.garbage.service.*; |
| 32 | +import com.trash.garbage.utils.HttpUtil; | |
| 24 | 33 | import com.trash.garbage.utils.SMSUtils; |
| 25 | 34 | import com.trash.garbage.utils.ValidateCodeUtil; |
| 26 | 35 | import org.apache.commons.collections4.CollectionUtils; |
| 27 | 36 | import org.apache.commons.lang3.StringUtils; |
| 37 | +import org.apache.http.client.utils.HttpClientUtils; | |
| 28 | 38 | import org.springframework.beans.BeanUtils; |
| 29 | 39 | import org.springframework.beans.factory.annotation.Autowired; |
| 40 | +import org.springframework.beans.factory.annotation.Value; | |
| 30 | 41 | import org.springframework.stereotype.Service; |
| 31 | 42 | import org.springframework.transaction.annotation.Transactional; |
| 43 | +import org.springframework.web.util.HtmlUtils; | |
| 32 | 44 | |
| 33 | 45 | import javax.annotation.Resource; |
| 34 | 46 | import java.util.*; |
| ... | ... | @@ -81,6 +93,11 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 81 | 93 | private GarOrderMatchDisposalService garOrderMatchDisposalService; |
| 82 | 94 | @Autowired |
| 83 | 95 | private DisposalSiteService disposalSiteService; |
| 96 | + private String contentType = "application/json"; | |
| 97 | + @Value("${trash.token}") | |
| 98 | + private String authorization; | |
| 99 | + @Value("${trash.remotePath}") | |
| 100 | + private String remotePath; | |
| 84 | 101 | |
| 85 | 102 | @Override |
| 86 | 103 | @Transactional(rollbackFor = Exception.class) |
| ... | ... | @@ -225,7 +242,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 225 | 242 | } |
| 226 | 243 | DisposalSiteVo vo = new DisposalSiteVo(); |
| 227 | 244 | BeanUtils.copyProperties(en, vo); |
| 228 | - // vo.setLongitude(en.getLongitude()); | |
| 245 | + // vo.setLongitude(en.getLongitude()); | |
| 229 | 246 | return vo; |
| 230 | 247 | }).filter(obj -> Objects.nonNull(obj)).collect(Collectors.toList()); |
| 231 | 248 | } |
| ... | ... | @@ -334,14 +351,14 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 334 | 351 | .eq(GarOrder::getGarTimeOutFlag, GlobalStatus.GarOrderStatus.ORDER_TIME_OUT_FLAG_NO.getValue()); |
| 335 | 352 | } |
| 336 | 353 | List<GarOrder> orderList = list(qw); |
| 337 | - orderList=queryHaveEvaluateOfClient(orderList,GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); | |
| 354 | + orderList = queryHaveEvaluateOfClient(orderList, GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); | |
| 338 | 355 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); |
| 339 | 356 | return pageInfo; |
| 340 | 357 | } |
| 341 | 358 | // 全部 |
| 342 | 359 | if (GlobalStatus.GarOrderStatus.ALL_ORDER.getValue().equals(type)) { |
| 343 | 360 | List<GarOrder> orderList = baseMapper.selectList(qw); |
| 344 | - orderList =queryHaveEvaluateOfClient(orderList,GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); | |
| 361 | + orderList = queryHaveEvaluateOfClient(orderList, GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); | |
| 345 | 362 | PageInfo<GarOrder> pageInfo = new PageInfo<GarOrder>(orderList, pageSize); |
| 346 | 363 | return pageInfo; |
| 347 | 364 | } |
| ... | ... | @@ -377,10 +394,10 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 377 | 394 | } |
| 378 | 395 | |
| 379 | 396 | return orders.stream().map(o -> { |
| 380 | - if(Objects.nonNull(o)){ | |
| 381 | - Optional<GarOrderEvaluate> optional = garOrderEvaluates.stream().filter(go->Objects.equals(go.getGarOrderId(),o.getGarOrderId())).findFirst(); | |
| 382 | - if(optional.isPresent()){ | |
| 383 | - o.setHaveEvaluateOfClient(optional.get().getCountTheNumber()>0?1:0); | |
| 397 | + if (Objects.nonNull(o)) { | |
| 398 | + Optional<GarOrderEvaluate> optional = garOrderEvaluates.stream().filter(go -> Objects.equals(go.getGarOrderId(), o.getGarOrderId())).findFirst(); | |
| 399 | + if (optional.isPresent()) { | |
| 400 | + o.setHaveEvaluateOfClient(optional.get().getCountTheNumber() > 0 ? 1 : 0); | |
| 384 | 401 | } |
| 385 | 402 | } |
| 386 | 403 | return o; |
| ... | ... | @@ -671,7 +688,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 671 | 688 | comparator = Comparator.comparing(TransportationEnterpriseVo::getDistance); |
| 672 | 689 | } |
| 673 | 690 | // 企业id为空说明没有公司 |
| 674 | - List<Long> enterpriseIds = list.stream().map(TransportationEnterprise::getId).collect(Collectors.toList()); | |
| 691 | + List<String> enterpriseIds = list.stream().map(TransportationEnterprise::getId).collect(Collectors.toList()); | |
| 675 | 692 | List<GarOrder> orderList = baseMapper.queryCleanNumberByEnterpriseIds(enterpriseIds, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); |
| 676 | 693 | List<GarOrderEvaluate> evaluateList = garOrderEvaluateService.queryEvaluateByEnterpriseIds(enterpriseIds, GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); |
| 677 | 694 | Map<String, List<GarOrderEvaluate>> evaluateMap = new HashMap<>(); |
| ... | ... | @@ -717,9 +734,180 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 717 | 734 | return pageInfo; |
| 718 | 735 | } |
| 719 | 736 | |
| 737 | + @Override | |
| 738 | + public PageInfo dockingUpEnterpriseList(TransportationEnterprise dto) { | |
| 739 | + // 1)支持选择企业“所属区域”(长沙市内的)展示区域内所有企业 | |
| 740 | + // 2)支持选择车辆“车辆类型”展示有该车辆类型的企业 | |
| 741 | + // TODO 车辆类型暂时不考虑 | |
| 742 | + | |
| 743 | + Map<String, String> headers = new HashMap<>(); | |
| 744 | + headers.put("Authorization", authorization); | |
| 745 | + headers.put("Content-Type", contentType); | |
| 746 | + | |
| 747 | + Map<String, Object> params = new HashMap<>(); | |
| 748 | + if (StringUtils.isNotEmpty(dto.getServicePhone())) { | |
| 749 | + params.put("principalPhoneNo", dto.getServicePhone()); | |
| 750 | + } | |
| 751 | + | |
| 752 | +// if (StringUtils.isNotEmpty(dto.getRegistrationArea())) { | |
| 753 | +// params.put("officeAddress", dto.getRegistrationArea()); | |
| 754 | +// } | |
| 755 | + | |
| 756 | + if (StringUtils.isNotEmpty(dto.getRegistrationArea())) { | |
| 757 | + try { | |
| 758 | + String json = HttpUtil.doGet(remotePath + "/api/gpsservice/cs/area", headers, null); | |
| 759 | + if (StringUtils.isNotEmpty(json)) { | |
| 760 | + Map<String, Object> hash = JSON.parseObject(json, HashMap.class); | |
| 761 | + if (Objects.nonNull(hash.get("code")) && StringUtils.equals(hash.get("code").toString(), "200")) { | |
| 762 | + if (Objects.nonNull(hash.get("result")) && hash.get("result") instanceof JSONArray) { | |
| 763 | + JSONArray jsonArray = (JSONArray) hash.get("result"); | |
| 764 | + Optional<Object> opt = jsonArray.stream().filter(jo -> { | |
| 765 | + JSONObject jsonObject = (JSONObject) jo; | |
| 766 | + return StringUtils.equals(jsonObject.getString("name"), dto.getRegistrationArea()); | |
| 767 | + }).findFirst(); | |
| 768 | + if (opt.isPresent()) { | |
| 769 | + JSONObject jsonObject = (JSONObject) opt.get(); | |
| 770 | + params.put("adCodes", jsonObject.getString("code")); | |
| 771 | + } | |
| 772 | + } | |
| 773 | + } | |
| 774 | + } | |
| 775 | + } catch (Exception e) { | |
| 776 | + log.error("请求的确信息异常", e); | |
| 777 | + } | |
| 778 | + } | |
| 779 | + String json = null; | |
| 780 | + List<TransportationEnterprise> list = new ArrayList<>(); | |
| 781 | + try { | |
| 782 | + json = com.trash.garbage.utils.HttpUtil.doGet(remotePath + "/api/gpsservice/cs/companies/simple/list?tag=1&valid=0", headers, params); | |
| 783 | + log.debug("/api/gpsservice/cs/companies/simple/list?tag=1&valid=0;params:" + JSON.toJSONString(params) + ";json:" + json); | |
| 784 | + } catch (Exception e) { | |
| 785 | + log.error("请求公司信息异常[{}]", e); | |
| 786 | + } | |
| 787 | + | |
| 788 | + if (StringUtils.isNotEmpty(json)) { | |
| 789 | + Map<String, Object> hash = JSON.parseObject(json, HashMap.class); | |
| 790 | + if (Objects.nonNull(hash)) { | |
| 791 | + if (Objects.nonNull(hash.get("code")) && StringUtils.equals(hash.get("code").toString(), "200")) { | |
| 792 | + if (Objects.nonNull(hash.get("result")) && hash.get("result") instanceof JSONArray) { | |
| 793 | + JSONArray jsonArray = (JSONArray) hash.get("result"); | |
| 794 | + for (Object object : jsonArray) { | |
| 795 | + JSONObject jsonObject = (JSONObject) object; | |
| 796 | + TransportationEnterprise transportationEnterprise = new TransportationEnterprise(); | |
| 797 | + transportationEnterprise.setId(StringUtils.replace(jsonObject.get("id").toString(), "zxljqy", "")); | |
| 798 | + //transportationEnterprise.setId(jsonObject.get("id").toString()); | |
| 799 | + transportationEnterprise.setName(jsonObject.getString("name")); | |
| 800 | + transportationEnterprise.setAbbreviation(jsonObject.getString("abbreviation")); | |
| 801 | + transportationEnterprise.setOfficeAddress(jsonObject.getString("officeAddress")); | |
| 802 | + transportationEnterprise.setServicePhone(jsonObject.getString("principalPhoneNo")); | |
| 803 | + transportationEnterprise.setLegalRepresentative(jsonObject.getString("principal")); | |
| 804 | + transportationEnterprise.setLegalRepresentativePhone(jsonObject.getString("principalPhoneNo")); | |
| 805 | + list.add(transportationEnterprise); | |
| 806 | + } | |
| 807 | + } | |
| 808 | + } | |
| 809 | + } | |
| 810 | + } | |
| 811 | + | |
| 812 | + saveOrUpdate(list); | |
| 813 | + Integer pageNum = ServletUtils.getParameterToInt("pageNum"); | |
| 814 | + Integer pageSize = ServletUtils.getParameterToInt("pageSize"); | |
| 815 | + Integer orderByColumn = ServletUtils.getParameterToInt("orderByColumn"); | |
| 816 | + Comparator<TransportationEnterpriseVo> comparator; | |
| 817 | + if (1 == orderByColumn) { | |
| 818 | + comparator = Comparator.comparing(TransportationEnterpriseVo::getCleanNumber); | |
| 819 | + } else if (2 == orderByColumn) { | |
| 820 | + comparator = Comparator.comparing(TransportationEnterpriseVo::getScore); | |
| 821 | + } else { | |
| 822 | + comparator = Comparator.comparing(TransportationEnterpriseVo::getDistance); | |
| 823 | + } | |
| 824 | + // 企业id为空说明没有公司 | |
| 825 | + List<String> enterpriseIds = list.stream().map(TransportationEnterprise::getId).collect(Collectors.toList()); | |
| 826 | + List<GarOrder> orderList = baseMapper.queryCleanNumberByEnterpriseIds(enterpriseIds, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); | |
| 827 | + List<GarOrderEvaluate> evaluateList = garOrderEvaluateService.queryEvaluateByEnterpriseIds(enterpriseIds, GlobalStatus.GarOrderStatus.EVALUATE_TYPE_COMPANY.getValue()); | |
| 828 | + Map<String, List<GarOrderEvaluate>> evaluateMap = new HashMap<>(); | |
| 829 | + for (GarOrderEvaluate garOrderEvaluate : evaluateList) { | |
| 830 | + List<GarOrderEvaluate> evaluate = evaluateMap.get(garOrderEvaluate.getGarCompanyId()); | |
| 831 | + if (CollectionUtil.isEmpty(evaluate)) { | |
| 832 | + evaluateMap.put(garOrderEvaluate.getGarCompanyId(), new ArrayList<>(Arrays.asList(garOrderEvaluate))); | |
| 833 | + } else { | |
| 834 | + evaluate.add(garOrderEvaluate); | |
| 835 | + } | |
| 836 | + } | |
| 837 | + // 获取当前选中地址计算距离 | |
| 838 | + LambdaQueryWrapper<GarAddress> qw = new LambdaQueryWrapper<>(); | |
| 839 | + qw.eq(GarAddress::getGarUserId, SecurityUtils.getLoginUser().getUser().getUserId()) | |
| 840 | + .eq(GarAddress::getGarUserDefault, GlobalStatus.GarAddressStatus.CURRENT_ADDRESS.getValue()); | |
| 841 | + GarAddress address = garAddressService.getOne(qw); | |
| 842 | + | |
| 843 | + Stream<TransportationEnterpriseVo> stream = list.stream().map(item -> { | |
| 844 | + TransportationEnterpriseVo vo = new TransportationEnterpriseVo(); | |
| 845 | + BeanUtils.copyProperties(item, vo); | |
| 846 | + List<GarOrderEvaluate> evaluate = evaluateMap.get(String.valueOf(item.getId())); | |
| 847 | + handleCleanNumber(vo, orderList); | |
| 848 | + handleScore(vo, evaluate); | |
| 849 | + handleDistance(vo, address); | |
| 850 | + return vo; | |
| 851 | + }); | |
| 852 | + List<TransportationEnterpriseVo> voList; | |
| 853 | + if (orderByColumn != 0) { | |
| 854 | + // 降序 | |
| 855 | + voList = stream.sorted(comparator.reversed()).collect(Collectors.toList()); | |
| 856 | + } else { | |
| 857 | + voList = stream.sorted(comparator).collect(Collectors.toList()); | |
| 858 | + } | |
| 859 | + int total = voList.size(); | |
| 860 | + int remainder = total % pageSize; | |
| 861 | + int currentPage = pageNum > 0 ? (pageNum - 1) * pageSize : pageNum * pageSize; | |
| 862 | + // 怕页码超出界限了 超出界限就通过currenPage (3 * 10) > total (25) ? currentPage (20) - (pageSize (10) - remainder (3)) : currentPage | |
| 863 | + int startPage = currentPage > total ? currentPage - (pageSize - remainder) : currentPage; | |
| 864 | + int endPage = Math.min(startPage + pageSize, total); | |
| 865 | + PageInfo<TransportationEnterpriseVo> pageInfo = new PageInfo<>(); | |
| 866 | + pageInfo.setList(voList.subList(startPage, endPage)); | |
| 867 | + pageInfo.setTotal(total); | |
| 868 | + return pageInfo; | |
| 869 | + } | |
| 870 | + | |
| 871 | + private void saveOrUpdate(List<TransportationEnterprise> list) { | |
| 872 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 873 | + new Thread(new Runnable() { | |
| 874 | + @Override | |
| 875 | + public void run() { | |
| 876 | + for (TransportationEnterprise transportationEnterprise : list) { | |
| 877 | + try { | |
| 878 | + transportationEnterprise.setCarNumber(0); | |
| 879 | + TransportationEnterprise source = transportationEnterpriseService.selectTransportationEnterpriseByIdStr(transportationEnterprise.getId()); | |
| 880 | + if (Objects.isNull(source)) { | |
| 881 | + transportationEnterpriseService.save(transportationEnterprise); | |
| 882 | + } else { | |
| 883 | + TransportationEnterprise source1 = new TransportationEnterprise(); | |
| 884 | + source1.setId(source.getId()); | |
| 885 | + //transportationEnterprise.setId(jsonObject.get("id").toString()); | |
| 886 | + source1.setName(source.getName()); | |
| 887 | + source1.setAbbreviation(source.getAbbreviation()); | |
| 888 | + source1.setOfficeAddress(source.getOfficeAddress()); | |
| 889 | + source1.setServicePhone(source.getServicePhone()); | |
| 890 | + source1.setLegalRepresentative(source.getLegalRepresentative()); | |
| 891 | + source1.setLegalRepresentativePhone(source.getLegalRepresentativePhone()); | |
| 892 | + source1.setCarNumber(0); | |
| 893 | + if (Objects.equals(JSON.toJSONString(source1), JSON.toJSONString(transportationEnterprise))) { | |
| 894 | + continue; | |
| 895 | + } else { | |
| 896 | + transportationEnterpriseService.updateById(transportationEnterprise); | |
| 897 | + } | |
| 898 | + } | |
| 899 | + } catch (Exception e) { | |
| 900 | + log.error(e.getMessage(), e); | |
| 901 | + } | |
| 902 | + } | |
| 903 | + } | |
| 904 | + }).start(); | |
| 905 | + } | |
| 906 | + } | |
| 907 | + | |
| 720 | 908 | |
| 721 | 909 | private void handleDistance(TransportationEnterpriseVo vo, GarAddress address) { |
| 722 | - if(Objects.isNull(vo) || StringUtils.isEmpty(vo.getOfficeAddressGps()) || StringUtils.indexOf(vo.getOfficeAddressGps(),",")==-1 || Objects.isNull(address)){ | |
| 910 | + if (Objects.isNull(vo) || StringUtils.isEmpty(vo.getOfficeAddressGps()) || StringUtils.indexOf(vo.getOfficeAddressGps(), ",") == -1 || Objects.isNull(address)) { | |
| 723 | 911 | vo.setDistance(9999999); |
| 724 | 912 | return; |
| 725 | 913 | } |
| ... | ... | @@ -823,21 +1011,204 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 823 | 1011 | TransportationEnterprise enterprise = new TransportationEnterprise(); |
| 824 | 1012 | enterprise.setServicePhone(tel); |
| 825 | 1013 | List<TransportationEnterprise> enterprises = transportationEnterpriseService.selectTransportationEnterpriseList(enterprise); |
| 826 | - if(CollectionUtils.isEmpty(enterprises)){ | |
| 1014 | + if (CollectionUtils.isEmpty(enterprises)) { | |
| 827 | 1015 | return Collections.emptyList(); |
| 828 | 1016 | } |
| 829 | 1017 | |
| 830 | - List<GarOrderCar> garOrderCars = garOrderCarService.queryByOrderId(orderId); | |
| 831 | - if(CollectionUtils.isEmpty(garOrderCars)){ | |
| 1018 | + List<GarOrderMatchHandler> garOrderCars = garOrderCarService.queryGarOrderMatchHandler(orderId); | |
| 1019 | + int garOrderCarsLength = CollectionUtils.size(garOrderCars); | |
| 1020 | + | |
| 1021 | + String json = requestCarAndDriver(enterprises.get(0).getId()); | |
| 1022 | + List<DispatchDriverVo> voList = new ArrayList<>(); | |
| 1023 | + if (StringUtils.isNotEmpty(json)) { | |
| 1024 | + if (StringUtils.isNotEmpty(json)) { | |
| 1025 | + Map<String, Object> hash = JSON.parseObject(json, HashMap.class); | |
| 1026 | + if (Objects.nonNull(hash)) { | |
| 1027 | + if (Objects.nonNull(hash.get("code")) && StringUtils.equals(hash.get("code").toString(), "200")) { | |
| 1028 | + if (Objects.nonNull(hash.get("result")) && hash.get("result") instanceof JSONObject) { | |
| 1029 | + JSONObject resultObj = (JSONObject) hash.get("result"); | |
| 1030 | + if (Objects.nonNull(resultObj) && Objects.nonNull(resultObj.get("list")) && resultObj.get("list") instanceof JSONArray) { | |
| 1031 | + JSONArray jsonArray = (JSONArray) resultObj.get("list"); | |
| 1032 | + for (Object object : jsonArray) { | |
| 1033 | + JSONObject jsonObject = (JSONObject) object; | |
| 1034 | + | |
| 1035 | + DispatchDriverVo vo = new DispatchDriverVo(); | |
| 1036 | + vo.setContainerVolume(jsonObject.getString("energyTypeName")); | |
| 1037 | + vo.setLicensePlateNumber(jsonObject.getString("licenseplateNo")); | |
| 1038 | + | |
| 1039 | + if (Objects.nonNull(jsonObject.get("drivers")) && jsonObject.get("drivers") instanceof JSONArray) { | |
| 1040 | + JSONArray das = (JSONArray) jsonObject.get("drivers"); | |
| 1041 | + int length = CollectionUtils.size(das); | |
| 1042 | + if (length > 0) { | |
| 1043 | + Set<DispatchDriverVo.Personnel> personnelInfos = new LinkedHashSet<>(); | |
| 1044 | + | |
| 1045 | + for (Object da : das) { | |
| 1046 | + JSONObject dro = (JSONObject) da; | |
| 1047 | + DispatchDriverVo.Personnel personnel = new DispatchDriverVo.Personnel(); | |
| 1048 | + personnel.setName(dro.getString("driverName")); | |
| 1049 | + personnel.setTel(dro.getString("driverPhone")); | |
| 1050 | + | |
| 1051 | + personnel.setChecked(false); | |
| 1052 | + if (garOrderCarsLength > 0) { | |
| 1053 | + Optional<GarOrderMatchHandler> optional = garOrderCars.stream().filter(ga -> Objects.equals(ga.getGarOrderHandlerTel(), personnel.getTel()) && Objects.equals(ga.getGarHandlerCarCode(), vo.getLicensePlateNumber())).findFirst(); | |
| 1054 | + personnel.setChecked(optional.isPresent()); | |
| 1055 | + | |
| 1056 | + } | |
| 1057 | + | |
| 1058 | + personnelInfos.add(personnel); | |
| 1059 | + } | |
| 1060 | + vo.setPersonnelInfo(personnelInfos); | |
| 1061 | + } | |
| 1062 | + } | |
| 1063 | + voList.add(vo); | |
| 1064 | + } | |
| 1065 | + } | |
| 1066 | + } | |
| 1067 | + } | |
| 1068 | + } | |
| 1069 | + } | |
| 1070 | + } | |
| 1071 | + | |
| 1072 | + if (CollectionUtils.isEmpty(voList)) { | |
| 832 | 1073 | return Collections.emptyList(); |
| 833 | 1074 | } |
| 1075 | + LambdaQueryWrapper<GarOrderCar> qwc = new LambdaQueryWrapper<>(); | |
| 1076 | + qwc.eq(GarOrderCar::getGarOrderId, orderId); | |
| 1077 | + | |
| 1078 | + List<GarOrderCar> carList = garOrderCarService.list(qwc); | |
| 1079 | + if (CollectionUtils.isNotEmpty(carList)) { | |
| 1080 | + Set<String> carTypes = carList.stream().map(GarOrderCar::getGarOrderCarType).collect(Collectors.toSet()); | |
| 1081 | + voList = voList.stream().filter(v -> carTypes.contains(v.getContainerVolume())).collect(Collectors.toList()); | |
| 1082 | + } | |
| 834 | 1083 | |
| 835 | - Set<String> containerVolumees = garOrderCars.stream().map(GarOrderCar::getContainerVolume).collect(Collectors.toSet()); | |
| 836 | - // 选中的司机 | |
| 837 | - List<DispatchDriverVo> voList = handlerService.queryDriverListWithDispatchStatus(orderId, enterprises.get(0).getId(),containerVolumees); | |
| 838 | 1084 | return voList; |
| 839 | 1085 | } |
| 840 | 1086 | |
| 1087 | + private String requestCarAndDriver(String companyID) { | |
| 1088 | + Map<String, String> headers = new HashMap<>(); | |
| 1089 | + headers.put("Authorization", authorization); | |
| 1090 | + headers.put("Content-Type", contentType); | |
| 1091 | + | |
| 1092 | + Map<String, Object> params = new HashMap<>(); | |
| 1093 | + if (Objects.nonNull(companyID)) { | |
| 1094 | + if (StringUtils.length(companyID) < 5) { | |
| 1095 | + params.put("companyID", "zxljqy" + companyID); | |
| 1096 | + } else { | |
| 1097 | + params.put("companyID", companyID); | |
| 1098 | + } | |
| 1099 | + } | |
| 1100 | + | |
| 1101 | + params.put("valid", 0); | |
| 1102 | + params.put("tag", 1); | |
| 1103 | + params.put("page", 1); | |
| 1104 | + params.put("size", 100); | |
| 1105 | + | |
| 1106 | + String json = null; | |
| 1107 | + List<CarInfoVo> list = new ArrayList<>(); | |
| 1108 | + try { | |
| 1109 | + String paramStr = JSON.toJSONString(params); | |
| 1110 | + json = HttpRequest.get(remotePath + "/api/gpsservice/cs/basevehicle/ledger/list").header("Authorization", authorization).header("Content-Type", contentType) | |
| 1111 | + .timeout(15000).body(paramStr).execute().body(); | |
| 1112 | + log.debug("/api/gpsservice/cs/basevehicle/ledger/list;params:[" + paramStr + "],returnJson:[" + json + "]"); | |
| 1113 | + } catch (Exception e) { | |
| 1114 | + log.error("请求公司车辆信息异常", e); | |
| 1115 | + } | |
| 1116 | + | |
| 1117 | + return json; | |
| 1118 | + } | |
| 1119 | + | |
| 1120 | +// private List<DispatchDisposalVo> comDis(){ | |
| 1121 | +// Map<String, String> headers = new HashMap<>(); | |
| 1122 | +// headers.put("Authorization", authorization); | |
| 1123 | +// headers.put("Content-Type", contentType); | |
| 1124 | +// | |
| 1125 | +// Map<String, Object> params = new HashMap<>(); | |
| 1126 | +// if (Objects.nonNull(carInfo.getCompanyId())) { | |
| 1127 | +// try { | |
| 1128 | +// Long companyId = Convert.toLong( carInfo.getCompanyId()); | |
| 1129 | +// if(companyId< 10000){ | |
| 1130 | +// params.put("companyID", "zxljqy" + carInfo.getCompanyId()); | |
| 1131 | +// }else{ | |
| 1132 | +// params.put("companyID", carInfo.getCompanyId()); | |
| 1133 | +// } | |
| 1134 | +// }catch (Exception e){ | |
| 1135 | +// log.error(e.getMessage()); | |
| 1136 | +// params.put("companyID", carInfo.getCompanyId()); | |
| 1137 | +// } | |
| 1138 | +// } | |
| 1139 | +// | |
| 1140 | +// params.put("valid", 0); | |
| 1141 | +// params.put("tag", 1); | |
| 1142 | +// params.put("page", 1); | |
| 1143 | +// params.put("size", 100); | |
| 1144 | +// | |
| 1145 | +// String json = null; | |
| 1146 | +// List<CarInfoVo> list = new ArrayList<>(); | |
| 1147 | +// try { | |
| 1148 | +// String paramStr = JSON.toJSONString(params); | |
| 1149 | +// json = HttpRequest.get(remotePath+"/api/gpsservice/cs/basevehicle/ledger/list").header("Authorization", authorization).header("Content-Type", contentType) | |
| 1150 | +// .timeout(15000).body(paramStr).execute().body(); | |
| 1151 | +// log.info("/api/gpsservice/cs/basevehicle/ledger/list;params:[{}],returnJson:[{}]",paramStr,json); | |
| 1152 | +// } catch (Exception e) { | |
| 1153 | +// log.error("请求公司车辆信息异常", e); | |
| 1154 | +// } | |
| 1155 | +// | |
| 1156 | +// if (StringUtils.isNotEmpty(json)) { | |
| 1157 | +// Map<String, Object> hash = JSON.parseObject(json, HashMap.class); | |
| 1158 | +// if (Objects.nonNull(hash)) { | |
| 1159 | +// if (Objects.nonNull(hash.get("code")) && StringUtils.equals(hash.get("code").toString(), "200")) { | |
| 1160 | +// if (Objects.nonNull(hash.get("result")) && hash.get("result") instanceof JSONObject) { | |
| 1161 | +// JSONObject resultObj = (JSONObject) hash.get("result"); | |
| 1162 | +// if (Objects.nonNull(resultObj) && Objects.nonNull(resultObj.get("list")) && resultObj.get("list") instanceof JSONArray) { | |
| 1163 | +// JSONArray jsonArray = (JSONArray) resultObj.get("list"); | |
| 1164 | +// for (Object object : jsonArray) { | |
| 1165 | +// JSONObject jsonObject = (JSONObject) object; | |
| 1166 | +// | |
| 1167 | +// CarInfoVo vo = new CarInfoVo(); | |
| 1168 | +// vo.setCarBrank(jsonObject.getString("brandName")); | |
| 1169 | +// vo.setCarCode(jsonObject.getString("licenseplateNo")); | |
| 1170 | +// vo.setCarColor(jsonObject.getString("")); | |
| 1171 | +// vo.setCarIdentification(jsonObject.getString("licenseplateNo")); | |
| 1172 | +// vo.setCarType(jsonObject.getString("energyTypeName")); | |
| 1173 | +// if (Objects.nonNull(jsonObject.getString("companyID"))) { | |
| 1174 | +// vo.setCompanyId(Convert.toLong(StringUtils.replace(jsonObject.getString("companyID").toString(), "zxljqy", ""))); | |
| 1175 | +// } | |
| 1176 | +// vo.setCompanyName(jsonObject.getString("companyName")); | |
| 1177 | +// vo.setContainerVolume(jsonObject.getString("containerVolume")); | |
| 1178 | +// vo.setEmissionStandard(jsonObject.getString("emissionStanName")); | |
| 1179 | +// vo.setFarmeNumber(jsonObject.getString("frmaeNo")); | |
| 1180 | +// vo.setId(Convert.toLong(StringUtils.replace(jsonObject.getString("id"), "zxljcl", ""))); | |
| 1181 | +// vo.setStatus(jsonObject.getInteger("auditStatus")); | |
| 1182 | +// if (StringUtils.isNotEmpty(jsonObject.getString("transportCertValid"))) { | |
| 1183 | +// vo.setRoadTransportDate(FAST_DATE_FORMAT.parse(jsonObject.getString("transportCertValid"))); | |
| 1184 | +// } | |
| 1185 | +// if (StringUtils.isNotEmpty(jsonObject.getString("registerAt"))) { | |
| 1186 | +// vo.setEnterDate(FAST_DATE_FORMAT.parse(jsonObject.getString("registerAt"))); | |
| 1187 | +// } | |
| 1188 | +// | |
| 1189 | +// if (Objects.nonNull(jsonObject.get("drivers")) && jsonObject.get("drivers") instanceof JSONArray) { | |
| 1190 | +// JSONArray das = (JSONArray) jsonObject.get("drivers"); | |
| 1191 | +// int length = CollectionUtils.size(das); | |
| 1192 | +// if (length > 0) { | |
| 1193 | +// if (Objects.nonNull(das.get(0)) && das.get(0) instanceof JSONObject) { | |
| 1194 | +// JSONObject dro = (JSONObject) das.get(0); | |
| 1195 | +// vo.setDrivers(StringUtils.replace(dro.getString("driverId").toString(), "zxljjsy", "")); | |
| 1196 | +// vo.setDriversName(dro.getString("driverName")); | |
| 1197 | +// } | |
| 1198 | +// | |
| 1199 | +// } | |
| 1200 | +// } | |
| 1201 | +// if(StringUtils.isNotEmpty(vo.getCarType())) { | |
| 1202 | +// list.add(vo); | |
| 1203 | +// } | |
| 1204 | +// } | |
| 1205 | +// } | |
| 1206 | +// } | |
| 1207 | +// } | |
| 1208 | +// } | |
| 1209 | +// } | |
| 1210 | +// } | |
| 1211 | + | |
| 841 | 1212 | @Override |
| 842 | 1213 | public List<GarOrderMatchHandler> queryOrderHandlerStatus(String orderId) { |
| 843 | 1214 | List<GarOrderMatchHandler> list = |
| ... | ... | @@ -1139,10 +1510,14 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 1139 | 1510 | } |
| 1140 | 1511 | |
| 1141 | 1512 | @Override |
| 1142 | - public Long queryCarIdOfDriver(String phone) { | |
| 1143 | - return baseMapper.queryCompanyIdByPhone(phone); | |
| 1513 | + public String queryCarIdOfDriver(String phone) { | |
| 1514 | + return baseMapper.queryCompanyIdByPhone(phone); | |
| 1144 | 1515 | } |
| 1145 | 1516 | |
| 1517 | + @Override | |
| 1518 | + public List<DockingQRCodeEntity> queryReportByCarCode(String carCode) { | |
| 1519 | + return baseMapper.queryReportByCarCode(carCode); | |
| 1520 | + } | |
| 1146 | 1521 | |
| 1147 | 1522 | |
| 1148 | 1523 | private void handleCleanNumber(TransportationEnterpriseVo vo, List<GarOrder> orderList) { | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/utils/HttpUtil.java
0 → 100644
| 1 | +package com.trash.garbage.utils; | |
| 2 | + | |
| 3 | +import lombok.extern.slf4j.Slf4j; | |
| 4 | +import org.apache.commons.collections4.MapUtils; | |
| 5 | +import org.apache.commons.lang3.StringUtils; | |
| 6 | +import org.apache.http.client.methods.CloseableHttpResponse; | |
| 7 | +import org.apache.http.client.methods.HttpGet; | |
| 8 | +import org.apache.http.client.methods.HttpPost; | |
| 9 | +import org.apache.http.entity.StringEntity; | |
| 10 | +import org.apache.http.impl.client.CloseableHttpClient; | |
| 11 | +import org.apache.http.impl.client.HttpClients; | |
| 12 | +import org.apache.http.util.EntityUtils; | |
| 13 | + | |
| 14 | +import java.io.IOException; | |
| 15 | +import java.util.Map; | |
| 16 | +import java.util.Objects; | |
| 17 | + | |
| 18 | +@Slf4j | |
| 19 | +public class HttpUtil { | |
| 20 | + public static String doPost(String url, Map<String, String> headers, String body) throws IOException { | |
| 21 | + HttpPost post = new HttpPost(url); | |
| 22 | + CloseableHttpClient client = HttpClients.createDefault(); | |
| 23 | + if (MapUtils.isNotEmpty(headers)) { | |
| 24 | + for (Map.Entry<String, String> entry : headers.entrySet()) { | |
| 25 | + post.addHeader(entry.getKey(), entry.getValue()); | |
| 26 | + } | |
| 27 | + } | |
| 28 | + | |
| 29 | + if (StringUtils.isNotEmpty(body)) { | |
| 30 | + post.setEntity(new StringEntity(body)); | |
| 31 | + } | |
| 32 | + CloseableHttpResponse response = client.execute(post); | |
| 33 | + if (response.getStatusLine().getStatusCode() == 200) { | |
| 34 | + String content = EntityUtils.toString(response.getEntity()); | |
| 35 | + | |
| 36 | + System.out.println(content); | |
| 37 | + return content; | |
| 38 | + } | |
| 39 | + return null; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public static String doGet(String url, Map<String, String> headers, Map<String,Object> paramMap) throws IOException { | |
| 43 | + if(MapUtils.isNotEmpty(paramMap)){ | |
| 44 | + StringBuilder builder = new StringBuilder(); | |
| 45 | + builder.append(url); | |
| 46 | + for (Map.Entry<String, Object> entry : paramMap.entrySet()) { | |
| 47 | + if(StringUtils.indexOf(url,"?") == -1){ | |
| 48 | + builder.append("?"); | |
| 49 | + }else{ | |
| 50 | + builder.append("&"); | |
| 51 | + } | |
| 52 | + builder.append(entry.getKey()); | |
| 53 | + builder.append("="); | |
| 54 | + builder.append(entry.getValue()); | |
| 55 | + } | |
| 56 | + url = builder.toString(); | |
| 57 | + } | |
| 58 | + HttpGet httpGet = new HttpGet(url); | |
| 59 | + CloseableHttpClient client = HttpClients.createDefault(); | |
| 60 | + if (MapUtils.isNotEmpty(headers)) { | |
| 61 | + for (Map.Entry<String, String> entry : headers.entrySet()) { | |
| 62 | + httpGet.addHeader(entry.getKey(), entry.getValue()); | |
| 63 | + } | |
| 64 | + } | |
| 65 | + | |
| 66 | + | |
| 67 | + CloseableHttpResponse response = client.execute(httpGet); | |
| 68 | + if (response.getStatusLine().getStatusCode() == 200) { | |
| 69 | + String content = EntityUtils.toString(response.getEntity()); | |
| 70 | + log.info("[{}],[{}]",url,content); | |
| 71 | + return content; | |
| 72 | + } else if (Objects.nonNull(response) && Objects.nonNull(response.getStatusLine())) { | |
| 73 | + log.info("[{}],[{}]",url,response.getStatusLine().getStatusCode()); | |
| 74 | + } | |
| 75 | + | |
| 76 | + return null; | |
| 77 | + } | |
| 78 | +} | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderMapper.xml
| ... | ... | @@ -255,7 +255,19 @@ |
| 255 | 255 | order by `disposal`.gar_create_time desc |
| 256 | 256 | </select> |
| 257 | 257 | |
| 258 | - <select id="queryCompanyIdByPhone" parameterType="java.lang.String" resultType="java.lang.Long"> | |
| 258 | + <select id="queryCompanyIdByPhone" parameterType="java.lang.String" resultType="java.lang.String"> | |
| 259 | 259 | select company_id from driver d where phoneNo=#{phone} |
| 260 | 260 | </select> |
| 261 | + <select id="queryReportByCarCode" resultType="com.trash.garbage.pojo.domain.DockingQRCodeEntity"> | |
| 262 | + select go2.gar_order_address garOrderAddress ,go2.gar_order_address_details garOrderAddressDetails ,go2.gar_order_agreement_time garOrderAgreementTime, | |
| 263 | + gu.gar_user_name garUserName,gu.gar_user_tel garUserTel,goc.container_volume containerVolume,ds.address dsAddress,ds.local_area dsLocalArea ,ds.name dsName | |
| 264 | + from gar_order go2 | |
| 265 | + left join gar_user gu on gu.gar_user_id =go2.gar_order_user_id | |
| 266 | + left join gar_order_car goc on goc.gar_order_id =go2.gar_order_id | |
| 267 | + left join gar_order_match_disposal gomd on gomd.gar_order_id=go2.gar_order_id | |
| 268 | + left join disposal_site ds on ds.id = gomd.gar_order_disposal_company_id | |
| 269 | + left join gar_order_match_handler gomh on gomh.gar_order_id =go2.gar_order_id | |
| 270 | + where gomh.gar_handler_car_code=#{carCode} | |
| 271 | + and gomh.gar_order_handler_status = 1 AND gomh.gar_cancel_flag = 0 | |
| 272 | + </select> | |
| 261 | 273 | </mapper> | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderMatchHandlerMapper.xml
| ... | ... | @@ -63,4 +63,9 @@ |
| 63 | 63 | #{item} |
| 64 | 64 | </foreach> |
| 65 | 65 | </select> |
| 66 | + | |
| 67 | + | |
| 68 | + <select id="queryGarOrderMatchHandler" resultType="com.trash.garbage.pojo.domain.GarOrderMatchHandler"> | |
| 69 | + select * from gar_order_match_handler where gar_order_id = #{orderId} | |
| 70 | + </select> | |
| 66 | 71 | </mapper> | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/controller/CarInfoController.java
| 1 | 1 | package com.trash.carInfo.controller; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson.JSON; | |
| 4 | +import com.alibaba.fastjson.JSONObject; | |
| 3 | 5 | import com.trash.carInfo.domain.CarInfo; |
| 4 | 6 | import com.trash.carInfo.domain.vo.CarInfoVo; |
| 5 | 7 | import com.trash.carInfo.service.ICarInfoService; |
| ... | ... | @@ -8,15 +10,26 @@ import com.trash.common.core.controller.BaseController; |
| 8 | 10 | import com.trash.common.core.domain.AjaxResult; |
| 9 | 11 | import com.trash.common.core.page.TableDataInfo; |
| 10 | 12 | import com.trash.common.enums.BusinessType; |
| 13 | +import com.trash.common.utils.RemoteServerUtils; | |
| 11 | 14 | import com.trash.common.utils.poi.ExcelUtil; |
| 15 | +import com.trash.enterprise.domain.TransportationEnterprise; | |
| 16 | +import okhttp3.MediaType; | |
| 17 | +import okhttp3.OkHttpClient; | |
| 18 | +import okhttp3.Request; | |
| 19 | +import okhttp3.RequestBody; | |
| 12 | 20 | import org.apache.commons.collections4.CollectionUtils; |
| 21 | +import org.apache.commons.lang3.StringUtils; | |
| 22 | +import org.apache.http.client.HttpClient; | |
| 13 | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| 24 | +import org.springframework.beans.factory.annotation.Value; | |
| 14 | 25 | import org.springframework.security.access.prepost.PreAuthorize; |
| 15 | 26 | import org.springframework.web.bind.annotation.*; |
| 16 | 27 | import org.springframework.web.multipart.MultipartFile; |
| 17 | 28 | |
| 29 | +import javax.servlet.http.HttpServletRequest; | |
| 18 | 30 | import java.io.IOException; |
| 19 | 31 | import java.util.*; |
| 32 | +import java.util.concurrent.TimeUnit; | |
| 20 | 33 | import java.util.stream.Collectors; |
| 21 | 34 | |
| 22 | 35 | /** |
| ... | ... | @@ -61,44 +74,23 @@ public class CarInfoController extends BaseController { |
| 61 | 74 | } |
| 62 | 75 | |
| 63 | 76 | @GetMapping("/list/group/by/carType") |
| 64 | - public TableDataInfo listGroupByCarType(CarInfoVo carInfo) { | |
| 65 | - | |
| 66 | - carInfo.setIsDel(1); | |
| 67 | - List<CarInfoVo> list = carInfoService.selectCarInfoListFront(carInfo); | |
| 68 | - TableDataInfo data = getDataTable(list); | |
| 69 | - if (CollectionUtils.isNotEmpty(list)) { | |
| 70 | - Map<String, List<CarInfoVo>> carMap = list.stream().map(car -> { | |
| 71 | - if (Objects.equals(car.getCarType(), "轻型货车")) { | |
| 72 | - car.setCarLeft("car_1.png"); | |
| 73 | - car.setRemark("箱体长2.6m,宽1.7m,高1.5m;最多可容纳约90袋装修垃圾(75cm*5cm每袋)"); | |
| 74 | - } else if (Objects.equals(car.getCarType(), "中型货车")) { | |
| 75 | - car.setCarLeft("car_2.png"); | |
| 76 | - car.setRemark("箱体长3.2m,宽1.5m,高1.5m;最多可容纳约110袋装修垃圾(75cm*45cm每袋)"); | |
| 77 | - } else if (Objects.equals(car.getCarType(), "大中型货车")) { | |
| 78 | - car.setCarLeft("car_3.png"); | |
| 79 | - car.setRemark("箱体长3.2m,宽1.9m,高1.9m;最多可容纳约150袋装修垃圾(75cm*45cm每袋)"); | |
| 80 | - } | |
| 81 | - return car; | |
| 82 | - }).collect(Collectors.groupingBy(CarInfoVo::getCarType)); | |
| 83 | - | |
| 84 | - List<CarInfoVo> carList = new ArrayList<>(); | |
| 85 | - for (Map.Entry<String, List<CarInfoVo>> entry : carMap.entrySet()) { | |
| 86 | - if (CollectionUtils.isNotEmpty(entry.getValue())) { | |
| 87 | - Optional<CarInfoVo> opt = entry.getValue().stream().filter(car -> Objects.equals(car.getCarEquipment(), "4") || Objects.equals(car.getCarEquipment(), "6") || Objects.equals(car.getCarEquipment(), "8")).findFirst(); | |
| 88 | - if (opt.isPresent()) { | |
| 89 | - carList.add(opt.get()); | |
| 90 | - } else { | |
| 91 | - carList.add(entry.getValue().get(0)); | |
| 92 | - } | |
| 93 | - | |
| 94 | - } | |
| 95 | - } | |
| 96 | - carList = carList.stream().sorted(Comparator.comparing(CarInfoVo::convertContainerVolumeDefaultMaxValue)).collect(Collectors.toList()); | |
| 97 | - | |
| 98 | - data.setRows(carList); | |
| 77 | + public String listGroupByCarType(CarInfoVo carInfo, HttpServletRequest request) { | |
| 78 | + String authorization = request.getHeader("Authorization"); | |
| 79 | + OkHttpClient okHttpClient = RemoteServerUtils.getOkClient(); | |
| 80 | + String param = JSON.toJSON(carInfo).toString(); | |
| 81 | + | |
| 82 | + okhttp3.RequestBody body = RequestBody.create(MediaType.parse("application/json"), param); | |
| 83 | + String url = request.getRequestURL().toString(); | |
| 84 | + url = StringUtils.replace(url,"/unit/carInfo/list/group/by/carType","/gar/car/list/group/by/carType"); | |
| 85 | + | |
| 86 | + Request request1 = new Request.Builder().url(url).addHeader("Authorization", authorization).post(body).build(); | |
| 87 | + try { | |
| 88 | + okhttp3.Response response = okHttpClient.newCall(request1).execute(); | |
| 89 | + return response.body().string(); | |
| 90 | + } catch (Exception e) { | |
| 91 | + logger.error(e.getMessage(),e); | |
| 92 | + return null; | |
| 99 | 93 | } |
| 100 | - | |
| 101 | - return data; | |
| 102 | 94 | } |
| 103 | 95 | |
| 104 | 96 | /** | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/domain/CarDriverRelation.java
| ... | ... | @@ -4,10 +4,10 @@ public class CarDriverRelation { |
| 4 | 4 | |
| 5 | 5 | private Long id; |
| 6 | 6 | |
| 7 | - private Long carId; | |
| 7 | + private String carId; | |
| 8 | 8 | |
| 9 | 9 | |
| 10 | - private Long driverId; | |
| 10 | + private String driverId; | |
| 11 | 11 | |
| 12 | 12 | public Long getId() { |
| 13 | 13 | return id; |
| ... | ... | @@ -17,19 +17,19 @@ public class CarDriverRelation { |
| 17 | 17 | this.id = id; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public Long getCarId() { | |
| 20 | + public String getCarId() { | |
| 21 | 21 | return carId; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public void setCarId(Long carId) { | |
| 24 | + public void setCarId(String carId) { | |
| 25 | 25 | this.carId = carId; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public Long getDriverId() { | |
| 28 | + public String getDriverId() { | |
| 29 | 29 | return driverId; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - public void setDriverId(Long driverId) { | |
| 32 | + public void setDriverId(String driverId) { | |
| 33 | 33 | this.driverId = driverId; |
| 34 | 34 | } |
| 35 | 35 | } | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/domain/CarInfo.java
| ... | ... | @@ -18,11 +18,11 @@ public class CarInfo extends BaseEntity |
| 18 | 18 | private static final long serialVersionUID = 1L; |
| 19 | 19 | |
| 20 | 20 | /** $column.columnComment */ |
| 21 | - private Long id; | |
| 21 | + private String id; | |
| 22 | 22 | |
| 23 | 23 | /** 所属公司 */ |
| 24 | 24 | @Excel(name = "所属公司") |
| 25 | - private Long companyId; | |
| 25 | + private String companyId; | |
| 26 | 26 | |
| 27 | 27 | /** 车辆类型 */ |
| 28 | 28 | @Excel(name = "车辆类型") |
| ... | ... | @@ -137,21 +137,21 @@ public class CarInfo extends BaseEntity |
| 137 | 137 | this.lengthWidthHeight = lengthWidthHeight; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - public void setId(Long id) | |
| 140 | + public void setId(String id) | |
| 141 | 141 | { |
| 142 | 142 | this.id = id; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - public Long getId() | |
| 145 | + public String getId() | |
| 146 | 146 | { |
| 147 | 147 | return id; |
| 148 | 148 | } |
| 149 | - public void setCompanyId(Long companyId) | |
| 149 | + public void setCompanyId(String companyId) | |
| 150 | 150 | { |
| 151 | 151 | this.companyId = companyId; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - public Long getCompanyId() | |
| 154 | + public String getCompanyId() | |
| 155 | 155 | { |
| 156 | 156 | return companyId; |
| 157 | 157 | } | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/domain/vo/CarInfoVo.java
trash-unit/src/main/java/com/trash/carInfo/mapper/CarInfoMapper.java
| ... | ... | @@ -22,6 +22,7 @@ public interface CarInfoMapper |
| 22 | 22 | * @return 运输车辆管理 |
| 23 | 23 | */ |
| 24 | 24 | CarInfo selectCarInfoById(Long id); |
| 25 | + CarInfo selectCarInfoByIdStr(String id); | |
| 25 | 26 | |
| 26 | 27 | /** |
| 27 | 28 | * 查询运输车辆管理列表 |
| ... | ... | @@ -43,6 +44,8 @@ public interface CarInfoMapper |
| 43 | 44 | */ |
| 44 | 45 | int insertCarInfo(CarInfo carInfo); |
| 45 | 46 | |
| 47 | + int saveCarInfo(CarInfo carInfo); | |
| 48 | + | |
| 46 | 49 | /** |
| 47 | 50 | * 修改运输车辆管理 |
| 48 | 51 | * |
| ... | ... | @@ -78,7 +81,7 @@ public interface CarInfoMapper |
| 78 | 81 | * @param carId 车辆id |
| 79 | 82 | * @return 结果 |
| 80 | 83 | */ |
| 81 | - int deleteCarDriverRelationByCarId(Long carId); | |
| 84 | + int deleteCarDriverRelationByCarId(String carId); | |
| 82 | 85 | |
| 83 | 86 | |
| 84 | 87 | } | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/service/ICarInfoService.java
| ... | ... | @@ -9,19 +9,20 @@ import java.util.List; |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * 运输车辆管理Service接口 |
| 12 | - * | |
| 12 | + * | |
| 13 | 13 | * @author trash |
| 14 | 14 | * @date 2023-11-21 |
| 15 | 15 | */ |
| 16 | -public interface ICarInfoService | |
| 17 | -{ | |
| 16 | +public interface ICarInfoService { | |
| 18 | 17 | /** |
| 19 | 18 | * 查询运输车辆管理 |
| 20 | - * | |
| 19 | + * | |
| 21 | 20 | * @param id 运输车辆管理ID |
| 22 | 21 | * @return 运输车辆管理 |
| 23 | 22 | */ |
| 24 | - CarInfo selectCarInfoById(Long id); | |
| 23 | + CarInfo selectCarInfoById(Long id); | |
| 24 | + | |
| 25 | + CarInfo selectCarInfoByIdStr(String id); | |
| 25 | 26 | |
| 26 | 27 | /** |
| 27 | 28 | * 查询运输车辆管理列表 |
| ... | ... | @@ -55,6 +56,8 @@ public interface ICarInfoService |
| 55 | 56 | MultipartFile[] carRightFiles, |
| 56 | 57 | CarInfo carInfo) throws IOException; |
| 57 | 58 | |
| 59 | + int save(CarInfo carInfo); | |
| 60 | + | |
| 58 | 61 | /** |
| 59 | 62 | * 修改运输车辆管理 |
| 60 | 63 | * |
| ... | ... | @@ -77,7 +80,7 @@ public interface ICarInfoService |
| 77 | 80 | |
| 78 | 81 | /** |
| 79 | 82 | * 批量删除运输车辆管理 |
| 80 | - * | |
| 83 | + * | |
| 81 | 84 | * @param ids 需要删除的运输车辆管理ID |
| 82 | 85 | * @return 结果 |
| 83 | 86 | */ |
| ... | ... | @@ -85,9 +88,11 @@ public interface ICarInfoService |
| 85 | 88 | |
| 86 | 89 | /** |
| 87 | 90 | * 删除运输车辆管理信息 |
| 88 | - * | |
| 91 | + * | |
| 89 | 92 | * @param id 运输车辆管理ID |
| 90 | 93 | * @return 结果 |
| 91 | 94 | */ |
| 92 | 95 | int deleteCarInfoById(Long id); |
| 96 | + | |
| 97 | + int updateById(CarInfo carInfo); | |
| 93 | 98 | } | ... | ... |
trash-unit/src/main/java/com/trash/carInfo/service/impl/CarInfoServiceImpl.java
| ... | ... | @@ -21,13 +21,12 @@ import static com.trash.common.utils.file.FileUploadUtils.upload; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * 运输车辆管理Service业务层处理 |
| 24 | - * | |
| 24 | + * | |
| 25 | 25 | * @author trash |
| 26 | 26 | * @date 2023-11-21 |
| 27 | 27 | */ |
| 28 | 28 | @Service |
| 29 | -public class CarInfoServiceImpl implements ICarInfoService | |
| 30 | -{ | |
| 29 | +public class CarInfoServiceImpl implements ICarInfoService { | |
| 31 | 30 | @Autowired |
| 32 | 31 | private CarInfoMapper carInfoMapper; |
| 33 | 32 | |
| ... | ... | @@ -36,16 +35,20 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 36 | 35 | |
| 37 | 36 | /** |
| 38 | 37 | * 查询运输车辆管理 |
| 39 | - * | |
| 38 | + * | |
| 40 | 39 | * @param id 运输车辆管理ID |
| 41 | 40 | * @return 运输车辆管理 |
| 42 | 41 | */ |
| 43 | 42 | @Override |
| 44 | - public CarInfo selectCarInfoById(Long id) | |
| 45 | - { | |
| 43 | + public CarInfo selectCarInfoById(Long id) { | |
| 46 | 44 | return carInfoMapper.selectCarInfoById(id); |
| 47 | 45 | } |
| 48 | 46 | |
| 47 | + @Override | |
| 48 | + public CarInfo selectCarInfoByIdStr(String id) { | |
| 49 | + return carInfoMapper.selectCarInfoByIdStr(id); | |
| 50 | + } | |
| 51 | + | |
| 49 | 52 | /** |
| 50 | 53 | * 查询运输车辆管理列表 |
| 51 | 54 | * |
| ... | ... | @@ -53,14 +56,12 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 53 | 56 | * @return 运输车辆管理 |
| 54 | 57 | */ |
| 55 | 58 | @Override |
| 56 | - public List<CarInfoVo> selectCarInfoList(CarInfoVo carInfo) | |
| 57 | - { | |
| 59 | + public List<CarInfoVo> selectCarInfoList(CarInfoVo carInfo) { | |
| 58 | 60 | return carInfoMapper.selectCarInfoList(carInfo); |
| 59 | 61 | } |
| 60 | 62 | |
| 61 | 63 | @Override |
| 62 | - public List<CarInfoVo> selectCarInfoListFront(CarInfoVo carInfo) | |
| 63 | - { | |
| 64 | + public List<CarInfoVo> selectCarInfoListFront(CarInfoVo carInfo) { | |
| 64 | 65 | return carInfoMapper.selectCarInfoListFront(carInfo); |
| 65 | 66 | } |
| 66 | 67 | |
| ... | ... | @@ -90,22 +91,22 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 90 | 91 | carInfo.setStatus(0); |
| 91 | 92 | carInfo.setIsDel(1); |
| 92 | 93 | for (MultipartFile file : roadTransportFiles) { |
| 93 | - carInfo.setRoadTransport(carInfo.getRoadTransport()!=null?carInfo.getRoadTransport()+";"+uploadFile(file):uploadFile(file)); | |
| 94 | + carInfo.setRoadTransport(carInfo.getRoadTransport() != null ? carInfo.getRoadTransport() + ";" + uploadFile(file) : uploadFile(file)); | |
| 94 | 95 | } |
| 95 | 96 | for (MultipartFile file : drivingLicenseFiles) { |
| 96 | - carInfo.setDrivingLicense(carInfo.getDrivingLicense()!=null?carInfo.getDrivingLicense()+";"+uploadFile(file):uploadFile(file)); | |
| 97 | + carInfo.setDrivingLicense(carInfo.getDrivingLicense() != null ? carInfo.getDrivingLicense() + ";" + uploadFile(file) : uploadFile(file)); | |
| 97 | 98 | } |
| 98 | 99 | for (MultipartFile file : carFrontFiles) { |
| 99 | - carInfo.setCarFront(carInfo.getCarFront()!=null?carInfo.getCarFront()+";"+uploadFile(file):uploadFile(file)); | |
| 100 | + carInfo.setCarFront(carInfo.getCarFront() != null ? carInfo.getCarFront() + ";" + uploadFile(file) : uploadFile(file)); | |
| 100 | 101 | } |
| 101 | 102 | for (MultipartFile file : carLeftFiles) { |
| 102 | - carInfo.setCarLeft(carInfo.getCarLeft()!=null?carInfo.getCarLeft()+";"+uploadFile(file):uploadFile(file)); | |
| 103 | + carInfo.setCarLeft(carInfo.getCarLeft() != null ? carInfo.getCarLeft() + ";" + uploadFile(file) : uploadFile(file)); | |
| 103 | 104 | } |
| 104 | 105 | for (MultipartFile file : carBehindFiles) { |
| 105 | - carInfo.setCarBehind(carInfo.getCarBehind()!=null?carInfo.getCarBehind()+";"+uploadFile(file):uploadFile(file)); | |
| 106 | + carInfo.setCarBehind(carInfo.getCarBehind() != null ? carInfo.getCarBehind() + ";" + uploadFile(file) : uploadFile(file)); | |
| 106 | 107 | } |
| 107 | 108 | for (MultipartFile file : carRightFiles) { |
| 108 | - carInfo.setCarRight(carInfo.getCarRight()!=null?carInfo.getCarRight()+";"+uploadFile(file):uploadFile(file)); | |
| 109 | + carInfo.setCarRight(carInfo.getCarRight() != null ? carInfo.getCarRight() + ";" + uploadFile(file) : uploadFile(file)); | |
| 109 | 110 | } |
| 110 | 111 | carInfo.setRoadTransport(removeSemicolon(carInfo.getRoadTransport())); |
| 111 | 112 | carInfo.setDrivingLicense(removeSemicolon(carInfo.getDrivingLicense())); |
| ... | ... | @@ -113,20 +114,28 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 113 | 114 | carInfo.setCarLeft(removeSemicolon(carInfo.getCarLeft())); |
| 114 | 115 | carInfo.setCarBehind(removeSemicolon(carInfo.getCarBehind())); |
| 115 | 116 | carInfo.setCarRight(removeSemicolon(carInfo.getCarRight())); |
| 116 | - int result = carInfoMapper.insertCarInfo(carInfo); | |
| 117 | + int result = carInfoMapper.insertCarInfo(carInfo); | |
| 117 | 118 | |
| 118 | 119 | String[] Drivers = carInfo.getDrivers().split(","); |
| 119 | 120 | int carCount = 0; |
| 120 | 121 | for (String driver : Drivers) { |
| 121 | 122 | CarDriverRelation carDriverRelation = new CarDriverRelation(); |
| 122 | 123 | carDriverRelation.setCarId(carInfo.getId()); |
| 123 | - carDriverRelation.setDriverId(Long.parseLong(driver)); | |
| 124 | - carCount = carCount+carInfoMapper.addCarDriverRelation(carDriverRelation); | |
| 124 | + carDriverRelation.setDriverId((driver)); | |
| 125 | + carCount = carCount + carInfoMapper.addCarDriverRelation(carDriverRelation); | |
| 125 | 126 | } |
| 126 | 127 | |
| 127 | 128 | return result; |
| 128 | 129 | } |
| 129 | 130 | |
| 131 | + public int save(CarInfo carInfo) { | |
| 132 | + return carInfoMapper.saveCarInfo(carInfo); | |
| 133 | + } | |
| 134 | + | |
| 135 | + public int updateById(CarInfo carInfo) { | |
| 136 | + return carInfoMapper.updateCarInfo(carInfo); | |
| 137 | + } | |
| 138 | + | |
| 130 | 139 | /** |
| 131 | 140 | * 修改运输车辆管理 |
| 132 | 141 | * |
| ... | ... | @@ -144,22 +153,22 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 144 | 153 | carInfo.setUpdateTime(DateUtils.getNowDate()); |
| 145 | 154 | carInfo.setUpdateBy(SecurityUtils.getUsername()); |
| 146 | 155 | for (MultipartFile file : roadTransportFiles) { |
| 147 | - carInfo.setRoadTransport(carInfo.getRoadTransport()!=null?carInfo.getRoadTransport()+";"+uploadFile(file):uploadFile(file)); | |
| 156 | + carInfo.setRoadTransport(carInfo.getRoadTransport() != null ? carInfo.getRoadTransport() + ";" + uploadFile(file) : uploadFile(file)); | |
| 148 | 157 | } |
| 149 | 158 | for (MultipartFile file : drivingLicenseFiles) { |
| 150 | - carInfo.setDrivingLicense(carInfo.getDrivingLicense()!=null?carInfo.getDrivingLicense()+";"+uploadFile(file):uploadFile(file)); | |
| 159 | + carInfo.setDrivingLicense(carInfo.getDrivingLicense() != null ? carInfo.getDrivingLicense() + ";" + uploadFile(file) : uploadFile(file)); | |
| 151 | 160 | } |
| 152 | 161 | for (MultipartFile file : carFrontFiles) { |
| 153 | - carInfo.setCarFront(carInfo.getCarFront()!=null?carInfo.getCarFront()+";"+uploadFile(file):uploadFile(file)); | |
| 162 | + carInfo.setCarFront(carInfo.getCarFront() != null ? carInfo.getCarFront() + ";" + uploadFile(file) : uploadFile(file)); | |
| 154 | 163 | } |
| 155 | 164 | for (MultipartFile file : carLeftFiles) { |
| 156 | - carInfo.setCarLeft(carInfo.getCarLeft()!=null?carInfo.getCarLeft()+";"+uploadFile(file):uploadFile(file)); | |
| 165 | + carInfo.setCarLeft(carInfo.getCarLeft() != null ? carInfo.getCarLeft() + ";" + uploadFile(file) : uploadFile(file)); | |
| 157 | 166 | } |
| 158 | 167 | for (MultipartFile file : carBehindFiles) { |
| 159 | - carInfo.setCarBehind(carInfo.getCarBehind()!=null?carInfo.getCarBehind()+";"+uploadFile(file):uploadFile(file)); | |
| 168 | + carInfo.setCarBehind(carInfo.getCarBehind() != null ? carInfo.getCarBehind() + ";" + uploadFile(file) : uploadFile(file)); | |
| 160 | 169 | } |
| 161 | 170 | for (MultipartFile file : carRightFiles) { |
| 162 | - carInfo.setCarRight(carInfo.getCarRight()!=null?carInfo.getCarRight()+";"+uploadFile(file):uploadFile(file)); | |
| 171 | + carInfo.setCarRight(carInfo.getCarRight() != null ? carInfo.getCarRight() + ";" + uploadFile(file) : uploadFile(file)); | |
| 163 | 172 | } |
| 164 | 173 | carInfo.setRoadTransport(removeSemicolon(carInfo.getRoadTransport())); |
| 165 | 174 | carInfo.setDrivingLicense(removeSemicolon(carInfo.getDrivingLicense())); |
| ... | ... | @@ -175,7 +184,7 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 175 | 184 | for (String driver : Drivers) { |
| 176 | 185 | CarDriverRelation carDriverRelation = new CarDriverRelation(); |
| 177 | 186 | carDriverRelation.setCarId(carInfo.getId()); |
| 178 | - carDriverRelation.setDriverId(Long.parseLong(driver)); | |
| 187 | + carDriverRelation.setDriverId((driver)); | |
| 179 | 188 | carInfoMapper.addCarDriverRelation(carDriverRelation); |
| 180 | 189 | } |
| 181 | 190 | return carInfoMapper.updateCarInfo(carInfo); |
| ... | ... | @@ -183,25 +192,23 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 183 | 192 | |
| 184 | 193 | /** |
| 185 | 194 | * 批量删除运输车辆管理 |
| 186 | - * | |
| 195 | + * | |
| 187 | 196 | * @param ids 需要删除的运输车辆管理ID |
| 188 | 197 | * @return 结果 |
| 189 | 198 | */ |
| 190 | 199 | @Override |
| 191 | - public int deleteCarInfoByIds(Long[] ids) | |
| 192 | - { | |
| 200 | + public int deleteCarInfoByIds(Long[] ids) { | |
| 193 | 201 | return carInfoMapper.deleteCarInfoByIds(ids); |
| 194 | 202 | } |
| 195 | 203 | |
| 196 | 204 | /** |
| 197 | 205 | * 删除运输车辆管理信息 |
| 198 | - * | |
| 206 | + * | |
| 199 | 207 | * @param id 运输车辆管理ID |
| 200 | 208 | * @return 结果 |
| 201 | 209 | */ |
| 202 | 210 | @Override |
| 203 | - public int deleteCarInfoById(Long id) | |
| 204 | - { | |
| 211 | + public int deleteCarInfoById(Long id) { | |
| 205 | 212 | return carInfoMapper.deleteCarInfoById(id); |
| 206 | 213 | } |
| 207 | 214 | |
| ... | ... | @@ -220,7 +227,7 @@ public class CarInfoServiceImpl implements ICarInfoService |
| 220 | 227 | } |
| 221 | 228 | |
| 222 | 229 | //去掉第一个分号,如果有的话 |
| 223 | - public String removeSemicolon(String str){ | |
| 230 | + public String removeSemicolon(String str) { | |
| 224 | 231 | if (str.startsWith(";")) |
| 225 | 232 | str = str.substring(1); |
| 226 | 233 | if (str.equals("")) | ... | ... |
trash-unit/src/main/java/com/trash/driver/controller/DriverController.java
| ... | ... | @@ -68,7 +68,7 @@ public class DriverController extends BaseController |
| 68 | 68 | */ |
| 69 | 69 | @PreAuthorize("@ss.hasPermi('unit:driver:query')") |
| 70 | 70 | @GetMapping(value = "/{id}") |
| 71 | - public AjaxResult getInfo(@PathVariable("id") Long id) | |
| 71 | + public AjaxResult getInfo(@PathVariable("id") String id) | |
| 72 | 72 | { |
| 73 | 73 | return AjaxResult.success(driverService.selectDriverById(id)); |
| 74 | 74 | } | ... | ... |
trash-unit/src/main/java/com/trash/driver/domain/Driver.java
| ... | ... | @@ -18,7 +18,7 @@ public class Driver extends BaseEntity |
| 18 | 18 | private static final long serialVersionUID = 1L; |
| 19 | 19 | |
| 20 | 20 | /** $column.columnComment */ |
| 21 | - private Long id; | |
| 21 | + private String id; | |
| 22 | 22 | |
| 23 | 23 | /** 驾驶员名称 */ |
| 24 | 24 | @Excel(name = "驾驶员名称") |
| ... | ... | @@ -30,7 +30,7 @@ public class Driver extends BaseEntity |
| 30 | 30 | |
| 31 | 31 | /** 所属公司 */ |
| 32 | 32 | @Excel(name = "所属公司") |
| 33 | - private Long companyId; | |
| 33 | + private String companyId; | |
| 34 | 34 | |
| 35 | 35 | /** 从业资格证有效期起 */ |
| 36 | 36 | @JsonFormat(pattern = "yyyy-MM-dd") |
| ... | ... | @@ -95,12 +95,12 @@ public class Driver extends BaseEntity |
| 95 | 95 | this.phoneNo = phoneNo; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - public void setId(Long id) | |
| 98 | + public void setId(String id) | |
| 99 | 99 | { |
| 100 | 100 | this.id = id; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - public Long getId() | |
| 103 | + public String getId() | |
| 104 | 104 | { |
| 105 | 105 | return id; |
| 106 | 106 | } |
| ... | ... | @@ -122,12 +122,12 @@ public class Driver extends BaseEntity |
| 122 | 122 | { |
| 123 | 123 | return identityCard; |
| 124 | 124 | } |
| 125 | - public void setCompanyId(Long companyId) | |
| 125 | + public void setCompanyId(String companyId) | |
| 126 | 126 | { |
| 127 | 127 | this.companyId = companyId; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - public Long getCompanyId() | |
| 130 | + public String getCompanyId() | |
| 131 | 131 | { |
| 132 | 132 | return companyId; |
| 133 | 133 | } | ... | ... |
trash-unit/src/main/java/com/trash/driver/mapper/DriverMapper.java
| ... | ... | @@ -3,6 +3,7 @@ package com.trash.driver.mapper; |
| 3 | 3 | import java.util.List; |
| 4 | 4 | import java.util.Map; |
| 5 | 5 | |
| 6 | +import com.trash.carInfo.domain.CarDriverRelation; | |
| 6 | 7 | import com.trash.driver.domain.Driver; |
| 7 | 8 | import com.trash.driver.domain.vo.DriverVo; |
| 8 | 9 | |
| ... | ... | @@ -20,7 +21,7 @@ public interface DriverMapper |
| 20 | 21 | * @param id 驾驶员管理ID |
| 21 | 22 | * @return 驾驶员管理 |
| 22 | 23 | */ |
| 23 | - Driver selectDriverById(Long id); | |
| 24 | + Driver selectDriverById(String id); | |
| 24 | 25 | |
| 25 | 26 | /** |
| 26 | 27 | * 查询驾驶员管理列表 |
| ... | ... | @@ -37,6 +38,8 @@ public interface DriverMapper |
| 37 | 38 | */ |
| 38 | 39 | List<Map<Object,Object>> selectDriverListByCompanyId(String companyId); |
| 39 | 40 | |
| 41 | + int carDriverRelationCount(CarDriverRelation carDriverRelation); | |
| 42 | + | |
| 40 | 43 | /** |
| 41 | 44 | * 新增驾驶员管理 |
| 42 | 45 | * |
| ... | ... | @@ -44,6 +47,9 @@ public interface DriverMapper |
| 44 | 47 | * @return 结果 |
| 45 | 48 | */ |
| 46 | 49 | int insertDriver(Driver driver); |
| 50 | + int saveDriver(Driver driver); | |
| 51 | + | |
| 52 | + int insertCarDriverRelation(CarDriverRelation carDriverRelation); | |
| 47 | 53 | |
| 48 | 54 | /** |
| 49 | 55 | * 修改驾驶员管理 | ... | ... |
trash-unit/src/main/java/com/trash/driver/service/IDriverService.java
| ... | ... | @@ -22,7 +22,7 @@ public interface IDriverService |
| 22 | 22 | * @param id 驾驶员管理ID |
| 23 | 23 | * @return 驾驶员管理 |
| 24 | 24 | */ |
| 25 | - Driver selectDriverById(Long id); | |
| 25 | + Driver selectDriverById(String id); | |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * 查询驾驶员管理列表 |
| ... | ... | @@ -57,6 +57,10 @@ public interface IDriverService |
| 57 | 57 | MultipartFile[] photographTwoFiles, |
| 58 | 58 | Driver driver) throws IOException; |
| 59 | 59 | |
| 60 | + int save(Driver driver,String carId); | |
| 61 | + | |
| 62 | + int updateById(Driver driver,String carId); | |
| 63 | + | |
| 60 | 64 | /** |
| 61 | 65 | * 修改驾驶员管理 |
| 62 | 66 | * | ... | ... |
trash-unit/src/main/java/com/trash/driver/service/impl/DriverServiceImpl.java
| ... | ... | @@ -4,10 +4,13 @@ import java.io.IOException; |
| 4 | 4 | import java.util.List; |
| 5 | 5 | import java.util.Map; |
| 6 | 6 | |
| 7 | +import com.trash.carInfo.domain.CarDriverRelation; | |
| 7 | 8 | import com.trash.common.config.trashConfig; |
| 8 | 9 | import com.trash.common.utils.DateUtils; |
| 9 | 10 | import com.trash.common.utils.SecurityUtils; |
| 10 | 11 | import com.trash.driver.domain.vo.DriverVo; |
| 12 | +import org.slf4j.Logger; | |
| 13 | +import org.slf4j.LoggerFactory; | |
| 11 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 15 | import org.springframework.stereotype.Service; |
| 13 | 16 | import com.trash.driver.mapper.DriverMapper; |
| ... | ... | @@ -19,37 +22,35 @@ import static com.trash.common.utils.file.FileUploadUtils.upload; |
| 19 | 22 | |
| 20 | 23 | /** |
| 21 | 24 | * 驾驶员管理Service业务层处理 |
| 22 | - * | |
| 25 | + * | |
| 23 | 26 | * @author trash |
| 24 | 27 | * @date 2023-11-21 |
| 25 | 28 | */ |
| 26 | 29 | @Service |
| 27 | -public class DriverServiceImpl implements IDriverService | |
| 28 | -{ | |
| 30 | +public class DriverServiceImpl implements IDriverService { | |
| 31 | + private static final Logger log = LoggerFactory.getLogger(DriverServiceImpl.class); | |
| 29 | 32 | @Autowired |
| 30 | 33 | private DriverMapper driverMapper; |
| 31 | 34 | |
| 32 | 35 | /** |
| 33 | 36 | * 查询驾驶员管理 |
| 34 | - * | |
| 37 | + * | |
| 35 | 38 | * @param id 驾驶员管理ID |
| 36 | 39 | * @return 驾驶员管理 |
| 37 | 40 | */ |
| 38 | 41 | @Override |
| 39 | - public Driver selectDriverById(Long id) | |
| 40 | - { | |
| 42 | + public Driver selectDriverById(String id) { | |
| 41 | 43 | return driverMapper.selectDriverById(id); |
| 42 | 44 | } |
| 43 | 45 | |
| 44 | 46 | /** |
| 45 | 47 | * 查询驾驶员管理列表 |
| 46 | - * | |
| 48 | + * | |
| 47 | 49 | * @param driver 驾驶员管理 |
| 48 | 50 | * @return 驾驶员管理 |
| 49 | 51 | */ |
| 50 | 52 | @Override |
| 51 | - public List<DriverVo> selectDriverList(DriverVo driver) | |
| 52 | - { | |
| 53 | + public List<DriverVo> selectDriverList(DriverVo driver) { | |
| 53 | 54 | return driverMapper.selectDriverList(driver); |
| 54 | 55 | } |
| 55 | 56 | |
| ... | ... | @@ -75,19 +76,19 @@ public class DriverServiceImpl implements IDriverService |
| 75 | 76 | driver.setCreateBy(SecurityUtils.getUsername()); |
| 76 | 77 | driver.setStatus(0); |
| 77 | 78 | for (MultipartFile file : drivingLicenceFiles) { |
| 78 | - driver.setDrivingLicence(driver.getDrivingLicence()!=null?driver.getDrivingLicence()+";"+uploadFile(file):uploadFile(file)); | |
| 79 | + driver.setDrivingLicence(driver.getDrivingLicence() != null ? driver.getDrivingLicence() + ";" + uploadFile(file) : uploadFile(file)); | |
| 79 | 80 | } |
| 80 | 81 | for (MultipartFile file : professionalQualificationFiles) { |
| 81 | - driver.setProfessionalQualification(driver.getProfessionalQualification()!=null?driver.getProfessionalQualification()+";"+uploadFile(file):uploadFile(file)); | |
| 82 | + driver.setProfessionalQualification(driver.getProfessionalQualification() != null ? driver.getProfessionalQualification() + ";" + uploadFile(file) : uploadFile(file)); | |
| 82 | 83 | } |
| 83 | 84 | for (MultipartFile file : safetyTrainingFiles) { |
| 84 | - driver.setSafetyTraining(driver.getSafetyTraining()!=null?driver.getSafetyTraining()+";"+uploadFile(file):uploadFile(file)); | |
| 85 | + driver.setSafetyTraining(driver.getSafetyTraining() != null ? driver.getSafetyTraining() + ";" + uploadFile(file) : uploadFile(file)); | |
| 85 | 86 | } |
| 86 | 87 | for (MultipartFile file : photographOneFiles) { |
| 87 | - driver.setPhotographOne(driver.getPhotographOne()!=null?driver.getPhotographOne()+";"+uploadFile(file):uploadFile(file)); | |
| 88 | + driver.setPhotographOne(driver.getPhotographOne() != null ? driver.getPhotographOne() + ";" + uploadFile(file) : uploadFile(file)); | |
| 88 | 89 | } |
| 89 | 90 | for (MultipartFile file : photographTwoFiles) { |
| 90 | - driver.setPhotographTwo(driver.getPhotographTwo()!=null?driver.getPhotographTwo()+";"+uploadFile(file):uploadFile(file)); | |
| 91 | + driver.setPhotographTwo(driver.getPhotographTwo() != null ? driver.getPhotographTwo() + ";" + uploadFile(file) : uploadFile(file)); | |
| 91 | 92 | } |
| 92 | 93 | driver.setDrivingLicence(removeSemicolon(driver.getDrivingLicence())); |
| 93 | 94 | driver.setProfessionalQualification(removeSemicolon(driver.getProfessionalQualification())); |
| ... | ... | @@ -97,6 +98,35 @@ public class DriverServiceImpl implements IDriverService |
| 97 | 98 | return driverMapper.insertDriver(driver); |
| 98 | 99 | } |
| 99 | 100 | |
| 101 | + @Override | |
| 102 | + public int save(Driver driver, String carId) { | |
| 103 | + saveCarDriver(driver.getId(), carId); | |
| 104 | + return driverMapper.saveDriver(driver); | |
| 105 | + } | |
| 106 | + | |
| 107 | + @Override | |
| 108 | + public int updateById(Driver driver, String carId) { | |
| 109 | + saveCarDriver(driver.getId(), carId); | |
| 110 | + int count = driverMapper.updateDriver(driver); | |
| 111 | + return count; | |
| 112 | + } | |
| 113 | + | |
| 114 | + | |
| 115 | + private void saveCarDriver(String drvierId, String carId) { | |
| 116 | + CarDriverRelation carDriverRelation = new CarDriverRelation(); | |
| 117 | + carDriverRelation.setDriverId(drvierId); | |
| 118 | + carDriverRelation.setCarId(carId); | |
| 119 | + | |
| 120 | + Integer count = driverMapper.carDriverRelationCount(carDriverRelation); | |
| 121 | + try { | |
| 122 | + if (count == 0) { | |
| 123 | + driverMapper.insertCarDriverRelation(carDriverRelation); | |
| 124 | + } | |
| 125 | + } catch (Exception e) { | |
| 126 | + log.error(e.getMessage(), e); | |
| 127 | + } | |
| 128 | + } | |
| 129 | + | |
| 100 | 130 | /** |
| 101 | 131 | * 修改驾驶员管理 |
| 102 | 132 | * |
| ... | ... | @@ -113,19 +143,19 @@ public class DriverServiceImpl implements IDriverService |
| 113 | 143 | driver.setUpdateTime(DateUtils.getNowDate()); |
| 114 | 144 | driver.setUpdateBy(SecurityUtils.getUsername()); |
| 115 | 145 | for (MultipartFile file : drivingLicenceFiles) { |
| 116 | - driver.setDrivingLicence(driver.getDrivingLicence()!=null?driver.getDrivingLicence()+";"+uploadFile(file):uploadFile(file)); | |
| 146 | + driver.setDrivingLicence(driver.getDrivingLicence() != null ? driver.getDrivingLicence() + ";" + uploadFile(file) : uploadFile(file)); | |
| 117 | 147 | } |
| 118 | 148 | for (MultipartFile file : professionalQualificationFiles) { |
| 119 | - driver.setProfessionalQualification(driver.getProfessionalQualification()!=null?driver.getProfessionalQualification()+";"+uploadFile(file):uploadFile(file)); | |
| 149 | + driver.setProfessionalQualification(driver.getProfessionalQualification() != null ? driver.getProfessionalQualification() + ";" + uploadFile(file) : uploadFile(file)); | |
| 120 | 150 | } |
| 121 | 151 | for (MultipartFile file : safetyTrainingFiles) { |
| 122 | - driver.setSafetyTraining(driver.getSafetyTraining()!=null?driver.getSafetyTraining()+";"+uploadFile(file):uploadFile(file)); | |
| 152 | + driver.setSafetyTraining(driver.getSafetyTraining() != null ? driver.getSafetyTraining() + ";" + uploadFile(file) : uploadFile(file)); | |
| 123 | 153 | } |
| 124 | 154 | for (MultipartFile file : photographOneFiles) { |
| 125 | - driver.setPhotographOne(driver.getPhotographOne()!=null?driver.getPhotographOne()+";"+uploadFile(file):uploadFile(file)); | |
| 155 | + driver.setPhotographOne(driver.getPhotographOne() != null ? driver.getPhotographOne() + ";" + uploadFile(file) : uploadFile(file)); | |
| 126 | 156 | } |
| 127 | 157 | for (MultipartFile file : photographTwoFiles) { |
| 128 | - driver.setPhotographTwo(driver.getPhotographTwo()!=null?driver.getPhotographTwo()+";"+uploadFile(file):uploadFile(file)); | |
| 158 | + driver.setPhotographTwo(driver.getPhotographTwo() != null ? driver.getPhotographTwo() + ";" + uploadFile(file) : uploadFile(file)); | |
| 129 | 159 | } |
| 130 | 160 | driver.setDrivingLicence(removeSemicolon(driver.getDrivingLicence())); |
| 131 | 161 | driver.setProfessionalQualification(removeSemicolon(driver.getProfessionalQualification())); |
| ... | ... | @@ -137,25 +167,23 @@ public class DriverServiceImpl implements IDriverService |
| 137 | 167 | |
| 138 | 168 | /** |
| 139 | 169 | * 批量删除驾驶员管理 |
| 140 | - * | |
| 170 | + * | |
| 141 | 171 | * @param ids 需要删除的驾驶员管理ID |
| 142 | 172 | * @return 结果 |
| 143 | 173 | */ |
| 144 | 174 | @Override |
| 145 | - public int deleteDriverByIds(Long[] ids) | |
| 146 | - { | |
| 175 | + public int deleteDriverByIds(Long[] ids) { | |
| 147 | 176 | return driverMapper.deleteDriverByIds(ids); |
| 148 | 177 | } |
| 149 | 178 | |
| 150 | 179 | /** |
| 151 | 180 | * 删除驾驶员管理信息 |
| 152 | - * | |
| 181 | + * | |
| 153 | 182 | * @param id 驾驶员管理ID |
| 154 | 183 | * @return 结果 |
| 155 | 184 | */ |
| 156 | 185 | @Override |
| 157 | - public int deleteDriverById(Long id) | |
| 158 | - { | |
| 186 | + public int deleteDriverById(Long id) { | |
| 159 | 187 | return driverMapper.deleteDriverById(id); |
| 160 | 188 | } |
| 161 | 189 | |
| ... | ... | @@ -174,7 +202,7 @@ public class DriverServiceImpl implements IDriverService |
| 174 | 202 | } |
| 175 | 203 | |
| 176 | 204 | //去掉第一个分号,如果有的话 |
| 177 | - public String removeSemicolon(String str){ | |
| 205 | + public String removeSemicolon(String str) { | |
| 178 | 206 | if (str.startsWith(";")) |
| 179 | 207 | str = str.substring(1); |
| 180 | 208 | if (str.equals("")) | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/controller/TransportationEnterpriseController.java
| ... | ... | @@ -58,7 +58,7 @@ public class TransportationEnterpriseController extends BaseController |
| 58 | 58 | */ |
| 59 | 59 | @PreAuthorize("@ss.hasPermi('unit:enterprise:query')") |
| 60 | 60 | @GetMapping(value = "/{id}") |
| 61 | - public AjaxResult getInfo(@PathVariable("id") Long id) | |
| 61 | + public AjaxResult getInfo(@PathVariable("id") String id) | |
| 62 | 62 | { |
| 63 | 63 | return AjaxResult.success(transportationEnterpriseService.selectTransportationEnterpriseById(id)); |
| 64 | 64 | } | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/domain/TransportationEnterprise.java
| ... | ... | @@ -20,7 +20,7 @@ public class TransportationEnterprise extends BaseEntity |
| 20 | 20 | private static final long serialVersionUID = 1L; |
| 21 | 21 | |
| 22 | 22 | /** $column.columnComment */ |
| 23 | - private Long id; | |
| 23 | + private String id; | |
| 24 | 24 | |
| 25 | 25 | /** 企业名称 */ |
| 26 | 26 | @Excel(name = "企业名称") |
| ... | ... | @@ -179,12 +179,12 @@ public class TransportationEnterprise extends BaseEntity |
| 179 | 179 | this.servicePhone = servicePhone; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - public void setId(Long id) | |
| 182 | + public void setId(String id) | |
| 183 | 183 | { |
| 184 | 184 | this.id = id; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - public Long getId() | |
| 187 | + public String getId() | |
| 188 | 188 | { |
| 189 | 189 | return id; |
| 190 | 190 | } | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/mapper/TransportationEnterpriseMapper.java
| ... | ... | @@ -18,7 +18,9 @@ public interface TransportationEnterpriseMapper |
| 18 | 18 | * @param id 运输企业管理ID |
| 19 | 19 | * @return 运输企业管理 |
| 20 | 20 | */ |
| 21 | - TransportationEnterprise selectTransportationEnterpriseById(Long id); | |
| 21 | + TransportationEnterprise selectTransportationEnterpriseById(String id); | |
| 22 | + | |
| 23 | + TransportationEnterprise selectTransportationEnterpriseByIdStr(String id); | |
| 22 | 24 | |
| 23 | 25 | /** |
| 24 | 26 | * 查询运输企业管理列表 |
| ... | ... | @@ -37,6 +39,15 @@ public interface TransportationEnterpriseMapper |
| 37 | 39 | int insertTransportationEnterprise(TransportationEnterprise transportationEnterprise); |
| 38 | 40 | |
| 39 | 41 | /** |
| 42 | + * 新增运输企业管理 | |
| 43 | + * | |
| 44 | + * @param transportationEnterprise 运输企业管理 | |
| 45 | + * @return 结果 | |
| 46 | + */ | |
| 47 | + int saveTransportationEnterprise(TransportationEnterprise transportationEnterprise); | |
| 48 | + | |
| 49 | + | |
| 50 | + /** | |
| 40 | 51 | * 修改运输企业管理 |
| 41 | 52 | * |
| 42 | 53 | * @param transportationEnterprise 运输企业管理 | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/service/ITransportationEnterpriseService.java
| ... | ... | @@ -19,7 +19,9 @@ public interface ITransportationEnterpriseService |
| 19 | 19 | * @param id 运输企业管理ID |
| 20 | 20 | * @return 运输企业管理 |
| 21 | 21 | */ |
| 22 | - TransportationEnterprise selectTransportationEnterpriseById(Long id); | |
| 22 | + TransportationEnterprise selectTransportationEnterpriseById(String id); | |
| 23 | + | |
| 24 | + TransportationEnterprise selectTransportationEnterpriseByIdStr(String id); | |
| 23 | 25 | |
| 24 | 26 | /** |
| 25 | 27 | * 查询运输企业管理列表 |
| ... | ... | @@ -48,6 +50,8 @@ public interface ITransportationEnterpriseService |
| 48 | 50 | MultipartFile[] companyLogoFiles, |
| 49 | 51 | TransportationEnterprise transportationEnterprise) throws IOException; |
| 50 | 52 | |
| 53 | + int save(TransportationEnterprise transportationEnterprise); | |
| 54 | + | |
| 51 | 55 | /** |
| 52 | 56 | * 修改运输企业管理 |
| 53 | 57 | * |
| ... | ... | @@ -67,6 +71,8 @@ public interface ITransportationEnterpriseService |
| 67 | 71 | MultipartFile[] companyLogoFiles, |
| 68 | 72 | TransportationEnterprise transportationEnterprise) throws IOException; |
| 69 | 73 | |
| 74 | + int updateById(TransportationEnterprise transportationEnterprise); | |
| 75 | + | |
| 70 | 76 | /** |
| 71 | 77 | * 批量删除运输企业管理 |
| 72 | 78 | * | ... | ... |
trash-unit/src/main/java/com/trash/enterprise/service/impl/TransportationEnterpriseServiceImpl.java
| ... | ... | @@ -17,37 +17,39 @@ import static com.trash.common.utils.file.FileUploadUtils.upload; |
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * 运输企业管理Service业务层处理 |
| 20 | - * | |
| 20 | + * | |
| 21 | 21 | * @author trash |
| 22 | 22 | * @date 2023-11-21 |
| 23 | 23 | */ |
| 24 | 24 | @Service |
| 25 | -public class TransportationEnterpriseServiceImpl implements ITransportationEnterpriseService | |
| 26 | -{ | |
| 25 | +public class TransportationEnterpriseServiceImpl implements ITransportationEnterpriseService { | |
| 27 | 26 | @Autowired |
| 28 | 27 | private TransportationEnterpriseMapper transportationEnterpriseMapper; |
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * 查询运输企业管理 |
| 32 | - * | |
| 31 | + * | |
| 33 | 32 | * @param id 运输企业管理ID |
| 34 | 33 | * @return 运输企业管理 |
| 35 | 34 | */ |
| 36 | 35 | @Override |
| 37 | - public TransportationEnterprise selectTransportationEnterpriseById(Long id) | |
| 38 | - { | |
| 36 | + public TransportationEnterprise selectTransportationEnterpriseById(String id) { | |
| 39 | 37 | return transportationEnterpriseMapper.selectTransportationEnterpriseById(id); |
| 40 | 38 | } |
| 41 | 39 | |
| 40 | + @Override | |
| 41 | + public TransportationEnterprise selectTransportationEnterpriseByIdStr(String id) { | |
| 42 | + return transportationEnterpriseMapper.selectTransportationEnterpriseByIdStr(id); | |
| 43 | + } | |
| 44 | + | |
| 42 | 45 | /** |
| 43 | 46 | * 查询运输企业管理列表 |
| 44 | - * | |
| 47 | + * | |
| 45 | 48 | * @param transportationEnterprise 运输企业管理 |
| 46 | 49 | * @return 运输企业管理 |
| 47 | 50 | */ |
| 48 | 51 | @Override |
| 49 | - public List<TransportationEnterprise> selectTransportationEnterpriseList(TransportationEnterprise transportationEnterprise) | |
| 50 | - { | |
| 52 | + public List<TransportationEnterprise> selectTransportationEnterpriseList(TransportationEnterprise transportationEnterprise) { | |
| 51 | 53 | return transportationEnterpriseMapper.selectTransportationEnterpriseList(transportationEnterprise); |
| 52 | 54 | } |
| 53 | 55 | |
| ... | ... | @@ -69,22 +71,22 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 69 | 71 | transportationEnterprise.setStatus(0); |
| 70 | 72 | transportationEnterprise.setCreditStatus("正常"); |
| 71 | 73 | for (MultipartFile file : transportPermissionFiles) { |
| 72 | - transportationEnterprise.setTransportPermission(transportationEnterprise.getTransportPermission()!=null?transportationEnterprise.getTransportPermission()+";"+upload(file):upload(file)); | |
| 74 | + transportationEnterprise.setTransportPermission(transportationEnterprise.getTransportPermission() != null ? transportationEnterprise.getTransportPermission() + ";" + upload(file) : upload(file)); | |
| 73 | 75 | } |
| 74 | 76 | for (MultipartFile file : enterpriseBusinessLicenseFiles) { |
| 75 | - transportationEnterprise.setEnterpriseBusinessLicense(transportationEnterprise.getEnterpriseBusinessLicense()!=null?transportationEnterprise.getEnterpriseBusinessLicense()+";"+upload(file):upload(file)); | |
| 77 | + transportationEnterprise.setEnterpriseBusinessLicense(transportationEnterprise.getEnterpriseBusinessLicense() != null ? transportationEnterprise.getEnterpriseBusinessLicense() + ";" + upload(file) : upload(file)); | |
| 76 | 78 | } |
| 77 | 79 | for (MultipartFile file : safetyOfficerQualificationCertificateFiles) { |
| 78 | - transportationEnterprise.setSafetyOfficerQualificationCertificate(transportationEnterprise.getSafetyOfficerQualificationCertificate()!=null?transportationEnterprise.getSafetyOfficerQualificationCertificate()+";"+upload(file):upload(file)); | |
| 80 | + transportationEnterprise.setSafetyOfficerQualificationCertificate(transportationEnterprise.getSafetyOfficerQualificationCertificate() != null ? transportationEnterprise.getSafetyOfficerQualificationCertificate() + ";" + upload(file) : upload(file)); | |
| 79 | 81 | } |
| 80 | 82 | for (MultipartFile file : safetyCertificateFiles) { |
| 81 | - transportationEnterprise.setSafetyCertificate(transportationEnterprise.getSafetyCertificate()!=null?transportationEnterprise.getSafetyCertificate()+";"+upload(file):upload(file)); | |
| 83 | + transportationEnterprise.setSafetyCertificate(transportationEnterprise.getSafetyCertificate() != null ? transportationEnterprise.getSafetyCertificate() + ";" + upload(file) : upload(file)); | |
| 82 | 84 | } |
| 83 | 85 | for (MultipartFile file : carParkPanoramaFiles) { |
| 84 | - transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama()!=null?transportationEnterprise.getCarParkPanorama()+";"+upload(file):upload(file)); | |
| 86 | + transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama() != null ? transportationEnterprise.getCarParkPanorama() + ";" + upload(file) : upload(file)); | |
| 85 | 87 | } |
| 86 | 88 | for (MultipartFile file : companyLogoFiles) { |
| 87 | - transportationEnterprise.setCompanyLogo(transportationEnterprise.getCompanyLogo()!=null?transportationEnterprise.getCompanyLogo()+";"+upload(file):upload(file)); | |
| 89 | + transportationEnterprise.setCompanyLogo(transportationEnterprise.getCompanyLogo() != null ? transportationEnterprise.getCompanyLogo() + ";" + upload(file) : upload(file)); | |
| 88 | 90 | } |
| 89 | 91 | //去掉第一个分号,如果有的话 |
| 90 | 92 | transportationEnterprise.setTransportPermission(removeSemicolon(transportationEnterprise.getTransportPermission())); |
| ... | ... | @@ -96,6 +98,11 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 96 | 98 | return transportationEnterpriseMapper.insertTransportationEnterprise(transportationEnterprise); |
| 97 | 99 | } |
| 98 | 100 | |
| 101 | + @Override | |
| 102 | + public int save(TransportationEnterprise transportationEnterprise) { | |
| 103 | + return transportationEnterpriseMapper.saveTransportationEnterprise(transportationEnterprise); | |
| 104 | + } | |
| 105 | + | |
| 99 | 106 | /** |
| 100 | 107 | * 修改运输企业管理 |
| 101 | 108 | * |
| ... | ... | @@ -112,22 +119,22 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 112 | 119 | transportationEnterprise.setUpdateTime(DateUtils.getNowDate()); |
| 113 | 120 | transportationEnterprise.setUpdateBy(SecurityUtils.getUsername()); |
| 114 | 121 | for (MultipartFile file : transportPermissionFiles) { |
| 115 | - transportationEnterprise.setTransportPermission(transportationEnterprise.getTransportPermission()!=null?transportationEnterprise.getTransportPermission()+";"+upload(file):upload(file)); | |
| 122 | + transportationEnterprise.setTransportPermission(transportationEnterprise.getTransportPermission() != null ? transportationEnterprise.getTransportPermission() + ";" + upload(file) : upload(file)); | |
| 116 | 123 | } |
| 117 | 124 | for (MultipartFile file : enterpriseBusinessLicenseFiles) { |
| 118 | - transportationEnterprise.setEnterpriseBusinessLicense(transportationEnterprise.getEnterpriseBusinessLicense()!=null?transportationEnterprise.getEnterpriseBusinessLicense()+";"+upload(file):upload(file)); | |
| 125 | + transportationEnterprise.setEnterpriseBusinessLicense(transportationEnterprise.getEnterpriseBusinessLicense() != null ? transportationEnterprise.getEnterpriseBusinessLicense() + ";" + upload(file) : upload(file)); | |
| 119 | 126 | } |
| 120 | 127 | for (MultipartFile file : safetyOfficerQualificationCertificateFiles) { |
| 121 | - transportationEnterprise.setSafetyOfficerQualificationCertificate(transportationEnterprise.getSafetyOfficerQualificationCertificate()!=null?transportationEnterprise.getSafetyOfficerQualificationCertificate()+";"+upload(file):upload(file)); | |
| 128 | + transportationEnterprise.setSafetyOfficerQualificationCertificate(transportationEnterprise.getSafetyOfficerQualificationCertificate() != null ? transportationEnterprise.getSafetyOfficerQualificationCertificate() + ";" + upload(file) : upload(file)); | |
| 122 | 129 | } |
| 123 | 130 | for (MultipartFile file : safetyCertificateFiles) { |
| 124 | - transportationEnterprise.setSafetyCertificate(transportationEnterprise.getSafetyCertificate()!=null?transportationEnterprise.getSafetyCertificate()+";"+upload(file):upload(file)); | |
| 131 | + transportationEnterprise.setSafetyCertificate(transportationEnterprise.getSafetyCertificate() != null ? transportationEnterprise.getSafetyCertificate() + ";" + upload(file) : upload(file)); | |
| 125 | 132 | } |
| 126 | 133 | for (MultipartFile file : carParkPanoramaFiles) { |
| 127 | - transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama()!=null?transportationEnterprise.getCarParkPanorama()+";"+upload(file):upload(file)); | |
| 134 | + transportationEnterprise.setCarParkPanorama(transportationEnterprise.getCarParkPanorama() != null ? transportationEnterprise.getCarParkPanorama() + ";" + upload(file) : upload(file)); | |
| 128 | 135 | } |
| 129 | 136 | for (MultipartFile file : companyLogoFiles) { |
| 130 | - transportationEnterprise.setCompanyLogo(transportationEnterprise.getCompanyLogo()!=null?transportationEnterprise.getCompanyLogo()+";"+upload(file):upload(file)); | |
| 137 | + transportationEnterprise.setCompanyLogo(transportationEnterprise.getCompanyLogo() != null ? transportationEnterprise.getCompanyLogo() + ";" + upload(file) : upload(file)); | |
| 131 | 138 | } |
| 132 | 139 | transportationEnterprise.setTransportPermission(removeSemicolon(transportationEnterprise.getTransportPermission())); |
| 133 | 140 | transportationEnterprise.setEnterpriseBusinessLicense(removeSemicolon(transportationEnterprise.getEnterpriseBusinessLicense())); |
| ... | ... | @@ -138,27 +145,31 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 138 | 145 | return transportationEnterpriseMapper.updateTransportationEnterprise(transportationEnterprise); |
| 139 | 146 | } |
| 140 | 147 | |
| 148 | + | |
| 149 | + @Override | |
| 150 | + public int updateById(TransportationEnterprise transportationEnterprise) { | |
| 151 | + return transportationEnterpriseMapper.updateTransportationEnterprise(transportationEnterprise); | |
| 152 | + } | |
| 153 | + | |
| 141 | 154 | /** |
| 142 | 155 | * 批量删除运输企业管理 |
| 143 | - * | |
| 156 | + * | |
| 144 | 157 | * @param ids 需要删除的运输企业管理ID |
| 145 | 158 | * @return 结果 |
| 146 | 159 | */ |
| 147 | 160 | @Override |
| 148 | - public int deleteTransportationEnterpriseByIds(Long[] ids) | |
| 149 | - { | |
| 161 | + public int deleteTransportationEnterpriseByIds(Long[] ids) { | |
| 150 | 162 | return transportationEnterpriseMapper.deleteTransportationEnterpriseByIds(ids); |
| 151 | 163 | } |
| 152 | 164 | |
| 153 | 165 | /** |
| 154 | 166 | * 删除运输企业管理信息 |
| 155 | - * | |
| 167 | + * | |
| 156 | 168 | * @param id 运输企业管理ID |
| 157 | 169 | * @return 结果 |
| 158 | 170 | */ |
| 159 | 171 | @Override |
| 160 | - public int deleteTransportationEnterpriseById(Long id) | |
| 161 | - { | |
| 172 | + public int deleteTransportationEnterpriseById(Long id) { | |
| 162 | 173 | return transportationEnterpriseMapper.deleteTransportationEnterpriseById(id); |
| 163 | 174 | } |
| 164 | 175 | |
| ... | ... | @@ -177,7 +188,7 @@ public class TransportationEnterpriseServiceImpl implements ITransportationEnter |
| 177 | 188 | } |
| 178 | 189 | |
| 179 | 190 | //去掉第一个分号,如果有的话 |
| 180 | - public String removeSemicolon(String str){ | |
| 191 | + public String removeSemicolon(String str) { | |
| 181 | 192 | if (str.startsWith(";")) |
| 182 | 193 | str = str.substring(1); |
| 183 | 194 | if (str.equals("")) | ... | ... |
trash-unit/src/main/resources/mapper/unit/CarInfoMapper.xml
| ... | ... | @@ -181,6 +181,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 181 | 181 | <include refid="selectCarInfoVo"/> |
| 182 | 182 | where id = #{id} and is_del = 1 |
| 183 | 183 | </select> |
| 184 | + | |
| 185 | + <select id="selectCarInfoByIdStr" parameterType="String" resultMap="CarInfoResult"> | |
| 186 | + <include refid="selectCarInfoVo"/> | |
| 187 | + where id = #{id} | |
| 188 | + </select> | |
| 184 | 189 | |
| 185 | 190 | |
| 186 | 191 | <select id="selectByCompanyId" parameterType="Long" resultMap="CarInfoVoResult"> |
| ... | ... | @@ -257,6 +262,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 257 | 262 | </trim> |
| 258 | 263 | </insert> |
| 259 | 264 | |
| 265 | + | |
| 266 | + <insert id="saveCarInfo" parameterType="CarInfo" useGeneratedKeys="true" keyProperty="id"> | |
| 267 | + insert into car_info | |
| 268 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
| 269 | + <if test="id != null">id,</if> | |
| 270 | + <if test="companyId != null">company_id,</if> | |
| 271 | + <if test="carType != null">car_type,</if> | |
| 272 | + <if test="carCode != null">car_code,</if> | |
| 273 | + <if test="carBrank != null">car_brank,</if> | |
| 274 | + <if test="emissionStandard != null">emission_standard,</if> | |
| 275 | + <if test="roadTransportDate != null">road_transport_date,</if> | |
| 276 | + <if test="drivingLicenseDate != null">driving_license_date,</if> | |
| 277 | + <if test="enterDate != null">enter_date,</if> | |
| 278 | + <if test="farmeNumber != null">farme_number,</if> | |
| 279 | + <if test="carIdentification != null">car_identification,</if> | |
| 280 | + <if test="containerVolume != null">container_volume,</if> | |
| 281 | + <if test="carColor != null">car_color,</if> | |
| 282 | + <if test="carEquipment != null">car_equipment,</if> | |
| 283 | + <if test="remark != null">remark,</if> | |
| 284 | + <if test="roadTransport != null">road_transport,</if> | |
| 285 | + <if test="drivingLicense != null">driving_license,</if> | |
| 286 | + <if test="carFront != null">car_front,</if> | |
| 287 | + <if test="carLeft != null">car_left,</if> | |
| 288 | + <if test="carBehind != null">car_behind,</if> | |
| 289 | + <if test="carRight != null">car_right,</if> | |
| 290 | + <if test="drivers != null">drivers,</if> | |
| 291 | + <if test="status != null">status,</if> | |
| 292 | + <if test="createTime != null">create_time,</if> | |
| 293 | + <if test="createBy != null">create_by,</if> | |
| 294 | + <if test="updateTime != null">update_time,</if> | |
| 295 | + <if test="updateBy != null">update_by,</if> | |
| 296 | + <if test="creditStatus != null">credit_status,</if> | |
| 297 | + <if test="qrCode != null">qr_code,</if> | |
| 298 | + <if test="lengthWidthHeight != null">length_width_height,</if> | |
| 299 | + <if test="isDel != null">is_del,</if> | |
| 300 | + </trim> | |
| 301 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
| 302 | + <if test="id != null">#{id},</if> | |
| 303 | + <if test="companyId != null">#{companyId},</if> | |
| 304 | + <if test="carType != null">#{carType},</if> | |
| 305 | + <if test="carCode != null">#{carCode},</if> | |
| 306 | + <if test="carBrank != null">#{carBrank},</if> | |
| 307 | + <if test="emissionStandard != null">#{emissionStandard},</if> | |
| 308 | + <if test="roadTransportDate != null">#{roadTransportDate},</if> | |
| 309 | + <if test="drivingLicenseDate != null">#{drivingLicenseDate},</if> | |
| 310 | + <if test="enterDate != null">#{enterDate},</if> | |
| 311 | + <if test="farmeNumber != null">#{farmeNumber},</if> | |
| 312 | + <if test="carIdentification != null">#{carIdentification},</if> | |
| 313 | + <if test="containerVolume != null">#{containerVolume},</if> | |
| 314 | + <if test="carColor != null">#{carColor},</if> | |
| 315 | + <if test="carEquipment != null">#{carEquipment},</if> | |
| 316 | + <if test="remark != null">#{remark},</if> | |
| 317 | + <if test="roadTransport != null">#{roadTransport},</if> | |
| 318 | + <if test="drivingLicense != null">#{drivingLicense},</if> | |
| 319 | + <if test="carFront != null">#{carFront},</if> | |
| 320 | + <if test="carLeft != null">#{carLeft},</if> | |
| 321 | + <if test="carBehind != null">#{carBehind},</if> | |
| 322 | + <if test="carRight != null">#{carRight},</if> | |
| 323 | + <if test="drivers != null">#{drivers},</if> | |
| 324 | + <if test="status != null">#{status},</if> | |
| 325 | + <if test="createTime != null">#{createTime},</if> | |
| 326 | + <if test="createBy != null">#{createBy},</if> | |
| 327 | + <if test="updateTime != null">#{updateTime},</if> | |
| 328 | + <if test="updateBy != null">#{updateBy},</if> | |
| 329 | + <if test="creditStatus != null">#{creditStatus},</if> | |
| 330 | + <if test="qrCode != null">#{qrCode},</if> | |
| 331 | + <if test="lengthWidthHeight != null">#{lengthWidthHeight},</if> | |
| 332 | + <if test="isDel != null">#{isDel},</if> | |
| 333 | + </trim> | |
| 334 | + </insert> | |
| 335 | + | |
| 260 | 336 | <update id="updateCarInfo" parameterType="CarInfo"> |
| 261 | 337 | update car_info |
| 262 | 338 | <trim prefix="SET" suffixOverrides=","> |
| ... | ... | @@ -311,7 +387,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 311 | 387 | values(#{carId},#{driverId}) |
| 312 | 388 | </insert> |
| 313 | 389 | |
| 314 | - <delete id="deleteCarDriverRelationByCarId" parameterType="Long"> | |
| 390 | + <delete id="deleteCarDriverRelationByCarId" parameterType="String"> | |
| 315 | 391 | delete from car_driver_relation where car_id = #{carId} |
| 316 | 392 | </delete> |
| 317 | 393 | </mapper> |
| 318 | 394 | \ No newline at end of file | ... | ... |
trash-unit/src/main/resources/mapper/unit/DriverMapper.xml
| ... | ... | @@ -68,10 +68,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 68 | 68 | select id,name as label from driver where company_id = #{companyId} |
| 69 | 69 | </select> |
| 70 | 70 | |
| 71 | - <select id="selectDriverById" parameterType="Long" resultMap="DriverResult"> | |
| 71 | + <select id="selectDriverById" parameterType="String" resultMap="DriverResult"> | |
| 72 | 72 | <include refid="selectDriverVo"/> |
| 73 | 73 | where id = #{id} |
| 74 | 74 | </select> |
| 75 | + <select id="carDriverRelationCount" resultType="java.lang.Integer"> | |
| 76 | + select count(1) from car_driver_relation where car_id=#{carId} and driver_id=#{driverId} | |
| 77 | + </select> | |
| 75 | 78 | |
| 76 | 79 | <insert id="insertDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id"> |
| 77 | 80 | insert into driver |
| ... | ... | @@ -123,6 +126,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 123 | 126 | </trim> |
| 124 | 127 | </insert> |
| 125 | 128 | |
| 129 | + <insert id="saveDriver" parameterType="Driver" useGeneratedKeys="true" keyProperty="id"> | |
| 130 | + insert into driver | |
| 131 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
| 132 | + <if test="name != null">name,</if> | |
| 133 | + <if test="identityCard != null">identity_card,</if> | |
| 134 | + <if test="companyId != null">company_id,</if> | |
| 135 | + <if test="professionalQualificationBeginDate != null">professional_qualification_begin_date,</if> | |
| 136 | + <if test="professionalQualificationEndDate != null">professional_qualification_end_date,</if> | |
| 137 | + <if test="drivingLicenceBeginDate != null">driving_licence_begin_date,</if> | |
| 138 | + <if test="drivingLicenceEndDate != null">driving_licence_end_date,</if> | |
| 139 | + <if test="safetyTrainingDate != null">safety_training_date,</if> | |
| 140 | + <if test="safetyTrainingContent != null">safety_training_content,</if> | |
| 141 | + <if test="remark != null">remark,</if> | |
| 142 | + <if test="drivingLicence != null">driving_licence,</if> | |
| 143 | + <if test="professionalQualification != null">professional_qualification,</if> | |
| 144 | + <if test="safetyTraining != null">safety_training,</if> | |
| 145 | + <if test="status != null">status,</if> | |
| 146 | + <if test="createTime != null">create_time,</if> | |
| 147 | + <if test="createBy != null">create_by,</if> | |
| 148 | + <if test="updateTime != null">update_time,</if> | |
| 149 | + <if test="updateBy != null">update_by,</if> | |
| 150 | + <if test="photographOne != null">photograph_one,</if> | |
| 151 | + <if test="photographTwo != null">photograph_two,</if> | |
| 152 | + <if test="phoneNo != null">phoneNo,</if> | |
| 153 | + </trim> | |
| 154 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
| 155 | + <if test="name != null">#{name},</if> | |
| 156 | + <if test="identityCard != null">#{identityCard},</if> | |
| 157 | + <if test="companyId != null">#{companyId},</if> | |
| 158 | + <if test="professionalQualificationBeginDate != null">#{professionalQualificationBeginDate},</if> | |
| 159 | + <if test="professionalQualificationEndDate != null">#{professionalQualificationEndDate},</if> | |
| 160 | + <if test="drivingLicenceBeginDate != null">#{drivingLicenceBeginDate},</if> | |
| 161 | + <if test="drivingLicenceEndDate != null">#{drivingLicenceEndDate},</if> | |
| 162 | + <if test="safetyTrainingDate != null">#{safetyTrainingDate},</if> | |
| 163 | + <if test="safetyTrainingContent != null">#{safetyTrainingContent},</if> | |
| 164 | + <if test="remark != null">#{remark},</if> | |
| 165 | + <if test="drivingLicence != null">#{drivingLicence},</if> | |
| 166 | + <if test="professionalQualification != null">#{professionalQualification},</if> | |
| 167 | + <if test="safetyTraining != null">#{safetyTraining},</if> | |
| 168 | + <if test="status != null">#{status},</if> | |
| 169 | + <if test="createTime != null">#{createTime},</if> | |
| 170 | + <if test="createBy != null">#{createBy},</if> | |
| 171 | + <if test="updateTime != null">#{updateTime},</if> | |
| 172 | + <if test="updateBy != null">#{updateBy},</if> | |
| 173 | + <if test="photographOne != null">#{photographOne},</if> | |
| 174 | + <if test="photographTwo != null">#{photographTwo},</if> | |
| 175 | + <if test="phoneNo != null">#{phoneNo},</if> | |
| 176 | + </trim> | |
| 177 | + </insert> | |
| 178 | + <insert id="insertCarDriverRelation"> | |
| 179 | + insert into car_driver_relation(car_id,driver_id) values(#{carId},#{driverId}) | |
| 180 | + </insert> | |
| 181 | + | |
| 126 | 182 | <update id="updateDriver" parameterType="Driver"> |
| 127 | 183 | update driver |
| 128 | 184 | <trim prefix="SET" suffixOverrides=","> | ... | ... |
trash-unit/src/main/resources/mapper/unit/TransportationEnterpriseMapper.xml
| ... | ... | @@ -83,7 +83,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 83 | 83 | </where> |
| 84 | 84 | </select> |
| 85 | 85 | |
| 86 | - <select id="selectTransportationEnterpriseById" parameterType="Long" resultMap="TransportationEnterpriseResult"> | |
| 86 | + <select id="selectTransportationEnterpriseById" parameterType="String" resultMap="TransportationEnterpriseResult"> | |
| 87 | + <include refid="selectTransportationEnterpriseVo"/> | |
| 88 | + where id = #{id} | |
| 89 | + </select> | |
| 90 | + | |
| 91 | + <select id="selectTransportationEnterpriseByIdStr" parameterType="String" resultMap="TransportationEnterpriseResult"> | |
| 87 | 92 | <include refid="selectTransportationEnterpriseVo"/> |
| 88 | 93 | where id = #{id} |
| 89 | 94 | </select> |
| ... | ... | @@ -167,6 +172,87 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 167 | 172 | <if test="companyLogo != null">#{companyLogo},</if> |
| 168 | 173 | </trim> |
| 169 | 174 | </insert> |
| 175 | + <insert id="saveTransportationEnterprise"> | |
| 176 | + insert into transportation_enterprise | |
| 177 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
| 178 | + <if test="id != null">id,</if> | |
| 179 | + <if test="name != null">name,</if> | |
| 180 | + <if test="abbreviation != null">abbreviation,</if> | |
| 181 | + <if test="registrationArea != null">registration_area,</if> | |
| 182 | + <if test="transportPermissionDate != null">transport_permission_date,</if> | |
| 183 | + <if test="enterDate != null">enter_date,</if> | |
| 184 | + <if test="businessLicenseDate != null">business_license_date,</if> | |
| 185 | + <if test="officeAddress != null">office_address,</if> | |
| 186 | + <if test="parkingLotLocation != null">parking_lot_location,</if> | |
| 187 | + <if test="parkingArea != null">parking_area,</if> | |
| 188 | + <if test="carNumber != null">car_number,</if> | |
| 189 | + <if test="safetyManagerName != null">safety_manager_name,</if> | |
| 190 | + <if test="safetyManagerPhone != null">safety_manager_phone,</if> | |
| 191 | + <if test="socialUniformCreditCodeNumber != null">social_uniform_credit_code_number,</if> | |
| 192 | + <if test="legalRepresentative != null">legal_representative,</if> | |
| 193 | + <if test="legalRepresentativePhone != null">legal_representative_phone,</if> | |
| 194 | + <if test="safetyPeopleName != null">safety_people_name,</if> | |
| 195 | + <if test="remark != null">remark,</if> | |
| 196 | + <if test="transportPermission != null">transport_permission,</if> | |
| 197 | + <if test="enterpriseBusinessLicense != null">enterprise_business_license,</if> | |
| 198 | + <if test="safetyOfficerQualificationCertificate != null">safety_officer_qualification_certificate,</if> | |
| 199 | + <if test="safetyCertificate != null">safety_certificate,</if> | |
| 200 | + <if test="carParkPanorama != null">car_park_panorama,</if> | |
| 201 | + <if test="businessUnit != null">business_unit,</if> | |
| 202 | + <if test="status != null">status,</if> | |
| 203 | + <if test="createTime != null">create_time,</if> | |
| 204 | + <if test="createBy != null">create_by,</if> | |
| 205 | + <if test="updateTime != null">update_time,</if> | |
| 206 | + <if test="updateBy != null">update_by,</if> | |
| 207 | + <if test="parentId != null">parent_id,</if> | |
| 208 | + <if test="companyType != null">company_type,</if> | |
| 209 | + <if test="creditStatus != null">credit_status,</if> | |
| 210 | + <if test="qrCode != null">qr_code,</if> | |
| 211 | + <if test="servicePhone != null">service_phone,</if> | |
| 212 | + <if test="officeAddressGps != null">office_address_gps,</if> | |
| 213 | + <if test="offer != null">offer,</if> | |
| 214 | + <if test="companyLogo != null">company_logo,</if> | |
| 215 | + </trim> | |
| 216 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
| 217 | + <if test="id != null">#{id},</if> | |
| 218 | + <if test="name != null">#{name},</if> | |
| 219 | + <if test="abbreviation != null">#{abbreviation},</if> | |
| 220 | + <if test="registrationArea != null">#{registrationArea},</if> | |
| 221 | + <if test="transportPermissionDate != null">#{transportPermissionDate},</if> | |
| 222 | + <if test="enterDate != null">#{enterDate},</if> | |
| 223 | + <if test="businessLicenseDate != null">#{businessLicenseDate},</if> | |
| 224 | + <if test="officeAddress != null">#{officeAddress},</if> | |
| 225 | + <if test="parkingLotLocation != null">#{parkingLotLocation},</if> | |
| 226 | + <if test="parkingArea != null">#{parkingArea},</if> | |
| 227 | + <if test="carNumber != null">#{carNumber},</if> | |
| 228 | + <if test="safetyManagerName != null">#{safetyManagerName},</if> | |
| 229 | + <if test="safetyManagerPhone != null">#{safetyManagerPhone},</if> | |
| 230 | + <if test="socialUniformCreditCodeNumber != null">#{socialUniformCreditCodeNumber},</if> | |
| 231 | + <if test="legalRepresentative != null">#{legalRepresentative},</if> | |
| 232 | + <if test="legalRepresentativePhone != null">#{legalRepresentativePhone},</if> | |
| 233 | + <if test="safetyPeopleName != null">#{safetyPeopleName},</if> | |
| 234 | + <if test="remark != null">#{remark},</if> | |
| 235 | + <if test="transportPermission != null">#{transportPermission},</if> | |
| 236 | + <if test="enterpriseBusinessLicense != null">#{enterpriseBusinessLicense},</if> | |
| 237 | + <if test="safetyOfficerQualificationCertificate != null">#{safetyOfficerQualificationCertificate},</if> | |
| 238 | + <if test="safetyCertificate != null">#{safetyCertificate},</if> | |
| 239 | + <if test="carParkPanorama != null">#{carParkPanorama},</if> | |
| 240 | + <if test="businessUnit != null">#{businessUnit},</if> | |
| 241 | + <if test="status != null">#{status},</if> | |
| 242 | + <if test="createTime != null">#{createTime},</if> | |
| 243 | + <if test="createBy != null">#{createBy},</if> | |
| 244 | + <if test="updateTime != null">#{updateTime},</if> | |
| 245 | + <if test="updateBy != null">#{updateBy},</if> | |
| 246 | + <if test="parentId != null">#{parentId},</if> | |
| 247 | + <if test="companyType != null">#{companyType},</if> | |
| 248 | + <if test="creditStatus != null">#{creditStatus},</if> | |
| 249 | + <if test="qrCode != null">#{qrCode},</if> | |
| 250 | + <if test="servicePhone != null">#{servicePhone},</if> | |
| 251 | + <if test="officeAddressGps != null">#{officeAddressGps},</if> | |
| 252 | + <if test="offer != null">#{offer},</if> | |
| 253 | + <if test="companyLogo != null">#{companyLogo},</if> | |
| 254 | + </trim> | |
| 255 | + </insert> | |
| 170 | 256 | |
| 171 | 257 | <update id="updateTransportationEnterprise" parameterType="TransportationEnterprise"> |
| 172 | 258 | update transportation_enterprise | ... | ... |