Commit 6681806615abfa8aa439be234b486f97282337f5
1 parent
a6380ae9
装修垃圾清运 2025需求 1.0
Showing
20 changed files
with
1552 additions
and
61 deletions
trash-common/src/main/java/com/trash/common/utils/DateUtils.java
| ... | ... | @@ -3,6 +3,7 @@ package com.trash.common.utils; |
| 3 | 3 | import java.lang.management.ManagementFactory; |
| 4 | 4 | import java.text.ParseException; |
| 5 | 5 | import java.text.SimpleDateFormat; |
| 6 | +import java.util.Calendar; | |
| 6 | 7 | import java.util.Date; |
| 7 | 8 | import org.apache.commons.lang3.time.DateFormatUtils; |
| 8 | 9 | |
| ... | ... | @@ -22,6 +23,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils |
| 22 | 23 | public static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; |
| 23 | 24 | |
| 24 | 25 | public static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; |
| 26 | + | |
| 27 | + public static String HH_MM_SS = "HH:mm:ss"; | |
| 25 | 28 | |
| 26 | 29 | private static final String[] parsePatterns = { |
| 27 | 30 | "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM", |
| ... | ... | @@ -208,4 +211,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils |
| 208 | 211 | } |
| 209 | 212 | return year + month; |
| 210 | 213 | } |
| 214 | + | |
| 215 | + /** | |
| 216 | + * 获取10分钟前的时间 | |
| 217 | + * @param date 日期 | |
| 218 | + * @return 结果 | |
| 219 | + */ | |
| 220 | + public static Date getTenMinuteBefore(Date date) { | |
| 221 | + Calendar calendar = Calendar.getInstance(); | |
| 222 | + calendar.setTime(date); | |
| 223 | + calendar.add(Calendar.MINUTE, -10); | |
| 224 | + return calendar.getTime(); | |
| 225 | + } | |
| 211 | 226 | } | ... | ... |
trash-common/src/main/java/com/trash/common/utils/RemoteServerUtils.java
| ... | ... | @@ -101,6 +101,8 @@ public class RemoteServerUtils { |
| 101 | 101 | |
| 102 | 102 | public static String AREAS = "/api/gisservice/v2/jurisdictions/areas?dict=1"; |
| 103 | 103 | |
| 104 | + public static String EARTHSITES = "/api/siteservice/cs/earthsites/"; | |
| 105 | + | |
| 104 | 106 | public static JSONArray getUnitetransport(String id) { |
| 105 | 107 | JSONArray list = null; |
| 106 | 108 | try { |
| ... | ... | @@ -1311,7 +1313,6 @@ public class RemoteServerUtils { |
| 1311 | 1313 | |
| 1312 | 1314 | String token = SecurityUtils.getLoginUser().getToken(); |
| 1313 | 1315 | |
| 1314 | - | |
| 1315 | 1316 | if (token.contains("durable:")) { |
| 1316 | 1317 | token = "Bearer " + token; |
| 1317 | 1318 | } else { |
| ... | ... | @@ -1328,4 +1329,34 @@ public class RemoteServerUtils { |
| 1328 | 1329 | } |
| 1329 | 1330 | } |
| 1330 | 1331 | |
| 1332 | + public static String getAreasList(String token){ | |
| 1333 | + if (okHttpClient == null) { | |
| 1334 | + okHttpClient = getOkClient(); | |
| 1335 | + } | |
| 1336 | + Request request = new Request.Builder().url(remote + AREAS).addHeader("Authorization", token).get().build(); | |
| 1337 | + try { | |
| 1338 | + okhttp3.Response response = okHttpClient.newCall(request).execute(); | |
| 1339 | + String result = response.body().string(); | |
| 1340 | + return result; | |
| 1341 | + } catch (Exception e) { | |
| 1342 | + e.printStackTrace(); | |
| 1343 | + return null; | |
| 1344 | + } | |
| 1345 | + } | |
| 1346 | + | |
| 1347 | + public static String getEarthSitesDetails(String token,String id){ | |
| 1348 | + if (okHttpClient == null) { | |
| 1349 | + okHttpClient = getOkClient(); | |
| 1350 | + } | |
| 1351 | + Request request = new Request.Builder().url(remote + EARTHSITES+id).addHeader("Authorization", token).get().build(); | |
| 1352 | + try { | |
| 1353 | + okhttp3.Response response = okHttpClient.newCall(request).execute(); | |
| 1354 | + String result = response.body().string(); | |
| 1355 | + return result; | |
| 1356 | + } catch (Exception e) { | |
| 1357 | + e.printStackTrace(); | |
| 1358 | + return null; | |
| 1359 | + } | |
| 1360 | + } | |
| 1361 | + | |
| 1331 | 1362 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/controller/GarOrderMatchAskController.java
0 → 100644
| 1 | +package com.trash.garbage.controller; | |
| 2 | + | |
| 3 | +import com.trash.common.annotation.Log; | |
| 4 | +import com.trash.common.core.controller.BaseController; | |
| 5 | +import com.trash.common.core.domain.AjaxResult; | |
| 6 | +import com.trash.common.core.page.TableDataInfo; | |
| 7 | +import com.trash.common.enums.BusinessType; | |
| 8 | +import com.trash.common.utils.poi.ExcelUtil; | |
| 9 | +import com.trash.garbage.pojo.domain.GarOrderMatchAsk; | |
| 10 | +import com.trash.garbage.service.GarOrderMatchAskService; | |
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 12 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 13 | +import org.springframework.web.bind.annotation.*; | |
| 14 | + | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * 趟次关联台账Controller | |
| 19 | + * | |
| 20 | + * @author 2c | |
| 21 | + * @date 2025-04-30 | |
| 22 | + */ | |
| 23 | +@RestController | |
| 24 | +@RequestMapping("/ask/ask") | |
| 25 | +public class GarOrderMatchAskController extends BaseController | |
| 26 | +{ | |
| 27 | + @Autowired | |
| 28 | + private GarOrderMatchAskService garOrderMatchAskService; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 查询趟次关联台账列表 | |
| 32 | + */ | |
| 33 | + @PreAuthorize("@ss.hasPermi('ask:ask:list')") | |
| 34 | + @GetMapping("/list") | |
| 35 | + public TableDataInfo list(GarOrderMatchAsk garOrderMatchAsk) | |
| 36 | + { | |
| 37 | + startPage(); | |
| 38 | + List<GarOrderMatchAsk> list = garOrderMatchAskService.selectGarOrderMatchAskList(garOrderMatchAsk); | |
| 39 | + return getDataTable(list); | |
| 40 | + } | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 导出趟次关联台账列表 | |
| 44 | + */ | |
| 45 | + @PreAuthorize("@ss.hasPermi('ask:ask:export')") | |
| 46 | + @Log(title = "趟次关联台账", businessType = BusinessType.EXPORT) | |
| 47 | + @GetMapping("/export") | |
| 48 | + public AjaxResult export(GarOrderMatchAsk garOrderMatchAsk) | |
| 49 | + { | |
| 50 | + List<GarOrderMatchAsk> list = garOrderMatchAskService.selectGarOrderMatchAskList(garOrderMatchAsk); | |
| 51 | + ExcelUtil<GarOrderMatchAsk> util = new ExcelUtil<GarOrderMatchAsk>(GarOrderMatchAsk.class); | |
| 52 | + return util.exportExcel(list, "ask"); | |
| 53 | + } | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 获取趟次关联台账详细信息 | |
| 57 | + */ | |
| 58 | + @PreAuthorize("@ss.hasPermi('ask:ask:query')") | |
| 59 | + @GetMapping(value = "/{garId}") | |
| 60 | + public AjaxResult getInfo(@PathVariable("garId") String garId) | |
| 61 | + { | |
| 62 | + return AjaxResult.success(garOrderMatchAskService.selectGarOrderMatchAskById(garId)); | |
| 63 | + } | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 新增趟次关联台账 | |
| 67 | + */ | |
| 68 | + @PreAuthorize("@ss.hasPermi('ask:ask:add')") | |
| 69 | + @Log(title = "趟次关联台账", businessType = BusinessType.INSERT) | |
| 70 | + @PostMapping | |
| 71 | + public AjaxResult add(@RequestBody GarOrderMatchAsk garOrderMatchAsk) | |
| 72 | + { | |
| 73 | + return toAjax(garOrderMatchAskService.insertGarOrderMatchAsk(garOrderMatchAsk)); | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 修改趟次关联台账 | |
| 78 | + */ | |
| 79 | + @PreAuthorize("@ss.hasPermi('ask:ask:edit')") | |
| 80 | + @Log(title = "趟次关联台账", businessType = BusinessType.UPDATE) | |
| 81 | + @PutMapping | |
| 82 | + public AjaxResult edit(@RequestBody GarOrderMatchAsk garOrderMatchAsk) | |
| 83 | + { | |
| 84 | + return toAjax(garOrderMatchAskService.updateGarOrderMatchAsk(garOrderMatchAsk)); | |
| 85 | + } | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 删除趟次关联台账 | |
| 89 | + */ | |
| 90 | + @PreAuthorize("@ss.hasPermi('ask:ask:remove')") | |
| 91 | + @Log(title = "趟次关联台账", businessType = BusinessType.DELETE) | |
| 92 | + @DeleteMapping("/{garIds}") | |
| 93 | + public AjaxResult remove(@PathVariable String[] garIds) | |
| 94 | + { | |
| 95 | + return toAjax(garOrderMatchAskService.deleteGarOrderMatchAskByIds(garIds)); | |
| 96 | + } | |
| 97 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMatchAskMapper.java
| ... | ... | @@ -15,7 +15,53 @@ import java.util.List; |
| 15 | 15 | */ |
| 16 | 16 | public interface GarOrderMatchAskMapper extends BaseMapper<GarOrderMatchAsk> { |
| 17 | 17 | |
| 18 | - List<DispatchDisposalVo> queryDisposalListWithDispatchStatus(@Param("orderId") String orderId,@Param("id") Long id); | |
| 18 | + /** | |
| 19 | + * 查询趟次关联台账 | |
| 20 | + * | |
| 21 | + * @param garId 趟次关联台账ID | |
| 22 | + * @return 趟次关联台账 | |
| 23 | + */ | |
| 24 | + GarOrderMatchAsk selectGarOrderMatchAskById(String garId); | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 查询趟次关联台账列表 | |
| 28 | + * | |
| 29 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 30 | + * @return 趟次关联台账集合 | |
| 31 | + */ | |
| 32 | + List<GarOrderMatchAsk> selectGarOrderMatchAskList(GarOrderMatchAsk garOrderMatchAsk); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 新增趟次关联台账 | |
| 36 | + * | |
| 37 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 38 | + * @return 结果 | |
| 39 | + */ | |
| 40 | + int insertGarOrderMatchAsk(GarOrderMatchAsk garOrderMatchAsk); | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 修改趟次关联台账 | |
| 44 | + * | |
| 45 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 46 | + * @return 结果 | |
| 47 | + */ | |
| 48 | + int updateGarOrderMatchAsk(GarOrderMatchAsk garOrderMatchAsk); | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 删除趟次关联台账 | |
| 52 | + * | |
| 53 | + * @param garId 趟次关联台账ID | |
| 54 | + * @return 结果 | |
| 55 | + */ | |
| 56 | + int deleteGarOrderMatchAskById(String garId); | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 批量删除趟次关联台账 | |
| 60 | + * | |
| 61 | + * @param garIds 需要删除的数据ID | |
| 62 | + * @return 结果 | |
| 63 | + */ | |
| 64 | + int deleteGarOrderMatchAskByIds(String[] garIds); | |
| 19 | 65 | } |
| 20 | 66 | |
| 21 | 67 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrder.java
| ... | ... | @@ -188,7 +188,7 @@ public class GarOrder implements Serializable { |
| 188 | 188 | |
| 189 | 189 | private Integer garTimeOutFlag; |
| 190 | 190 | |
| 191 | - private String garEstimatedCost; | |
| 191 | + private String garAskStatus; | |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | 194 | * 是否有用户的评价,默认值是0,默认没有 |
| ... | ... | @@ -504,11 +504,11 @@ public class GarOrder implements Serializable { |
| 504 | 504 | this.haveEvaluateOfClient = haveEvaluateOfClient; |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | - public String getGarEstimatedCost() { | |
| 508 | - return garEstimatedCost; | |
| 507 | + public String getGarAskStatus() { | |
| 508 | + return garAskStatus; | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | - public void setGarEstimatedCost(String garEstimatedCost) { | |
| 512 | - this.garEstimatedCost = garEstimatedCost; | |
| 511 | + public void setGarAskStatus(String garAskStatus) { | |
| 512 | + this.garAskStatus = garAskStatus; | |
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | \ No newline at end of file | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderMatchAsk.java
| ... | ... | @@ -8,6 +8,7 @@ import java.io.Serializable; |
| 8 | 8 | import java.util.Date; |
| 9 | 9 | |
| 10 | 10 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 11 | +import com.trash.common.annotation.Excel; | |
| 11 | 12 | import lombok.Data; |
| 12 | 13 | import lombok.EqualsAndHashCode; |
| 13 | 14 | import lombok.ToString; |
| ... | ... | @@ -28,34 +29,51 @@ public class GarOrderMatchAsk implements Serializable { |
| 28 | 29 | private String garId; |
| 29 | 30 | |
| 30 | 31 | /** |
| 31 | - * | |
| 32 | + * 订单 id | |
| 32 | 33 | */ |
| 34 | + @Excel(name = "订单 ID") | |
| 33 | 35 | private String garOrderId; |
| 34 | 36 | |
| 35 | 37 | /** |
| 36 | - * | |
| 38 | + * 运输驾驶员手机号 | |
| 37 | 39 | */ |
| 38 | 40 | private String garOrderHandlerTel; |
| 41 | + /** | |
| 42 | + * 订单载重 | |
| 43 | + */ | |
| 39 | 44 | private Double garCarryingWeight; |
| 40 | 45 | |
| 46 | + /** | |
| 47 | + * 接收量 | |
| 48 | + */ | |
| 41 | 49 | private Double garReceptionQuantity; |
| 42 | 50 | /** |
| 43 | - * | |
| 51 | + * 运输驾驶员 | |
| 44 | 52 | */ |
| 45 | 53 | private String garOrderHandlerName; |
| 46 | 54 | |
| 47 | 55 | /** |
| 48 | - * | |
| 56 | + * 公司 id | |
| 49 | 57 | */ |
| 50 | 58 | private String garOrderHandlerCompanyId; |
| 59 | + | |
| 60 | + /** | |
| 61 | + * 车辆类型 | |
| 62 | + */ | |
| 51 | 63 | private String garOrderContainerVolume; |
| 52 | 64 | /** |
| 53 | - * | |
| 65 | + * 公司名称 | |
| 54 | 66 | */ |
| 55 | 67 | private String garOrderHandlerCompanyName; |
| 56 | 68 | |
| 69 | + /** | |
| 70 | + * 车牌号 | |
| 71 | + */ | |
| 57 | 72 | private String garHandlerCarCode; |
| 58 | 73 | |
| 74 | + /** | |
| 75 | + * | |
| 76 | + */ | |
| 59 | 77 | private String garOrderHandlerId; |
| 60 | 78 | |
| 61 | 79 | /** |
| ... | ... | @@ -87,13 +105,76 @@ public class GarOrderMatchAsk implements Serializable { |
| 87 | 105 | private String garUpdateBy; |
| 88 | 106 | |
| 89 | 107 | /** |
| 90 | - * | |
| 108 | + * 备注 | |
| 91 | 109 | */ |
| 92 | 110 | private String garRemark; |
| 93 | 111 | |
| 112 | + /** | |
| 113 | + * 投放点 id | |
| 114 | + */ | |
| 115 | + private int dropPointId; | |
| 116 | + | |
| 117 | + /** | |
| 118 | + * 投放点名称 | |
| 119 | + */ | |
| 120 | + private String dropPointName; | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * 趟次类型0=正常趟次,1=异常趟次 | |
| 124 | + */ | |
| 125 | + private String garOrderType; | |
| 126 | + | |
| 127 | + /** | |
| 128 | + * 处置场所 id | |
| 129 | + */ | |
| 130 | + private String disposalId; | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * 处置场所 | |
| 134 | + */ | |
| 135 | + private String disposalSiteName; | |
| 136 | + | |
| 137 | + /** | |
| 138 | + * 订单编号 | |
| 139 | + */ | |
| 140 | + private String garOrderNumber; | |
| 141 | + | |
| 142 | + /** | |
| 143 | + * 订单下单手机号 | |
| 144 | + */ | |
| 145 | + private String garOrderPhone; | |
| 146 | + | |
| 147 | + /** | |
| 148 | + * 订单下单用户名称 | |
| 149 | + */ | |
| 150 | + private String garOrderName; | |
| 151 | + | |
| 94 | 152 | @TableField(exist = false) |
| 95 | 153 | private static final long serialVersionUID = 1L; |
| 96 | 154 | |
| 155 | + public String getGarOrderName() { | |
| 156 | + return garOrderName; | |
| 157 | + } | |
| 158 | + | |
| 159 | + public void setGarOrderName(String garOrderName) { | |
| 160 | + this.garOrderName = garOrderName; | |
| 161 | + } | |
| 162 | + | |
| 163 | + public String getGarOrderNumber() { | |
| 164 | + return garOrderNumber; | |
| 165 | + } | |
| 166 | + | |
| 167 | + public void setGarOrderNumber(String garOrderNumber) { | |
| 168 | + this.garOrderNumber = garOrderNumber; | |
| 169 | + } | |
| 170 | + | |
| 171 | + public String getGarOrderPhone() { | |
| 172 | + return garOrderPhone; | |
| 173 | + } | |
| 174 | + | |
| 175 | + public void setGarOrderPhone(String garOrderPhone) { | |
| 176 | + this.garOrderPhone = garOrderPhone; | |
| 177 | + } | |
| 97 | 178 | |
| 98 | 179 | public String getGarId() { |
| 99 | 180 | return garId; |
| ... | ... | @@ -222,4 +303,44 @@ public class GarOrderMatchAsk implements Serializable { |
| 222 | 303 | public void setGarReceptionQuantity(Double garReceptionQuantity) { |
| 223 | 304 | this.garReceptionQuantity = garReceptionQuantity; |
| 224 | 305 | } |
| 306 | + | |
| 307 | + public int getDropPointId() { | |
| 308 | + return dropPointId; | |
| 309 | + } | |
| 310 | + | |
| 311 | + public void setDropPointId(int dropPointId) { | |
| 312 | + this.dropPointId = dropPointId; | |
| 313 | + } | |
| 314 | + | |
| 315 | + public String getDropPointName() { | |
| 316 | + return dropPointName; | |
| 317 | + } | |
| 318 | + | |
| 319 | + public void setDropPointName(String dropPointName) { | |
| 320 | + this.dropPointName = dropPointName; | |
| 321 | + } | |
| 322 | + | |
| 323 | + public String getGarOrderType() { | |
| 324 | + return garOrderType; | |
| 325 | + } | |
| 326 | + | |
| 327 | + public void setGarOrderType(String garOrderType) { | |
| 328 | + this.garOrderType = garOrderType; | |
| 329 | + } | |
| 330 | + | |
| 331 | + public String getDisposalId() { | |
| 332 | + return disposalId; | |
| 333 | + } | |
| 334 | + | |
| 335 | + public void setDisposalId(String disposalId) { | |
| 336 | + this.disposalId = disposalId; | |
| 337 | + } | |
| 338 | + | |
| 339 | + public String getDisposalSiteName() { | |
| 340 | + return disposalSiteName; | |
| 341 | + } | |
| 342 | + | |
| 343 | + public void setDisposalSiteName(String disposalSiteName) { | |
| 344 | + this.disposalSiteName = disposalSiteName; | |
| 345 | + } | |
| 225 | 346 | } |
| 226 | 347 | \ No newline at end of file | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/AskTransportDto.java
| ... | ... | @@ -39,6 +39,27 @@ public class AskTransportDto { |
| 39 | 39 | @NotEmpty(message = "请上传全景图片") |
| 40 | 40 | private List<String> fillImageList; |
| 41 | 41 | |
| 42 | + // 纬度 | |
| 43 | + private double latitude; | |
| 44 | + // 经度 | |
| 45 | + private double longitude; | |
| 46 | + | |
| 47 | + public double getLatitude() { | |
| 48 | + return latitude; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setLatitude(double latitude) { | |
| 52 | + this.latitude = latitude; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public double getLongitude() { | |
| 56 | + return longitude; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setLongitude(double longitude) { | |
| 60 | + this.longitude = longitude; | |
| 61 | + } | |
| 62 | + | |
| 42 | 63 | public Double getGarCarryingWeight() { |
| 43 | 64 | return garCarryingWeight; |
| 44 | 65 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderDto.java
| ... | ... | @@ -91,7 +91,7 @@ public class OrderDto { |
| 91 | 91 | |
| 92 | 92 | private List<CarInfo> garCarInfoList; |
| 93 | 93 | |
| 94 | - private String garEstimatedCost; | |
| 94 | + private String garAskStatus; | |
| 95 | 95 | |
| 96 | 96 | @ToString |
| 97 | 97 | @EqualsAndHashCode |
| ... | ... | @@ -281,12 +281,12 @@ public class OrderDto { |
| 281 | 281 | this.garInCarStore = garInCarStore; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - public String getGarEstimatedCost() { | |
| 285 | - return garEstimatedCost; | |
| 284 | + public String getGarAskStatus() { | |
| 285 | + return garAskStatus; | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - public void setGarEstimatedCost(String garEstimatedCost) { | |
| 289 | - this.garEstimatedCost = garEstimatedCost; | |
| 288 | + public void setGarAskStatus(String garAskStatus) { | |
| 289 | + this.garAskStatus = garAskStatus; | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | @Override | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/UploadDto.java
| ... | ... | @@ -12,9 +12,47 @@ import java.util.List; |
| 12 | 12 | @ToString |
| 13 | 13 | @EqualsAndHashCode |
| 14 | 14 | public class UploadDto { |
| 15 | + //订单唯一 id | |
| 15 | 16 | private String garOrderId; |
| 17 | + //图片类型,装车图片,卸车图片 | |
| 16 | 18 | private Integer type; |
| 19 | + //图片url | |
| 17 | 20 | private List<String> imageUrls; |
| 21 | + // 车牌号 | |
| 22 | + private String carPlate; | |
| 23 | + // 手机号 | |
| 24 | + private String driver; | |
| 25 | + // 用户手机号 | |
| 26 | + private String userPhone; | |
| 27 | + // 纬度 | |
| 28 | + private double latitude; | |
| 29 | + // 经度 | |
| 30 | + private double longitude; | |
| 31 | + | |
| 32 | + public double getLatitude() { | |
| 33 | + return latitude; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public void setLatitude(double latitude) { | |
| 37 | + this.latitude = latitude; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public double getLongitude() { | |
| 41 | + return longitude; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public void setLongitude(double longitude) { | |
| 45 | + this.longitude = longitude; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public String getUserPhone() { | |
| 49 | + return userPhone; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public void setUserPhone(String userPhone) { | |
| 53 | + this.userPhone = userPhone; | |
| 54 | + } | |
| 55 | + | |
| 18 | 56 | public String getGarOrderId() { |
| 19 | 57 | return garOrderId; |
| 20 | 58 | } |
| ... | ... | @@ -33,6 +71,20 @@ public class UploadDto { |
| 33 | 71 | public void setImageUrls(List<String> imageUrls) { |
| 34 | 72 | this.imageUrls = imageUrls; |
| 35 | 73 | } |
| 36 | - | |
| 37 | - | |
| 74 | + | |
| 75 | + public String getCarPlate() { | |
| 76 | + return carPlate; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setCarPlate(String carPlate) { | |
| 80 | + this.carPlate = carPlate; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public String getDriver() { | |
| 84 | + return driver; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setDriver(String driver) { | |
| 88 | + this.driver = driver; | |
| 89 | + } | |
| 38 | 90 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/LoginVo.java
| ... | ... | @@ -11,6 +11,7 @@ public class LoginVo { |
| 11 | 11 | private String token; |
| 12 | 12 | private String name; |
| 13 | 13 | private List<RuleVo> ruleVos; |
| 14 | + private String loginPhone; | |
| 14 | 15 | |
| 15 | 16 | /** |
| 16 | 17 | * 是否内测用户 |
| ... | ... | @@ -49,6 +50,14 @@ public class LoginVo { |
| 49 | 50 | this.ruleVos = ruleVos; |
| 50 | 51 | } |
| 51 | 52 | |
| 53 | + public String getLoginPhone() { | |
| 54 | + return loginPhone; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public void setLoginPhone(String loginPhone) { | |
| 58 | + this.loginPhone = loginPhone; | |
| 59 | + } | |
| 60 | + | |
| 52 | 61 | @ToString |
| 53 | 62 | @EqualsAndHashCode |
| 54 | 63 | public static class RuleVo { | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/OrderDetailVo.java
| ... | ... | @@ -164,7 +164,7 @@ public class OrderDetailVo { |
| 164 | 164 | */ |
| 165 | 165 | private Integer haveEvaluateOfClient = 0; |
| 166 | 166 | |
| 167 | - private String garEstimatedCost; | |
| 167 | + private String garAskStatus; | |
| 168 | 168 | |
| 169 | 169 | private List<String> panoramas; |
| 170 | 170 | private Collection<OrderCarReport> carReports; |
| ... | ... | @@ -454,12 +454,12 @@ public class OrderDetailVo { |
| 454 | 454 | this.haveEvaluateOfClient = haveEvaluateOfClient; |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - public String getGarEstimatedCost() { | |
| 458 | - return garEstimatedCost; | |
| 457 | + public String getGarAskStatus() { | |
| 458 | + return garAskStatus; | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - public void setGarEstimatedCost(String garEstimatedCost) { | |
| 462 | - this.garEstimatedCost = garEstimatedCost; | |
| 461 | + public void setGarAskStatus(String garAskStatus) { | |
| 462 | + this.garAskStatus = garAskStatus; | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | public Collection<OrderCarStatistics> getOrderCarStatistics() { | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderMatchAskService.java
| ... | ... | @@ -13,4 +13,52 @@ import java.util.List; |
| 13 | 13 | */ |
| 14 | 14 | public interface GarOrderMatchAskService extends IService<GarOrderMatchAsk> { |
| 15 | 15 | List<GarOrderMatchAsk> queryByOrderId(String orderId); |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 查询趟次关联台账 | |
| 19 | + * | |
| 20 | + * @param garId 趟次关联台账ID | |
| 21 | + * @return 趟次关联台账 | |
| 22 | + */ | |
| 23 | + GarOrderMatchAsk selectGarOrderMatchAskById(String garId); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 查询趟次关联台账列表 | |
| 27 | + * | |
| 28 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 29 | + * @return 趟次关联台账集合 | |
| 30 | + */ | |
| 31 | + List<GarOrderMatchAsk> selectGarOrderMatchAskList(GarOrderMatchAsk garOrderMatchAsk); | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 新增趟次关联台账 | |
| 35 | + * | |
| 36 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 37 | + * @return 结果 | |
| 38 | + */ | |
| 39 | + int insertGarOrderMatchAsk(GarOrderMatchAsk garOrderMatchAsk); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 修改趟次关联台账 | |
| 43 | + * | |
| 44 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 45 | + * @return 结果 | |
| 46 | + */ | |
| 47 | + int updateGarOrderMatchAsk(GarOrderMatchAsk garOrderMatchAsk); | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 批量删除趟次关联台账 | |
| 51 | + * | |
| 52 | + * @param garIds 需要删除的趟次关联台账ID | |
| 53 | + * @return 结果 | |
| 54 | + */ | |
| 55 | + int deleteGarOrderMatchAskByIds(String[] garIds); | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 删除趟次关联台账信息 | |
| 59 | + * | |
| 60 | + * @param garId 趟次关联台账ID | |
| 61 | + * @return 结果 | |
| 62 | + */ | |
| 63 | + int deleteGarOrderMatchAskById(String garId); | |
| 16 | 64 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderAssociationServiceAsync.java
0 → 100644
| 1 | +package com.trash.garbage.service.impl; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson.JSON; | |
| 4 | +import com.alibaba.fastjson.JSONArray; | |
| 5 | +import com.alibaba.fastjson.JSONObject; | |
| 6 | +import com.trash.common.utils.DateUtils; | |
| 7 | +import com.trash.common.utils.RemoteServerUtils; | |
| 8 | +import com.trash.dropPointInfo.domain.DropPointInfo; | |
| 9 | +import com.trash.dropPointInfo.service.IDropPointInfoService; | |
| 10 | +import com.trash.dropPointInfo.service.impl.DropPointInfoServiceImpl; | |
| 11 | +import com.trash.garbage.pojo.domain.GarOrderMatchAsk; | |
| 12 | +import com.trash.garbage.pojo.dto.AskTransportDto; | |
| 13 | +import com.trash.garbage.pojo.dto.UploadDto; | |
| 14 | +import com.trash.garbage.service.GarOrderMatchAskService; | |
| 15 | +import com.trash.garbage.utils.HttpUtil; | |
| 16 | +import lombok.extern.slf4j.Slf4j; | |
| 17 | +import org.slf4j.Logger; | |
| 18 | +import org.slf4j.LoggerFactory; | |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 20 | +import org.springframework.scheduling.annotation.Async; | |
| 21 | +import org.springframework.scheduling.annotation.EnableAsync; | |
| 22 | +import org.springframework.stereotype.Component; | |
| 23 | + | |
| 24 | +import java.util.ArrayList; | |
| 25 | +import java.util.Date; | |
| 26 | +import java.util.List; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * 电子联单服务 | |
| 30 | + */ | |
| 31 | +@EnableAsync | |
| 32 | +@Component | |
| 33 | +public class GarOrderAssociationServiceAsync { | |
| 34 | + private static final Logger log = LoggerFactory.getLogger(GarOrderAssociationServiceAsync.class); | |
| 35 | + | |
| 36 | + @Autowired | |
| 37 | + private GarOrderMatchAskService askService; | |
| 38 | + | |
| 39 | + @Autowired | |
| 40 | + private IDropPointInfoService dropPointInfoService; | |
| 41 | + | |
| 42 | + @Autowired | |
| 43 | + private com.trash.common.config.trashConfig trashConfig; | |
| 44 | + /** | |
| 45 | + * 判断车辆是否在投放点区域内 | |
| 46 | + * @param carPlate 车牌号 | |
| 47 | + * @param garOrderMatchAsk 订单关联台账 | |
| 48 | + * @param dto 上传对象 | |
| 49 | + */ | |
| 50 | + @Async | |
| 51 | + public void isWithinDropPointCoordinates(String carPlate, GarOrderMatchAsk garOrderMatchAsk, UploadDto dto) { | |
| 52 | + try { | |
| 53 | + log.info("开始判断车辆是否在投放点区域内"); | |
| 54 | + DropPointInfo dropPointInfo = dropPointInfoService.selectDropPointInfoById((long) garOrderMatchAsk.getDropPointId()); | |
| 55 | + // 上传装车照片的经纬度 | |
| 56 | + double vehicleLat = dto.getLatitude(); | |
| 57 | + double vehicleLon = dto.getLongitude(); | |
| 58 | + // 获取投放点的经纬度 | |
| 59 | + String[] coordinatePoint = dropPointInfo.getCoordinatePoint().split(","); | |
| 60 | + double dropPointLat = Double.parseDouble(coordinatePoint[1]); | |
| 61 | + double dropPointLon = Double.parseDouble(coordinatePoint[0]); | |
| 62 | + | |
| 63 | + // 计算距离 | |
| 64 | + double distance = calculateDistance(vehicleLat, vehicleLon, dropPointLat, dropPointLon); | |
| 65 | + log.info("车辆与投放点的距离为: {} 公里", distance); | |
| 66 | + // 判断是否在1公里内 | |
| 67 | + if(distance <= 2.0){ | |
| 68 | + garOrderMatchAsk.setGarOrderType("0"); | |
| 69 | + }else{ | |
| 70 | + garOrderMatchAsk.setGarOrderType("1"); | |
| 71 | + log.info("{}车辆装车地点与投放点{}距离大于2公里,距离:{}", carPlate, dropPointInfo.getDropPointName(),distance); | |
| 72 | + garOrderMatchAsk.setGarRemark(carPlate+"车辆装车地点与投放点"+dropPointInfo.getDropPointName()+"距离大于2公里,距离:"+distance+"公里"); | |
| 73 | + } | |
| 74 | + }catch (Exception e){ | |
| 75 | + log.error("判断车辆是否在投放点区域内发生异常: ", e); | |
| 76 | + }finally { | |
| 77 | + askService.updateById(garOrderMatchAsk); | |
| 78 | + log.info("判断车辆是否在投放点区域内结束"); | |
| 79 | + } | |
| 80 | + | |
| 81 | + } | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 判断车辆是否在处置场所内 | |
| 85 | + * @param carPlate 车牌号 | |
| 86 | + * @param garOrderMatchAsk 订单关联台账 | |
| 87 | + * @param dto 上传对象 | |
| 88 | + */ | |
| 89 | + @Async | |
| 90 | + public void isWithinDisposal(String carPlate, GarOrderMatchAsk garOrderMatchAsk, AskTransportDto dto) { | |
| 91 | + try { | |
| 92 | + log.info("开始判断车辆是否在处置场所内"); | |
| 93 | + // 假设 garOrderMatchAsk.getDisposalId() 返回处置场所的 ID | |
| 94 | + String token = trashConfig.getToken(); | |
| 95 | + String data = RemoteServerUtils.getEarthSitesDetails(token,garOrderMatchAsk.getDisposalId()); | |
| 96 | + JSONObject disposalJson = JSON.parseObject(data); | |
| 97 | + JSONObject result = disposalJson.getJSONObject("result"); | |
| 98 | + JSONObject site = result.getJSONObject("site"); | |
| 99 | + String coord = site.getString("coord"); | |
| 100 | + // 上传装车照片的经纬度 | |
| 101 | + double vehicleLat = dto.getLatitude(); | |
| 102 | + double vehicleLon = dto.getLongitude(); | |
| 103 | + // 获取处置场所的经纬度列表 | |
| 104 | + List<double[]> coordinates = parseCoordinates(coord); | |
| 105 | + | |
| 106 | + // 判断是否在多边形内 | |
| 107 | + boolean isInside = isPointInPolygon(vehicleLat, vehicleLon, coordinates); | |
| 108 | + if (isInside) { | |
| 109 | + if(!garOrderMatchAsk.getGarOrderType().equals("1")){ | |
| 110 | + garOrderMatchAsk.setGarOrderType("0"); | |
| 111 | + } | |
| 112 | + } else { | |
| 113 | + garOrderMatchAsk.setGarOrderType("1"); | |
| 114 | + log.info("{} 车辆卸车地点不在处置场所 {} 区域内", carPlate, garOrderMatchAsk.getDisposalSiteName()); | |
| 115 | + if(garOrderMatchAsk.getGarRemark()==null){ | |
| 116 | + garOrderMatchAsk.setGarRemark(carPlate + "车辆卸车地点不在处置场所 " + garOrderMatchAsk.getDisposalSiteName() + " 不在区域内"); | |
| 117 | + }else{ | |
| 118 | + garOrderMatchAsk.setGarRemark(garOrderMatchAsk.getGarRemark()+";"+carPlate + "车辆卸车地点不在处置场所 " + garOrderMatchAsk.getDisposalSiteName() + " 不在区域内"); | |
| 119 | + } | |
| 120 | + | |
| 121 | + } | |
| 122 | + } catch (Exception e) { | |
| 123 | + log.error("判断车辆是否在处置场所内发生异常: ", e); | |
| 124 | + } finally { | |
| 125 | + askService.updateById(garOrderMatchAsk); | |
| 126 | + log.info("判断车辆是否在处置场所内结束"); | |
| 127 | + } | |
| 128 | + | |
| 129 | + } | |
| 130 | + | |
| 131 | + /** | |
| 132 | + * 解析坐标字符串为经纬度列表 | |
| 133 | + * @param coordinatePoint 坐标字符串,格式为 "lat1,lon1;lat2,lon2;..." | |
| 134 | + * @return 经纬度列表 | |
| 135 | + */ | |
| 136 | + private List<double[]> parseCoordinates(String coordinatePoint) { | |
| 137 | + List<double[]> coordinates = new ArrayList<>(); | |
| 138 | + String[] points = coordinatePoint.split(";"); | |
| 139 | + for (String point : points) { | |
| 140 | + String[] latLon = point.split(","); | |
| 141 | + double lat = Double.parseDouble(latLon[1]); | |
| 142 | + double lon = Double.parseDouble(latLon[0]); | |
| 143 | + coordinates.add(new double[]{lat, lon}); | |
| 144 | + } | |
| 145 | + return coordinates; | |
| 146 | + } | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * 判断点是否在多边形内(射线法) | |
| 150 | + * @param lat 点的纬度 | |
| 151 | + * @param lon 点的经度 | |
| 152 | + * @param polygon 多边形的顶点列表 | |
| 153 | + * @return 点是否在多边形内 | |
| 154 | + */ | |
| 155 | + private boolean isPointInPolygon(double lat, double lon, List<double[]> polygon) { | |
| 156 | + int n = polygon.size(); | |
| 157 | + boolean inside = false; | |
| 158 | + for (int i = 0, j = n - 1; i < n; j = i++) { | |
| 159 | + double[] p1 = polygon.get(i); | |
| 160 | + double[] p2 = polygon.get(j); | |
| 161 | + if (((p1[1] > lon) != (p2[1] > lon)) && | |
| 162 | + (lat < (p2[0] - p1[0]) * (lon - p1[1]) / (p2[1] - p1[1]) + p1[0])) { | |
| 163 | + inside = !inside; | |
| 164 | + } | |
| 165 | + } | |
| 166 | + return inside; | |
| 167 | + } | |
| 168 | + | |
| 169 | + /** | |
| 170 | + * 计算两个经纬度点之间的距离(单位:公里) | |
| 171 | + * @param lat1 第一个点的纬度 | |
| 172 | + * @param lon1 第一个点的经度 | |
| 173 | + * @param lat2 第二个点的纬度 | |
| 174 | + * @param lon2 第二个点的经度 | |
| 175 | + * @return 两个点之间的距离(公里) | |
| 176 | + */ | |
| 177 | + public static double calculateDistance(double lat1, double lon1, double lat2, double lon2) { | |
| 178 | + final int R = 6371; // 地球半径,单位:公里 | |
| 179 | + double latDistance = Math.toRadians(lat2 - lat1); | |
| 180 | + double lonDistance = Math.toRadians(lon2 - lon1); | |
| 181 | + double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2) | |
| 182 | + + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) | |
| 183 | + * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2); | |
| 184 | + double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); | |
| 185 | + double distance = R * c; | |
| 186 | + // 保留4位小数 | |
| 187 | + return Math.round(distance * 10000.0) / 10000.0; | |
| 188 | + } | |
| 189 | + | |
| 190 | +} | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderMatchAskServiceImpl.java
| ... | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 5 | 5 | import com.trash.garbage.mapper.GarOrderMatchAskMapper; |
| 6 | 6 | import com.trash.garbage.pojo.domain.GarOrderMatchAsk; |
| 7 | 7 | import com.trash.garbage.service.GarOrderMatchAskService; |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | 9 | import org.springframework.stereotype.Service; |
| 9 | 10 | |
| 10 | 11 | import java.util.List; |
| ... | ... | @@ -18,6 +19,9 @@ import java.util.List; |
| 18 | 19 | public class GarOrderMatchAskServiceImpl extends ServiceImpl<GarOrderMatchAskMapper, GarOrderMatchAsk> |
| 19 | 20 | implements GarOrderMatchAskService { |
| 20 | 21 | |
| 22 | + @Autowired | |
| 23 | + GarOrderMatchAskMapper garOrderMatchAskMapper; | |
| 24 | + | |
| 21 | 25 | @Override |
| 22 | 26 | public List<GarOrderMatchAsk> queryByOrderId(String orderId) { |
| 23 | 27 | LambdaQueryWrapper<GarOrderMatchAsk> wrapper = new LambdaQueryWrapper<>(); |
| ... | ... | @@ -25,6 +29,77 @@ public class GarOrderMatchAskServiceImpl extends ServiceImpl<GarOrderMatchAskMap |
| 25 | 29 | return list(wrapper); |
| 26 | 30 | } |
| 27 | 31 | |
| 32 | + /** | |
| 33 | + * 查询趟次关联台账 | |
| 34 | + * | |
| 35 | + * @param garId 趟次关联台账ID | |
| 36 | + * @return 趟次关联台账 | |
| 37 | + */ | |
| 38 | + @Override | |
| 39 | + public GarOrderMatchAsk selectGarOrderMatchAskById(String garId) | |
| 40 | + { | |
| 41 | + return garOrderMatchAskMapper.selectGarOrderMatchAskById(garId); | |
| 42 | + } | |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 查询趟次关联台账列表 | |
| 46 | + * | |
| 47 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 48 | + * @return 趟次关联台账 | |
| 49 | + */ | |
| 50 | + @Override | |
| 51 | + public List<GarOrderMatchAsk> selectGarOrderMatchAskList(GarOrderMatchAsk garOrderMatchAsk) | |
| 52 | + { | |
| 53 | + return garOrderMatchAskMapper.selectGarOrderMatchAskList(garOrderMatchAsk); | |
| 54 | + } | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 新增趟次关联台账 | |
| 58 | + * | |
| 59 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 60 | + * @return 结果 | |
| 61 | + */ | |
| 62 | + @Override | |
| 63 | + public int insertGarOrderMatchAsk(GarOrderMatchAsk garOrderMatchAsk) | |
| 64 | + { | |
| 65 | + return garOrderMatchAskMapper.insertGarOrderMatchAsk(garOrderMatchAsk); | |
| 66 | + } | |
| 67 | + | |
| 68 | + /** | |
| 69 | + * 修改趟次关联台账 | |
| 70 | + * | |
| 71 | + * @param garOrderMatchAsk 趟次关联台账 | |
| 72 | + * @return 结果 | |
| 73 | + */ | |
| 74 | + @Override | |
| 75 | + public int updateGarOrderMatchAsk(GarOrderMatchAsk garOrderMatchAsk) | |
| 76 | + { | |
| 77 | + return garOrderMatchAskMapper.updateGarOrderMatchAsk(garOrderMatchAsk); | |
| 78 | + } | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 批量删除趟次关联台账 | |
| 82 | + * | |
| 83 | + * @param garIds 需要删除的趟次关联台账ID | |
| 84 | + * @return 结果 | |
| 85 | + */ | |
| 86 | + @Override | |
| 87 | + public int deleteGarOrderMatchAskByIds(String[] garIds) | |
| 88 | + { | |
| 89 | + return garOrderMatchAskMapper.deleteGarOrderMatchAskByIds(garIds); | |
| 90 | + } | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 删除趟次关联台账信息 | |
| 94 | + * | |
| 95 | + * @param garId 趟次关联台账ID | |
| 96 | + * @return 结果 | |
| 97 | + */ | |
| 98 | + @Override | |
| 99 | + public int deleteGarOrderMatchAskById(String garId) | |
| 100 | + { | |
| 101 | + return garOrderMatchAskMapper.deleteGarOrderMatchAskById(garId); | |
| 102 | + } | |
| 28 | 103 | } |
| 29 | 104 | |
| 30 | 105 | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
| ... | ... | @@ -15,10 +15,13 @@ import com.github.pagehelper.PageHelper; |
| 15 | 15 | import com.github.pagehelper.PageInfo; |
| 16 | 16 | import com.trash.carInfo.domain.vo.CarInfoVo; |
| 17 | 17 | import com.trash.common.core.redis.RedisCache; |
| 18 | +import com.trash.common.utils.RemoteServerUtils; | |
| 18 | 19 | import com.trash.common.utils.SecurityUtils; |
| 19 | 20 | import com.trash.common.utils.ServletUtils; |
| 20 | 21 | import com.trash.driver.domain.vo.DriverVo; |
| 21 | 22 | import com.trash.driver.service.IDriverService; |
| 23 | +import com.trash.dropPointInfo.domain.DropPointInfo; | |
| 24 | +import com.trash.dropPointInfo.service.IDropPointInfoService; | |
| 22 | 25 | import com.trash.enterprise.domain.TransportationEnterprise; |
| 23 | 26 | import com.trash.enterprise.service.ITransportationEnterpriseService; |
| 24 | 27 | import com.trash.garbage.custom.BizException; |
| ... | ... | @@ -45,7 +48,9 @@ import org.springframework.transaction.annotation.Transactional; |
| 45 | 48 | import org.springframework.web.util.HtmlUtils; |
| 46 | 49 | |
| 47 | 50 | import javax.annotation.Resource; |
| 51 | +import java.text.SimpleDateFormat; | |
| 48 | 52 | import java.util.*; |
| 53 | +import java.util.concurrent.TimeUnit; | |
| 49 | 54 | import java.util.stream.Collectors; |
| 50 | 55 | import java.util.stream.Stream; |
| 51 | 56 | |
| ... | ... | @@ -72,8 +77,6 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 72 | 77 | @Autowired |
| 73 | 78 | private GarAddressService garAddressService; |
| 74 | 79 | @Autowired |
| 75 | - private GarOrderMatchAskService matchAskService; | |
| 76 | - @Autowired | |
| 77 | 80 | private GarOrderMatchDisposalService disposalService; |
| 78 | 81 | @Autowired |
| 79 | 82 | private ITransportationEnterpriseService transportationEnterpriseService; |
| ... | ... | @@ -99,6 +102,8 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 99 | 102 | private GarTransportationEnterpriseService garTransportationEnterpriseService; |
| 100 | 103 | @Autowired |
| 101 | 104 | private GarAreaServer garAreaServer; |
| 105 | + @Autowired | |
| 106 | + private GarOrderAssociationServiceAsync garOrderAssociationServiceAsync; | |
| 102 | 107 | |
| 103 | 108 | private FastDateFormat fastDateFormat = FastDateFormat.getInstance("yyyy-MM-dd"); |
| 104 | 109 | |
| ... | ... | @@ -111,6 +116,10 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 111 | 116 | private GarCarServer garCarServer; |
| 112 | 117 | @Autowired |
| 113 | 118 | private GarOrderMatchHandlerService garOrderMatchHandlerService; |
| 119 | + @Autowired | |
| 120 | + private IDropPointInfoService dropPointInfoService; | |
| 121 | + @Autowired | |
| 122 | + private com.trash.common.config.trashConfig trashConfig; | |
| 114 | 123 | |
| 115 | 124 | @Override |
| 116 | 125 | @Transactional(rollbackFor = Exception.class) |
| ... | ... | @@ -126,7 +135,6 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 126 | 135 | // 预估车辆等于用户选择得车辆 |
| 127 | 136 | order.setGarRealCarCount(dto.getGarCarInfoList().stream().mapToInt(OrderDto.CarInfo::getGarOrderCarNumber).sum()); |
| 128 | 137 | order.setGarTimeOutFlag(GlobalStatus.GarOrderStatus.ORDER_TIME_OUT_FLAG_NO.getValue()); |
| 129 | - order.setGarEstimatedCost(dto.getGarEstimatedCost()); | |
| 130 | 138 | |
| 131 | 139 | save(order); |
| 132 | 140 | |
| ... | ... | @@ -158,7 +166,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 158 | 166 | } |
| 159 | 167 | garOrderImageService.saveBatch(images); |
| 160 | 168 | // TODO 短信提醒 居民下单 |
| 161 | - String content = "【装修垃圾清运】订单提醒:您有新的清运订单"+order.getGarOrderId()+",请及时处理!用户联系方式"+order.getGarOrderContactTel()+"!"; | |
| 169 | + String content = "【装修垃圾清运】订单提醒:您有新的清运订单" + order.getGarOrderId() + ",请及时处理!用户联系方式" + order.getGarOrderContactTel() + "!"; | |
| 162 | 170 | smsUtils.sendMessage(order.getGarOrderCompanyTel(), content); |
| 163 | 171 | return order.getGarOrderId(); |
| 164 | 172 | } |
| ... | ... | @@ -446,7 +454,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 446 | 454 | // 完成订单 |
| 447 | 455 | GarOrder order = getById(dto.getGarOrderId()); |
| 448 | 456 | // TODO 发送短信 通知企业和用户 修改订单状态为完成 disposal 和 handler表的状态一起修改 |
| 449 | - String message = "【装修垃圾清运】订单提醒:您的预约的清运订单"+order.getGarOrderId()+"已完成,可前往【智慧渣管APP】确认并评价,感谢您的使用!"; | |
| 457 | + String message = "【装修垃圾清运】订单提醒:您的预约的清运订单" + order.getGarOrderId() + "已完成,可前往【智慧渣管APP】确认并评价,感谢您的使用!"; | |
| 450 | 458 | smsUtils.sendMessage(order.getGarOrderContactTel(), message); |
| 451 | 459 | // smsUtils.sendMessage(order.getGarOrderCompanyTel(), "【装修垃圾清运】订单提醒:您的预约的清运订单"+order.getGarOrderId()+"已完成,可前往【智慧渣管APP】确认并评价,感谢您的使用!"); |
| 452 | 460 | successOrder(order); |
| ... | ... | @@ -497,7 +505,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 497 | 505 | String tel = GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription().equals(user.getGarUserType()) ? |
| 498 | 506 | order.getGarOrderCompanyTel() : order.getGarOrderContactTel(); |
| 499 | 507 | String message = GlobalStatus.GarUserStatusEnum.NORMAL_USER.getDescription().equals(user.getGarUserType()) ? |
| 500 | - "【装修垃圾清运】订单提醒:您的待清运订单"+order.getGarOrderId()+"已被取消,详情请登录【智慧渣管APP】查看!" : "【装修垃圾清运】订单提醒:您的预约清运订单"+order.getGarOrderId()+"已被取消,详情请登录【智慧渣管APP】查看!"; | |
| 508 | + "【装修垃圾清运】订单提醒:您的待清运订单" + order.getGarOrderId() + "已被取消,详情请登录【智慧渣管APP】查看!" : "【装修垃圾清运】订单提醒:您的预约清运订单" + order.getGarOrderId() + "已被取消,详情请登录【智慧渣管APP】查看!"; | |
| 501 | 509 | smsUtils.sendMessage(tel, message); |
| 502 | 510 | // TODO 用户消息通知 订单菜单消息 |
| 503 | 511 | userOrderMessageSend(order, message); |
| ... | ... | @@ -548,7 +556,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 548 | 556 | .set(GarOrder::getGarOrderCompanyUserId, user.getGarUserId()); |
| 549 | 557 | update(uw); |
| 550 | 558 | // TODO 短信提醒 |
| 551 | - String message = "【装修垃圾清运】订单提醒:您的预约清运订单"+order.getGarOrderId()+"已被"+order.getGarOrderCompanyName()+"公司接收,详情请登录【智慧渣管APP】查看!企业服务电话!"; | |
| 559 | + String message = "【装修垃圾清运】订单提醒:您的预约清运订单" + order.getGarOrderId() + "已被" + order.getGarOrderCompanyName() + "公司接收,详情请登录【智慧渣管APP】查看!企业服务电话!"; | |
| 552 | 560 | smsUtils.sendMessage(order.getGarOrderContactTel(), message); |
| 553 | 561 | // TODO 用户消息通知 订单菜单消息 |
| 554 | 562 | userOrderMessageSend(order, message); |
| ... | ... | @@ -563,8 +571,8 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 563 | 571 | .set(GarOrder::getGarHandlerEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue()) |
| 564 | 572 | .set(GarOrder::getGarEvaluateFlag, GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue()); |
| 565 | 573 | update(uw); |
| 566 | - smsUtils.sendMessage(order.getGarOrderContactTel(), "【装修垃圾清运】订单提醒:您的预约的清运订单"+order.getGarOrderId()+"已完成,可前往【智慧渣管APP】确认并评价,感谢您的使用!"); | |
| 567 | - smsUtils.sendMessage(order.getGarOrderCompanyTel(), "【装修垃圾清运】订单提醒:您的预约的清运订单"+order.getGarOrderId()+"已完成,可前往【智慧渣管APP】确认,感谢您的使用!"); | |
| 574 | + smsUtils.sendMessage(order.getGarOrderContactTel(), "【装修垃圾清运】订单提醒:您的预约的清运订单" + order.getGarOrderId() + "已完成,可前往【智慧渣管APP】确认并评价,感谢您的使用!"); | |
| 575 | + smsUtils.sendMessage(order.getGarOrderCompanyTel(), "【装修垃圾清运】订单提醒:您的预约的清运订单" + order.getGarOrderId() + "已完成,可前往【智慧渣管APP】确认,感谢您的使用!"); | |
| 568 | 576 | // 更新disposal |
| 569 | 577 | LambdaUpdateWrapper<GarOrderMatchDisposal> uwd = new LambdaUpdateWrapper<>(); |
| 570 | 578 | uwd.eq(GarOrderMatchDisposal::getGarOrderId, dto.getGarOrderId()) |
| ... | ... | @@ -606,10 +614,133 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 606 | 614 | orderImage.setGarOrderImageType(dto.getType()); |
| 607 | 615 | garOrderImages.add(orderImage); |
| 608 | 616 | } |
| 617 | + | |
| 618 | + GarOrder order = getById(dto.getGarOrderId()); | |
| 619 | + //判断是否已开始装车 | |
| 620 | + if (dto.getType() == 1) { | |
| 621 | + if (!order.getGarAskStatus().equals("1")) { | |
| 622 | + //修改是否已开始装车状态,为已装车 | |
| 623 | + order.setGarAskStatus("1"); | |
| 624 | + updateById(order); | |
| 625 | + | |
| 626 | + OrderDetailVo orderDetailVo = this.queryOrderDetail(dto.getGarOrderId()); | |
| 627 | + //上传装车图片生成订单关联台账 | |
| 628 | + | |
| 629 | + for (int i = 0; i < order.getGarRealCarCount(); i++) { | |
| 630 | + //新增趟次关联台账 | |
| 631 | + GarOrderMatchAsk garOrderMatchAsk = new GarOrderMatchAsk(); | |
| 632 | + garOrderMatchAsk.setGarOrderPhone(orderDetailVo.getGarOrderContactTel()); | |
| 633 | + garOrderMatchAsk.setGarOrderName(orderDetailVo.getGarOrderContactName()); | |
| 634 | + garOrderMatchAsk.setGarOrderNumber(generateAssociationNumber(order.getGarOrderAddress())); | |
| 635 | + garOrderMatchAsk.setGarCreateTime(new Date()); | |
| 636 | + garOrderMatchAsk.setGarOrderId(dto.getGarOrderId()); | |
| 637 | + | |
| 638 | + //获取处置场所 | |
| 639 | + List<GarOrderMatchDisposal> disposalList = garOrderMatchDisposalService.queryObjByOrderId(dto.getGarOrderId()); | |
| 640 | + garOrderMatchAsk.setDisposalId(disposalList.get(0).getGarOrderDisposalCompanyId()); | |
| 641 | + garOrderMatchAsk.setDisposalSiteName(disposalList.get(0).getGarOrderDisposalCompanyName()); | |
| 642 | + | |
| 643 | + List<DropPointInfo> dropPointInfoList = dropPointInfoService.selectDropPointInfoListByPhone(garOrderMatchAsk.getGarOrderPhone()); | |
| 644 | + | |
| 645 | + if (!dropPointInfoList.isEmpty()) { | |
| 646 | + | |
| 647 | + garOrderMatchAsk.setDropPointId(Integer.parseInt(dropPointInfoList.get(0).getId().toString())); | |
| 648 | + garOrderMatchAsk.setDropPointName(dropPointInfoList.get(0).getDropPointName()); | |
| 649 | + } | |
| 650 | + garOrderMatchAsk.setGarCreateBy(dto.getDriver()); | |
| 651 | + askService.save(garOrderMatchAsk); | |
| 652 | + } | |
| 653 | + } | |
| 654 | + // 查询当前日期+行政区划代码的流水编号 | |
| 655 | + LambdaQueryWrapper<GarOrderMatchAsk> qw = new LambdaQueryWrapper<>(); | |
| 656 | + qw.eq(GarOrderMatchAsk::getGarOrderId, dto.getGarOrderId()); | |
| 657 | + List<GarOrderMatchAsk> askList = askService.list(qw); | |
| 658 | + for (GarOrderMatchAsk garOrderMatchAsk : askList) { | |
| 659 | + //每次只判断一次 | |
| 660 | + if(garOrderMatchAsk.getGarOrderType()==null){ | |
| 661 | + //判断车辆上传装车图片时是否在投放点区域内 | |
| 662 | + garOrderAssociationServiceAsync.isWithinDropPointCoordinates(dto.getCarPlate(), garOrderMatchAsk, dto); | |
| 663 | + break; | |
| 664 | + } | |
| 665 | + } | |
| 666 | + } | |
| 667 | + | |
| 668 | +// //上传装车图片生成订单关联台账,卸车图片结束订单关联台账 | |
| 669 | +// if(dto.getType() == 1){ | |
| 670 | +// // 获取当前日期,格式为YYYYMMDD | |
| 671 | +// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); | |
| 672 | +// String associationNumber = dateFormat.format(new Date()) + "430101"; | |
| 673 | +// // 查询当前日期+行政区划代码的流水编号 | |
| 674 | +// int sequenceNumber = garOrderAssociationService.queryAssociationNumber(associationNumber); | |
| 675 | +// // 流水编号自增 | |
| 676 | +// sequenceNumber++; | |
| 677 | +// // 组合生成最终的编号 | |
| 678 | +// associationNumber = associationNumber + String.format("%06d", sequenceNumber); // 保证6位数字,不足前面补0 | |
| 679 | +// | |
| 680 | +// //新增趟次关联台账 | |
| 681 | +// GarOrderMatchAsk garOrderMatchAsk = new GarOrderMatchAsk(); | |
| 682 | +// garOrderMatchAsk.setGarOrderPhone(orderDetailVo.getGarOrderContactTel()); | |
| 683 | +// garOrderMatchAsk.setGarOrderNumber(associationNumber); | |
| 684 | +// garOrderMatchAsk.setGarCreateTime(new Date()); | |
| 685 | +// | |
| 686 | +// //获取处置场所 | |
| 687 | +// List<GarOrderMatchDisposal> disposalList = garOrderMatchDisposalService.queryObjByOrderId(dto.getGarOrderId()); | |
| 688 | +// garOrderMatchAsk.setDisposalId(disposalList.get(0).getGarOrderDisposalId()); | |
| 689 | +// garOrderMatchAsk.setDisposalSiteName(disposalList.get(0).getGarOrderDisposalCompanyName()); | |
| 690 | +// | |
| 691 | +// List<DropPointInfo> dropPointInfoList = dropPointInfoService.selectDropPointInfoListByPhone(garOrderMatchAsk.getGarOrderPhone()); | |
| 692 | +// | |
| 693 | +// if(!dropPointInfoList.isEmpty()){ | |
| 694 | +// //判断车辆上传装车图片时是否在投放点区域内 | |
| 695 | +// garOrderAssociationServiceAsync.isWithinDropPointCoordinates(dropPointInfoList.get(0), dto.getCarPlate(), garOrderMatchAsk,dto); | |
| 696 | +// garOrderMatchAsk.setDropPointId(Integer.parseInt(dropPointInfoList.get(0).getId().toString())); | |
| 697 | +// garOrderMatchAsk.setDropPointName(dropPointInfoList.get(0).getDropPointName()); | |
| 698 | +// } | |
| 699 | +// garOrderMatchAsk.setGarCreateBy(dto.getDriver()); | |
| 700 | +// | |
| 701 | +// }else{ | |
| 702 | +// //修改趟次关联台账 | |
| 703 | +// Long id = redisCache.getCacheObject(dto.getGarOrderId()); | |
| 704 | +// if(id==null){ | |
| 705 | +// | |
| 706 | +// } | |
| 707 | +// GarOrderAssociation garOrderAssociation = garOrderAssociationService.selectGarOrderAssociationById(id); | |
| 708 | +// | |
| 709 | +// garOrderAssociationService.updateGarOrderAssociation(garOrderAssociation); | |
| 710 | +// } | |
| 711 | + | |
| 712 | + | |
| 609 | 713 | garOrderImageService.saveBatch(garOrderImages); |
| 610 | 714 | return "上传成功!"; |
| 611 | 715 | } |
| 612 | 716 | |
| 717 | + public String generateAssociationNumber(String garOrderAddress) { | |
| 718 | + String token = trashConfig.getToken(); | |
| 719 | + String data = RemoteServerUtils.getAreasList(token); | |
| 720 | + JSONArray jsonArray = JSON.parseArray(data); | |
| 721 | + String[] address = garOrderAddress.split("-"); | |
| 722 | + String code = "430104"; | |
| 723 | + for (int i = 0; i < jsonArray.size(); i++) { | |
| 724 | + JSONObject jsonObject = (JSONObject) jsonArray.get(i); | |
| 725 | + if (jsonObject.getString("name").equals(address[2])) { | |
| 726 | + code = jsonObject.getString("code"); | |
| 727 | + } | |
| 728 | + } | |
| 729 | + // 获取当前日期,格式为YYYYMMDD | |
| 730 | + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); | |
| 731 | + String associationNumber = dateFormat.format(new Date()) + code; | |
| 732 | + // 查询当前日期+行政区划代码的流水编号 | |
| 733 | + LambdaQueryWrapper<GarOrderMatchAsk> qw = new LambdaQueryWrapper<>(); | |
| 734 | + qw.likeRight(GarOrderMatchAsk::getGarOrderNumber, associationNumber); | |
| 735 | + int sequenceNumber = askService.list(qw).size(); | |
| 736 | + // 流水编号自增 | |
| 737 | + sequenceNumber++; | |
| 738 | + // 组合生成最终的编号 | |
| 739 | + associationNumber = associationNumber + String.format("%06d", sequenceNumber); // 保证6位数字,不足前面补0 | |
| 740 | + | |
| 741 | + return associationNumber; | |
| 742 | + } | |
| 743 | + | |
| 613 | 744 | @Override |
| 614 | 745 | public String evaluateOrder(EvaluateDto dto) { |
| 615 | 746 | String userId = SecurityUtils.getLoginUser().getUser().getUserId(); |
| ... | ... | @@ -718,7 +849,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 718 | 849 | } |
| 719 | 850 | vo.setGarCarInfoList(carList); |
| 720 | 851 | |
| 721 | - List<GarOrderMatchAsk> matchAsks = matchAskService.queryByOrderId(order.getGarOrderId()); | |
| 852 | + List<GarOrderMatchAsk> matchAsks = askService.queryByOrderId(order.getGarOrderId()); | |
| 722 | 853 | if (CollectionUtils.isNotEmpty(matchAsks)) { |
| 723 | 854 | List<OrderCarReport> orderCarReports = new ArrayList<>(); |
| 724 | 855 | for (GarOrderMatchAsk matchAsk : matchAsks) { |
| ... | ... | @@ -1062,7 +1193,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 1062 | 1193 | handlerService.saveBatch(handlerList); |
| 1063 | 1194 | List<String> tels = handlerList.stream().map(GarOrderMatchHandler::getGarOrderHandlerTel).collect(Collectors.toList()); |
| 1064 | 1195 | // TODO 短信通知 |
| 1065 | - smsUtils.sendMessage(tels, "【装修垃圾清运】订单提醒:您有新的清运订单"+order.getGarOrderId()+",请及时处理!用户联系方式"+order.getGarOrderContactTel()); | |
| 1196 | + smsUtils.sendMessage(tels, "【装修垃圾清运】订单提醒:您有新的清运订单" + order.getGarOrderId() + ",请及时处理!用户联系方式" + order.getGarOrderContactTel()); | |
| 1066 | 1197 | } |
| 1067 | 1198 | |
| 1068 | 1199 | private GarOrderMatchHandler getGarOrderMatchHandler(GarOrder order, DispatchDto.DispatchDetail detail) { |
| ... | ... | @@ -1280,7 +1411,7 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 1280 | 1411 | |
| 1281 | 1412 | List<String> tels = disposalList.stream().map(GarOrderMatchDisposal::getGarOrderDisposalTel).collect(Collectors.toList()); |
| 1282 | 1413 | for (GarOrderMatchHandler garOrderMatchHandler : list) { |
| 1283 | - String content = "【装修垃圾清运】订单提醒:您有新的处置清运订单"+order.getGarOrderId()+",请联系"+order.getGarOrderCompanyName()+"企业 "+garOrderMatchHandler.getGarOrderHandlerName()+" 驾驶员,驾驶员联系方式"+garOrderMatchHandler.getGarOrderHandlerTel()+"!"; | |
| 1414 | + String content = "【装修垃圾清运】订单提醒:您有新的处置清运订单" + order.getGarOrderId() + ",请联系" + order.getGarOrderCompanyName() + "企业 " + garOrderMatchHandler.getGarOrderHandlerName() + " 驾驶员,驾驶员联系方式" + garOrderMatchHandler.getGarOrderHandlerTel() + "!"; | |
| 1284 | 1415 | // TODO 短信通知 |
| 1285 | 1416 | smsUtils.sendMessage(tels, content); |
| 1286 | 1417 | } |
| ... | ... | @@ -1336,31 +1467,35 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> |
| 1336 | 1467 | // 查询当前运载几趟 如果全部运输完毕则发送成功短信 |
| 1337 | 1468 | LambdaQueryWrapper<GarOrderMatchAsk> qw = new LambdaQueryWrapper<>(); |
| 1338 | 1469 | qw.eq(GarOrderMatchAsk::getGarOrderId, dto.getGarOrderId()); |
| 1339 | - int transportCount = askService.list(qw).size(); | |
| 1470 | + List<GarOrderMatchAsk> askList = askService.list(qw); | |
| 1340 | 1471 | GarOrder order = getById(orderId); |
| 1341 | - if (transportCount <= order.getGarRealCarCount() - 1) { | |
| 1342 | - // 第一次的话需要修改订单状态为已扫码 | |
| 1343 | - if (order.getGarOrderScanHandlerFlag().equals(GlobalStatus.GarOrderStatus.SCAN_HANDLER_NO.getValue())) { | |
| 1344 | - order.setGarOrderScanHandlerFlag(GlobalStatus.GarOrderStatus.SCAN_HANDLER_YES.getValue()); | |
| 1345 | - updateById(order); | |
| 1346 | - } | |
| 1347 | - GarOrderMatchAsk ask = new GarOrderMatchAsk(); | |
| 1348 | - BeanUtils.copyProperties(dto, ask); | |
| 1349 | - matchAskService.save(ask); | |
| 1350 | - // 保存图片url | |
| 1351 | - List<GarOrderImage> imageList = new ArrayList<>(dto.getFillImageList().size()); | |
| 1352 | - for (String fillImageUrl : dto.getFillImageList()) { | |
| 1353 | - GarOrderImage image = new GarOrderImage(); | |
| 1354 | - image.setGarOrderImageType(GlobalStatus.GarOrderStatus.IMAGE_TYPE_FILL_CAR.getValue()); | |
| 1355 | - image.setGarOrderId(orderId); | |
| 1356 | - image.setGarOrderImageUrl(fillImageUrl); | |
| 1357 | - image.setGarRemark(ask.getGarId()); | |
| 1358 | - imageList.add(image); | |
| 1472 | + for (GarOrderMatchAsk garOrderMatchAsk : askList) { | |
| 1473 | + if(garOrderMatchAsk.getGarOrderHandlerId()==null){ | |
| 1474 | + // 第一次的话需要修改订单状态为已扫码 | |
| 1475 | + if (order.getGarOrderScanHandlerFlag().equals(GlobalStatus.GarOrderStatus.SCAN_HANDLER_NO.getValue())) { | |
| 1476 | + order.setGarOrderScanHandlerFlag(GlobalStatus.GarOrderStatus.SCAN_HANDLER_YES.getValue()); | |
| 1477 | + updateById(order); | |
| 1478 | + } | |
| 1479 | + BeanUtils.copyProperties(dto, garOrderMatchAsk); | |
| 1480 | + garOrderMatchAsk.setGarUpdateBy(dto.getGarOrderHandlerName()); | |
| 1481 | + garOrderMatchAsk.setGarUpdateTime(new Date()); | |
| 1482 | + garOrderAssociationServiceAsync.isWithinDisposal(dto.getGarHandlerCarCode(), garOrderMatchAsk, dto); | |
| 1483 | + askService.updateById(garOrderMatchAsk); | |
| 1484 | + // 保存图片url | |
| 1485 | + List<GarOrderImage> imageList = new ArrayList<>(dto.getFillImageList().size()); | |
| 1486 | + for (String fillImageUrl : dto.getFillImageList()) { | |
| 1487 | + GarOrderImage image = new GarOrderImage(); | |
| 1488 | + image.setGarOrderImageType(GlobalStatus.GarOrderStatus.IMAGE_TYPE_FILL_CAR.getValue()); | |
| 1489 | + image.setGarOrderId(orderId); | |
| 1490 | + image.setGarOrderImageUrl(fillImageUrl); | |
| 1491 | + image.setGarRemark(garOrderMatchAsk.getGarId()); | |
| 1492 | + imageList.add(image); | |
| 1493 | + } | |
| 1494 | + garOrderImageService.saveBatch(imageList); | |
| 1495 | + // TODO 删除验证码 | |
| 1496 | + redisCache.deleteObject(orderId, dto.getGarOrderHandlerId()); | |
| 1497 | + return "当前趟次记录成功"; | |
| 1359 | 1498 | } |
| 1360 | - garOrderImageService.saveBatch(imageList); | |
| 1361 | - // TODO 删除验证码 | |
| 1362 | - redisCache.deleteObject(orderId, dto.getGarOrderHandlerId()); | |
| 1363 | - return "当前趟次记录成功"; | |
| 1364 | 1499 | } |
| 1365 | 1500 | throw new BizException(ResultCode.CODE_400, "当前记录无效,已完成所有趟次!"); |
| 1366 | 1501 | } | ... | ... |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
| ... | ... | @@ -113,6 +113,8 @@ public class GarUserServiceImpl extends ServiceImpl<GarUserMapper, GarUser> |
| 113 | 113 | public LoginVo login(LoginDto loginDto) { |
| 114 | 114 | LoginVo vo = new LoginVo(); |
| 115 | 115 | |
| 116 | + vo.setLoginPhone(loginDto.getTel()); | |
| 117 | + | |
| 116 | 118 | if (Objects.isNull(loginDto)) { |
| 117 | 119 | throw new UsernameNotFoundException("当前用户不存在!"); |
| 118 | 120 | } | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderMapper.xml
| ... | ... | @@ -156,7 +156,7 @@ |
| 156 | 156 | `order`.gar_order_id |
| 157 | 157 | WHEN `order`.gar_order_id THEN |
| 158 | 158 | ( SELECT count(*) FROM gar_order_match_ask ask INNER JOIN gar_order ON `gar_order`.gar_order_id = |
| 159 | - `ask`.gar_order_id WHERE `order`.gar_order_id = `gar_order`.gar_order_id ) | |
| 159 | + `ask`.gar_order_id WHERE `order`.gar_order_id = `gar_order`.gar_order_id and ask.gar_order_handler_id is not null) | |
| 160 | 160 | END |
| 161 | 161 | ) AS gar_now_car_count |
| 162 | 162 | FROM | ... | ... |
trash-garbage/src/main/resources/mapper/GarOrderMatchAskMapper.xml
| ... | ... | @@ -27,4 +27,165 @@ |
| 27 | 27 | gar_update_by,gar_remark |
| 28 | 28 | </sql> |
| 29 | 29 | |
| 30 | + <resultMap type="GarOrderMatchAsk" id="GarOrderMatchAskResult"> | |
| 31 | + <result property="garId" column="gar_id" /> | |
| 32 | + <result property="garOrderId" column="gar_order_id" /> | |
| 33 | + <result property="garOrderHandlerTel" column="gar_order_handler_tel" /> | |
| 34 | + <result property="garOrderHandlerName" column="gar_order_handler_name" /> | |
| 35 | + <result property="garOrderContainerVolume" column="gar_order_container_volume" /> | |
| 36 | + <result property="garOrderHandlerId" column="gar_order_handler_id" /> | |
| 37 | + <result property="garHandlerCarCode" column="gar_handler_car_code" /> | |
| 38 | + <result property="garOrderHandlerCompanyId" column="gar_order_handler_company_id" /> | |
| 39 | + <result property="garOrderHandlerCompanyName" column="gar_order_handler_company_name" /> | |
| 40 | + <result property="garCreateTime" column="gar_create_time" /> | |
| 41 | + <result property="garUpdateTime" column="gar_update_time" /> | |
| 42 | + <result property="garCreateBy" column="gar_create_by" /> | |
| 43 | + <result property="garUpdateBy" column="gar_update_by" /> | |
| 44 | + <result property="garRemark" column="gar_remark" /> | |
| 45 | + <result property="garCarryingWeight" column="gar_carrying_weight" /> | |
| 46 | + <result property="garReceptionQuantity" column="gar_reception_quantity" /> | |
| 47 | + <result property="dropPointId" column="drop_point_id" /> | |
| 48 | + <result property="dropPointName" column="drop_point_name" /> | |
| 49 | + <result property="garOrderType" column="gar_order_type" /> | |
| 50 | + <result property="disposalId" column="disposal_id" /> | |
| 51 | + <result property="disposalSiteName" column="disposal_site_name" /> | |
| 52 | + <result property="garOrderNumber" column="gar_order_number" /> | |
| 53 | + <result property="garOrderPhone" column="gar_order_phone" /> | |
| 54 | + <result property="garOrderName" column="gar_order_name" /> | |
| 55 | + </resultMap> | |
| 56 | + | |
| 57 | + <sql id="selectGarOrderMatchAskVo"> | |
| 58 | + select gar_id, gar_order_id, gar_order_handler_tel, gar_order_handler_name, gar_order_container_volume, gar_order_handler_id, gar_handler_car_code, gar_order_handler_company_id, gar_order_handler_company_name, gar_create_time, gar_update_time, gar_create_by, gar_update_by, gar_remark, gar_carrying_weight, gar_reception_quantity, drop_point_id, drop_point_name, gar_order_type, disposal_id, disposal_site_name, gar_order_number, gar_order_phone, gar_order_name from gar_order_match_ask | |
| 59 | + </sql> | |
| 60 | + | |
| 61 | + <select id="selectGarOrderMatchAskList" parameterType="GarOrderMatchAsk" resultMap="GarOrderMatchAskResult"> | |
| 62 | + <include refid="selectGarOrderMatchAskVo"/> | |
| 63 | + <where> | |
| 64 | + <if test="garOrderId != null and garOrderId != ''"> and gar_order_id = #{garOrderId}</if> | |
| 65 | + <if test="garOrderHandlerTel != null and garOrderHandlerTel != ''"> and gar_order_handler_tel = #{garOrderHandlerTel}</if> | |
| 66 | + <if test="garOrderHandlerName != null and garOrderHandlerName != ''"> and gar_order_handler_name like concat('%', #{garOrderHandlerName}, '%')</if> | |
| 67 | + <if test="garOrderContainerVolume != null and garOrderContainerVolume != ''"> and gar_order_container_volume = #{garOrderContainerVolume}</if> | |
| 68 | + <if test="garOrderHandlerId != null and garOrderHandlerId != ''"> and gar_order_handler_id = #{garOrderHandlerId}</if> | |
| 69 | + <if test="garHandlerCarCode != null and garHandlerCarCode != ''"> and gar_handler_car_code = #{garHandlerCarCode}</if> | |
| 70 | + <if test="garOrderHandlerCompanyId != null and garOrderHandlerCompanyId != ''"> and gar_order_handler_company_id = #{garOrderHandlerCompanyId}</if> | |
| 71 | + <if test="garOrderHandlerCompanyName != null and garOrderHandlerCompanyName != ''"> and gar_order_handler_company_name like concat('%', #{garOrderHandlerCompanyName}, '%')</if> | |
| 72 | + <if test="garCreateTime != null "> and gar_create_time = #{garCreateTime}</if> | |
| 73 | + <if test="garUpdateTime != null "> and gar_update_time = #{garUpdateTime}</if> | |
| 74 | + <if test="garCreateBy != null and garCreateBy != ''"> and gar_create_by = #{garCreateBy}</if> | |
| 75 | + <if test="garUpdateBy != null and garUpdateBy != ''"> and gar_update_by = #{garUpdateBy}</if> | |
| 76 | + <if test="garRemark != null and garRemark != ''"> and gar_remark = #{garRemark}</if> | |
| 77 | + <if test="garCarryingWeight != null "> and gar_carrying_weight = #{garCarryingWeight}</if> | |
| 78 | + <if test="garReceptionQuantity != null "> and gar_reception_quantity = #{garReceptionQuantity}</if> | |
| 79 | + <if test="dropPointName != null and dropPointName != ''"> and drop_point_name like concat('%', #{dropPointName}, '%')</if> | |
| 80 | + <if test="garOrderType != null and garOrderType != ''"> and gar_order_type = #{garOrderType}</if> | |
| 81 | + <if test="disposalId != null and disposalId != ''"> and disposal_id = #{disposalId}</if> | |
| 82 | + <if test="disposalSiteName != null and disposalSiteName != ''"> and disposal_site_name like concat('%', #{disposalSiteName}, '%')</if> | |
| 83 | + <if test="garOrderNumber != null and garOrderNumber != ''"> and gar_order_number = #{garOrderNumber}</if> | |
| 84 | + <if test="garOrderPhone != null and garOrderPhone != ''"> and gar_order_phone = #{garOrderPhone}</if> | |
| 85 | + <if test="garOrderName != null and garOrderName != ''"> and gar_order_name like concat('%', #{garOrderName}, '%')</if> | |
| 86 | + </where> | |
| 87 | + </select> | |
| 88 | + | |
| 89 | + <select id="selectGarOrderMatchAskById" parameterType="String" resultMap="GarOrderMatchAskResult"> | |
| 90 | + <include refid="selectGarOrderMatchAskVo"/> | |
| 91 | + where gar_id = #{garId} | |
| 92 | + </select> | |
| 93 | + | |
| 94 | + <insert id="insertGarOrderMatchAsk" parameterType="GarOrderMatchAsk"> | |
| 95 | + insert into gar_order_match_ask | |
| 96 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
| 97 | + <if test="garId != null">gar_id,</if> | |
| 98 | + <if test="garOrderId != null">gar_order_id,</if> | |
| 99 | + <if test="garOrderHandlerTel != null">gar_order_handler_tel,</if> | |
| 100 | + <if test="garOrderHandlerName != null">gar_order_handler_name,</if> | |
| 101 | + <if test="garOrderContainerVolume != null">gar_order_container_volume,</if> | |
| 102 | + <if test="garOrderHandlerId != null">gar_order_handler_id,</if> | |
| 103 | + <if test="garHandlerCarCode != null">gar_handler_car_code,</if> | |
| 104 | + <if test="garOrderHandlerCompanyId != null">gar_order_handler_company_id,</if> | |
| 105 | + <if test="garOrderHandlerCompanyName != null">gar_order_handler_company_name,</if> | |
| 106 | + <if test="garCreateTime != null">gar_create_time,</if> | |
| 107 | + <if test="garUpdateTime != null">gar_update_time,</if> | |
| 108 | + <if test="garCreateBy != null">gar_create_by,</if> | |
| 109 | + <if test="garUpdateBy != null">gar_update_by,</if> | |
| 110 | + <if test="garRemark != null">gar_remark,</if> | |
| 111 | + <if test="garCarryingWeight != null">gar_carrying_weight,</if> | |
| 112 | + <if test="garReceptionQuantity != null">gar_reception_quantity,</if> | |
| 113 | + <if test="dropPointId != null">drop_point_id,</if> | |
| 114 | + <if test="dropPointName != null">drop_point_name,</if> | |
| 115 | + <if test="garOrderType != null">gar_order_type,</if> | |
| 116 | + <if test="disposalId != null">disposal_id,</if> | |
| 117 | + <if test="disposalSiteName != null">disposal_site_name,</if> | |
| 118 | + <if test="garOrderNumber != null">gar_order_number,</if> | |
| 119 | + <if test="garOrderPhone != null">gar_order_phone,</if> | |
| 120 | + <if test="garOrderName != null">gar_order_name,</if> | |
| 121 | + </trim> | |
| 122 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
| 123 | + <if test="garId != null">#{garId},</if> | |
| 124 | + <if test="garOrderId != null">#{garOrderId},</if> | |
| 125 | + <if test="garOrderHandlerTel != null">#{garOrderHandlerTel},</if> | |
| 126 | + <if test="garOrderHandlerName != null">#{garOrderHandlerName},</if> | |
| 127 | + <if test="garOrderContainerVolume != null">#{garOrderContainerVolume},</if> | |
| 128 | + <if test="garOrderHandlerId != null">#{garOrderHandlerId},</if> | |
| 129 | + <if test="garHandlerCarCode != null">#{garHandlerCarCode},</if> | |
| 130 | + <if test="garOrderHandlerCompanyId != null">#{garOrderHandlerCompanyId},</if> | |
| 131 | + <if test="garOrderHandlerCompanyName != null">#{garOrderHandlerCompanyName},</if> | |
| 132 | + <if test="garCreateTime != null">#{garCreateTime},</if> | |
| 133 | + <if test="garUpdateTime != null">#{garUpdateTime},</if> | |
| 134 | + <if test="garCreateBy != null">#{garCreateBy},</if> | |
| 135 | + <if test="garUpdateBy != null">#{garUpdateBy},</if> | |
| 136 | + <if test="garRemark != null">#{garRemark},</if> | |
| 137 | + <if test="garCarryingWeight != null">#{garCarryingWeight},</if> | |
| 138 | + <if test="garReceptionQuantity != null">#{garReceptionQuantity},</if> | |
| 139 | + <if test="dropPointId != null">#{dropPointId},</if> | |
| 140 | + <if test="dropPointName != null">#{dropPointName},</if> | |
| 141 | + <if test="garOrderType != null">#{garOrderType},</if> | |
| 142 | + <if test="disposalId != null">#{disposalId},</if> | |
| 143 | + <if test="disposalSiteName != null">#{disposalSiteName},</if> | |
| 144 | + <if test="garOrderNumber != null">#{garOrderNumber},</if> | |
| 145 | + <if test="garOrderPhone != null">#{garOrderPhone},</if> | |
| 146 | + <if test="garOrderName != null">#{garOrderName},</if> | |
| 147 | + </trim> | |
| 148 | + </insert> | |
| 149 | + | |
| 150 | + <update id="updateGarOrderMatchAsk" parameterType="GarOrderMatchAsk"> | |
| 151 | + update gar_order_match_ask | |
| 152 | + <trim prefix="SET" suffixOverrides=","> | |
| 153 | + <if test="garOrderId != null">gar_order_id = #{garOrderId},</if> | |
| 154 | + <if test="garOrderHandlerTel != null">gar_order_handler_tel = #{garOrderHandlerTel},</if> | |
| 155 | + <if test="garOrderHandlerName != null">gar_order_handler_name = #{garOrderHandlerName},</if> | |
| 156 | + <if test="garOrderContainerVolume != null">gar_order_container_volume = #{garOrderContainerVolume},</if> | |
| 157 | + <if test="garOrderHandlerId != null">gar_order_handler_id = #{garOrderHandlerId},</if> | |
| 158 | + <if test="garHandlerCarCode != null">gar_handler_car_code = #{garHandlerCarCode},</if> | |
| 159 | + <if test="garOrderHandlerCompanyId != null">gar_order_handler_company_id = #{garOrderHandlerCompanyId},</if> | |
| 160 | + <if test="garOrderHandlerCompanyName != null">gar_order_handler_company_name = #{garOrderHandlerCompanyName},</if> | |
| 161 | + <if test="garCreateTime != null">gar_create_time = #{garCreateTime},</if> | |
| 162 | + <if test="garUpdateTime != null">gar_update_time = #{garUpdateTime},</if> | |
| 163 | + <if test="garCreateBy != null">gar_create_by = #{garCreateBy},</if> | |
| 164 | + <if test="garUpdateBy != null">gar_update_by = #{garUpdateBy},</if> | |
| 165 | + <if test="garRemark != null">gar_remark = #{garRemark},</if> | |
| 166 | + <if test="garCarryingWeight != null">gar_carrying_weight = #{garCarryingWeight},</if> | |
| 167 | + <if test="garReceptionQuantity != null">gar_reception_quantity = #{garReceptionQuantity},</if> | |
| 168 | + <if test="dropPointId != null">drop_point_id = #{dropPointId},</if> | |
| 169 | + <if test="dropPointName != null">drop_point_name = #{dropPointName},</if> | |
| 170 | + <if test="garOrderType != null">gar_order_type = #{garOrderType},</if> | |
| 171 | + <if test="disposalId != null">disposal_id = #{disposalId},</if> | |
| 172 | + <if test="disposalSiteName != null">disposal_site_name = #{disposalSiteName},</if> | |
| 173 | + <if test="garOrderNumber != null">gar_order_number = #{garOrderNumber},</if> | |
| 174 | + <if test="garOrderPhone != null">gar_order_phone = #{garOrderPhone},</if> | |
| 175 | + <if test="garOrderName != null">gar_order_name = #{garOrderName},</if> | |
| 176 | + </trim> | |
| 177 | + where gar_id = #{garId} | |
| 178 | + </update> | |
| 179 | + | |
| 180 | + <delete id="deleteGarOrderMatchAskById" parameterType="String"> | |
| 181 | + delete from gar_order_match_ask where gar_id = #{garId} | |
| 182 | + </delete> | |
| 183 | + | |
| 184 | + <delete id="deleteGarOrderMatchAskByIds" parameterType="String"> | |
| 185 | + delete from gar_order_match_ask where gar_id in | |
| 186 | + <foreach item="garId" collection="array" open="(" separator="," close=")"> | |
| 187 | + #{garId} | |
| 188 | + </foreach> | |
| 189 | + </delete> | |
| 190 | + | |
| 30 | 191 | </mapper> | ... | ... |
trash-ui/src/api/ask/ask.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 查询趟次关联台账列表 | |
| 4 | +export function listAsk(query) { | |
| 5 | + return request({ | |
| 6 | + url: '/ask/ask/list', | |
| 7 | + method: 'get', | |
| 8 | + params: query | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 查询趟次关联台账详细 | |
| 13 | +export function getAsk(garId) { | |
| 14 | + return request({ | |
| 15 | + url: '/ask/ask/' + garId, | |
| 16 | + method: 'get' | |
| 17 | + }) | |
| 18 | +} | |
| 19 | + | |
| 20 | +// 新增趟次关联台账 | |
| 21 | +export function addAsk(data) { | |
| 22 | + return request({ | |
| 23 | + url: '/ask/ask', | |
| 24 | + method: 'post', | |
| 25 | + data: data | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 修改趟次关联台账 | |
| 30 | +export function updateAsk(data) { | |
| 31 | + return request({ | |
| 32 | + url: '/ask/ask', | |
| 33 | + method: 'put', | |
| 34 | + data: data | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 删除趟次关联台账 | |
| 39 | +export function delAsk(garId) { | |
| 40 | + return request({ | |
| 41 | + url: '/ask/ask/' + garId, | |
| 42 | + method: 'delete' | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 导出趟次关联台账 | |
| 47 | +export function exportAsk(query) { | |
| 48 | + return request({ | |
| 49 | + url: '/ask/ask/export', | |
| 50 | + method: 'get', | |
| 51 | + params: query | |
| 52 | + }) | |
| 53 | +} | |
| 0 | 54 | \ No newline at end of file | ... | ... |
trash-ui/src/views/ask/ask/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> | |
| 4 | + <el-form-item label="订单 id" prop="garOrderId"> | |
| 5 | + <el-input | |
| 6 | + v-model="queryParams.garOrderId" | |
| 7 | + placeholder="请输入订单 id" | |
| 8 | + clearable | |
| 9 | + size="small" | |
| 10 | + @keyup.enter.native="handleQuery" | |
| 11 | + /> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item label="运输驾驶员" prop="garOrderHandlerName"> | |
| 14 | + <el-input | |
| 15 | + v-model="queryParams.garOrderHandlerName" | |
| 16 | + placeholder="请输入运输驾驶员" | |
| 17 | + clearable | |
| 18 | + size="small" | |
| 19 | + @keyup.enter.native="handleQuery" | |
| 20 | + /> | |
| 21 | + </el-form-item> | |
| 22 | + <el-form-item label="车牌号" prop="garHandlerCarCode"> | |
| 23 | + <el-input | |
| 24 | + v-model="queryParams.garHandlerCarCode" | |
| 25 | + placeholder="请输入车牌号" | |
| 26 | + clearable | |
| 27 | + size="small" | |
| 28 | + @keyup.enter.native="handleQuery" | |
| 29 | + /> | |
| 30 | + </el-form-item> | |
| 31 | + <el-form-item label="公司名称" prop="garOrderHandlerCompanyName"> | |
| 32 | + <el-input | |
| 33 | + v-model="queryParams.garOrderHandlerCompanyName" | |
| 34 | + placeholder="请输入公司名称" | |
| 35 | + clearable | |
| 36 | + size="small" | |
| 37 | + @keyup.enter.native="handleQuery" | |
| 38 | + /> | |
| 39 | + </el-form-item> | |
| 40 | + <el-form-item label="投放点" prop="dropPointName"> | |
| 41 | + <el-input | |
| 42 | + v-model="queryParams.dropPointName" | |
| 43 | + placeholder="请输入投放点" | |
| 44 | + clearable | |
| 45 | + size="small" | |
| 46 | + @keyup.enter.native="handleQuery" | |
| 47 | + /> | |
| 48 | + </el-form-item> | |
| 49 | + <el-form-item label="趟次类型" prop="garOrderType"> | |
| 50 | + <el-select v-model="queryParams.garOrderType" placeholder="请选择趟次类型" clearable size="small"> | |
| 51 | + <el-option label="全部" value="" /> | |
| 52 | + <el-option label="正常趟次" value="0" /> | |
| 53 | + <el-option label="异常趟次" value="1" /> | |
| 54 | + </el-select> | |
| 55 | + </el-form-item> | |
| 56 | + <el-form-item label="处理场所" prop="disposalSiteName"> | |
| 57 | + <el-input | |
| 58 | + v-model="queryParams.disposalSiteName" | |
| 59 | + placeholder="请输入处理场所" | |
| 60 | + clearable | |
| 61 | + size="small" | |
| 62 | + @keyup.enter.native="handleQuery" | |
| 63 | + /> | |
| 64 | + </el-form-item> | |
| 65 | + <el-form-item label="订单编号" prop="garOrderNumber"> | |
| 66 | + <el-input | |
| 67 | + v-model="queryParams.garOrderNumber" | |
| 68 | + placeholder="请输入订单编号" | |
| 69 | + clearable | |
| 70 | + size="small" | |
| 71 | + @keyup.enter.native="handleQuery" | |
| 72 | + /> | |
| 73 | + </el-form-item> | |
| 74 | +<!-- <el-form-item label="下单手机号" prop="garOrderPhone">--> | |
| 75 | +<!-- <el-input--> | |
| 76 | +<!-- v-model="queryParams.garOrderPhone"--> | |
| 77 | +<!-- placeholder="请输入下单人手机号"--> | |
| 78 | +<!-- clearable--> | |
| 79 | +<!-- size="small"--> | |
| 80 | +<!-- @keyup.enter.native="handleQuery"--> | |
| 81 | +<!-- />--> | |
| 82 | +<!-- </el-form-item>--> | |
| 83 | +<!-- <el-form-item label="下单人" prop="garOrderName">--> | |
| 84 | +<!-- <el-input--> | |
| 85 | +<!-- v-model="queryParams.garOrderName"--> | |
| 86 | +<!-- placeholder="请输入下单人"--> | |
| 87 | +<!-- clearable--> | |
| 88 | +<!-- size="small"--> | |
| 89 | +<!-- @keyup.enter.native="handleQuery"--> | |
| 90 | +<!-- />--> | |
| 91 | +<!-- </el-form-item>--> | |
| 92 | + <el-form-item> | |
| 93 | + <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> | |
| 94 | + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> | |
| 95 | + </el-form-item> | |
| 96 | + </el-form> | |
| 97 | + | |
| 98 | + <el-row :gutter="10" class="mb8"> | |
| 99 | + <el-col :span="1.5"> | |
| 100 | + <el-button | |
| 101 | + type="warning" | |
| 102 | + icon="el-icon-download" | |
| 103 | + size="mini" | |
| 104 | + @click="handleExport" | |
| 105 | + v-hasPermi="['ask:ask:export']" | |
| 106 | + >导出</el-button> | |
| 107 | + </el-col> | |
| 108 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 109 | + </el-row> | |
| 110 | + | |
| 111 | + <el-table v-loading="loading" :data="askList" @selection-change="handleSelectionChange"> | |
| 112 | + <el-table-column type="selection" width="55" align="center" /> | |
| 113 | + <el-table-column label="订单 id" align="center" prop="garOrderId" /> | |
| 114 | + <el-table-column label="联单编号" align="center" prop="garOrderNumber" /> | |
| 115 | + <el-table-column label="订单生成时间" align="center" prop="garCreateTime" width="180"> | |
| 116 | + <template slot-scope="scope"> | |
| 117 | + <span>{{ parseTime(scope.row.garCreateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> | |
| 118 | + </template> | |
| 119 | + </el-table-column> | |
| 120 | + <el-table-column label="投放点" align="center" prop="dropPointName" /> | |
| 121 | + <el-table-column label="运输企业" align="center" prop="garOrderHandlerCompanyName" /> | |
| 122 | + <el-table-column label="运输驾驶员" align="center" prop="garOrderHandlerName" /> | |
| 123 | + <el-table-column label="车牌号" align="center" prop="garHandlerCarCode" /> | |
| 124 | + <el-table-column label="处理场所" align="center" prop="disposalSiteName" /> | |
| 125 | + <el-table-column label="接收时间" align="center" prop="garCreateTime" width="180"> | |
| 126 | + <template slot-scope="scope"> | |
| 127 | + <span>{{ parseTime(scope.row.garCreateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> | |
| 128 | + </template> | |
| 129 | + </el-table-column> | |
| 130 | + <el-table-column label="接收量(吨)" align="center" prop="garReceptionQuantity" /> | |
| 131 | + <el-table-column label="趟次类型" align="center" prop="garOrderType" /> | |
| 132 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 133 | + <template slot-scope="scope"> | |
| 134 | + <el-button | |
| 135 | + size="mini" | |
| 136 | + type="text" | |
| 137 | + @click="handleUpdate(scope.row)" | |
| 138 | + >联单详情</el-button> | |
| 139 | + </template> | |
| 140 | + </el-table-column> | |
| 141 | + </el-table> | |
| 142 | + | |
| 143 | + <pagination | |
| 144 | + v-show="total>0" | |
| 145 | + :total="total" | |
| 146 | + :page.sync="queryParams.pageNum" | |
| 147 | + :limit.sync="queryParams.pageSize" | |
| 148 | + @pagination="getList" | |
| 149 | + /> | |
| 150 | + | |
| 151 | + <!-- 添加或修改趟次关联台账对话框 --> | |
| 152 | + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body> | |
| 153 | + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |
| 154 | + <el-row> | |
| 155 | + <el-col :span="12"> | |
| 156 | + <el-form-item label="订单 id" prop="garOrderId"> | |
| 157 | + <el-input v-model="form.garOrderId" placeholder="请输入订单 id" /> | |
| 158 | + </el-form-item> | |
| 159 | + </el-col> | |
| 160 | + <el-col :span="12"> | |
| 161 | + <el-form-item label="订单编号" prop="garOrderNumber"> | |
| 162 | + <el-input v-model="form.garOrderNumber" placeholder="请输入订单编号" /> | |
| 163 | + </el-form-item> | |
| 164 | + </el-col> | |
| 165 | + </el-row> | |
| 166 | + <el-row> | |
| 167 | + <el-col :span="12"> | |
| 168 | + <el-form-item label="运输驾驶员手机号" prop="garOrderHandlerTel"> | |
| 169 | + <el-input v-model="form.garOrderHandlerTel" placeholder="请输入运输驾驶员手机号" /> | |
| 170 | + </el-form-item> | |
| 171 | + </el-col> | |
| 172 | + <el-col :span="12"> | |
| 173 | + <el-form-item label="运输驾驶员" prop="garOrderHandlerName"> | |
| 174 | + <el-input v-model="form.garOrderHandlerName" placeholder="请输入运输驾驶员" /> | |
| 175 | + </el-form-item> | |
| 176 | + </el-col> | |
| 177 | + </el-row> | |
| 178 | + <el-row> | |
| 179 | + <el-col :span="12"> | |
| 180 | + <el-form-item label="车辆类型" prop="garOrderContainerVolume"> | |
| 181 | + <el-input v-model="form.garOrderContainerVolume" placeholder="请输入车辆类型" /> | |
| 182 | + </el-form-item> | |
| 183 | + </el-col> | |
| 184 | + <el-col :span="12"> | |
| 185 | + <el-form-item label="车牌号" prop="garHandlerCarCode"> | |
| 186 | + <el-input v-model="form.garHandlerCarCode" placeholder="请输入车牌号" /> | |
| 187 | + </el-form-item> | |
| 188 | + </el-col> | |
| 189 | + </el-row> | |
| 190 | + <el-row> | |
| 191 | + <el-col :span="12"> | |
| 192 | + <el-form-item label="公司名称" prop="garOrderHandlerCompanyName"> | |
| 193 | + <el-input v-model="form.garOrderHandlerCompanyName" placeholder="请输入公司名称" /> | |
| 194 | + </el-form-item> | |
| 195 | + </el-col> | |
| 196 | + <el-col :span="12"> | |
| 197 | + <el-form-item label="生成时间" prop="garCreateTime"> | |
| 198 | + <el-date-picker clearable size="small" style="width: 100%" | |
| 199 | + v-model="form.garCreateTime" | |
| 200 | + type="date" | |
| 201 | + value-format="yyyy-MM-dd HH:mm:ss" | |
| 202 | + placeholder="选择公司名称"> | |
| 203 | + </el-date-picker> | |
| 204 | + </el-form-item> | |
| 205 | + </el-col> | |
| 206 | + </el-row> | |
| 207 | + <el-row> | |
| 208 | + <el-col :span="12"> | |
| 209 | + <el-form-item label="接收时间" prop="garUpdateTime"> | |
| 210 | + <el-date-picker clearable size="small" style="width: 100%" | |
| 211 | + v-model="form.garUpdateTime" | |
| 212 | + type="date" | |
| 213 | + value-format="yyyy-MM-dd HH:mm:ss" | |
| 214 | + placeholder="选择公司名称"> | |
| 215 | + </el-date-picker> | |
| 216 | + </el-form-item> | |
| 217 | + </el-col> | |
| 218 | + <el-col :span="12"> | |
| 219 | + <el-form-item label="重量" prop="garCarryingWeight"> | |
| 220 | + <el-input v-model="form.garCarryingWeight" placeholder="请输入重量" /> | |
| 221 | + </el-form-item> | |
| 222 | + </el-col> | |
| 223 | + </el-row> | |
| 224 | + <el-row> | |
| 225 | + <el-col :span="12"> | |
| 226 | + <el-form-item label="接收量" prop="garReceptionQuantity"> | |
| 227 | + <el-input v-model="form.garReceptionQuantity" placeholder="请输入接收量" /> | |
| 228 | + </el-form-item> | |
| 229 | + </el-col> | |
| 230 | + <el-col :span="12"> | |
| 231 | + <el-form-item label="投放点" prop="dropPointName"> | |
| 232 | + <el-input v-model="form.dropPointName" placeholder="请输入投放点" /> | |
| 233 | + </el-form-item> | |
| 234 | + </el-col> | |
| 235 | + </el-row> | |
| 236 | + <el-row> | |
| 237 | + <el-col :span="12"> | |
| 238 | + <el-form-item label="趟次类型" prop="garOrderType"> | |
| 239 | + <el-select v-model="form.garOrderType" placeholder="请选择趟次类型0=正常趟次,1=异常趟次" style="width: 100%"> | |
| 240 | + <el-option label="正常趟次" value="0" /> | |
| 241 | + <el-option label="异常趟次" value="1" /> | |
| 242 | + </el-select> | |
| 243 | + </el-form-item> | |
| 244 | + </el-col> | |
| 245 | + <el-col :span="12"> | |
| 246 | + <el-form-item label="处理场所" prop="disposalSiteName"> | |
| 247 | + <el-input v-model="form.disposalSiteName" placeholder="请输入处理场所" /> | |
| 248 | + </el-form-item> | |
| 249 | + </el-col> | |
| 250 | + </el-row> | |
| 251 | + <el-row> | |
| 252 | + <el-col :span="12"> | |
| 253 | + | |
| 254 | + </el-col> | |
| 255 | + <el-col :span="12"> | |
| 256 | + | |
| 257 | + </el-col> | |
| 258 | + </el-row> | |
| 259 | + <el-row> | |
| 260 | + <el-col :span="12"> | |
| 261 | + <el-form-item label="下单手机号" prop="garOrderPhone"> | |
| 262 | + <el-input v-model="form.garOrderPhone" placeholder="请输入下单手机号" /> | |
| 263 | + </el-form-item> | |
| 264 | + </el-col> | |
| 265 | + <el-col :span="12"> | |
| 266 | + <el-form-item label="下单人" prop="garOrderName"> | |
| 267 | + <el-input v-model="form.garOrderName" placeholder="请输入下单人" /> | |
| 268 | + </el-form-item> | |
| 269 | + </el-col> | |
| 270 | + </el-row> | |
| 271 | + <el-row> | |
| 272 | + <el-col> | |
| 273 | + <el-form-item label="备注" prop="garRemark"> | |
| 274 | + <el-input v-model="form.garRemark" placeholder="请输入备注" /> | |
| 275 | + </el-form-item> | |
| 276 | + </el-col> | |
| 277 | + </el-row> | |
| 278 | + </el-form> | |
| 279 | + <div slot="footer" class="dialog-footer"> | |
| 280 | + <el-button @click="cancel">取 消</el-button> | |
| 281 | + </div> | |
| 282 | + </el-dialog> | |
| 283 | + </div> | |
| 284 | +</template> | |
| 285 | + | |
| 286 | +<script> | |
| 287 | +import { listAsk, getAsk, delAsk, addAsk, updateAsk, exportAsk } from "@/api/ask/ask"; | |
| 288 | + | |
| 289 | +export default { | |
| 290 | + name: "Ask", | |
| 291 | + data() { | |
| 292 | + return { | |
| 293 | + // 遮罩层 | |
| 294 | + loading: true, | |
| 295 | + // 选中数组 | |
| 296 | + ids: [], | |
| 297 | + // 非单个禁用 | |
| 298 | + single: true, | |
| 299 | + // 非多个禁用 | |
| 300 | + multiple: true, | |
| 301 | + // 显示搜索条件 | |
| 302 | + showSearch: true, | |
| 303 | + // 总条数 | |
| 304 | + total: 0, | |
| 305 | + // 趟次关联台账表格数据 | |
| 306 | + askList: [], | |
| 307 | + // 弹出层标题 | |
| 308 | + title: "", | |
| 309 | + // 是否显示弹出层 | |
| 310 | + open: false, | |
| 311 | + // 查询参数 | |
| 312 | + queryParams: { | |
| 313 | + pageNum: 1, | |
| 314 | + pageSize: 10, | |
| 315 | + garOrderId: null, | |
| 316 | + garOrderHandlerTel: null, | |
| 317 | + garOrderHandlerName: null, | |
| 318 | + garOrderContainerVolume: null, | |
| 319 | + garOrderHandlerId: null, | |
| 320 | + garHandlerCarCode: null, | |
| 321 | + garOrderHandlerCompanyId: null, | |
| 322 | + garOrderHandlerCompanyName: null, | |
| 323 | + garCreateTime: null, | |
| 324 | + garUpdateTime: null, | |
| 325 | + garCreateBy: null, | |
| 326 | + garUpdateBy: null, | |
| 327 | + garRemark: null, | |
| 328 | + garCarryingWeight: null, | |
| 329 | + garReceptionQuantity: null, | |
| 330 | + dropPointId: null, | |
| 331 | + dropPointName: null, | |
| 332 | + garOrderType: null, | |
| 333 | + disposalId: null, | |
| 334 | + disposalSiteName: null, | |
| 335 | + garOrderNumber: null, | |
| 336 | + garOrderPhone: null, | |
| 337 | + garOrderName: null | |
| 338 | + }, | |
| 339 | + // 表单参数 | |
| 340 | + form: {}, | |
| 341 | + // 表单校验 | |
| 342 | + rules: { | |
| 343 | + } | |
| 344 | + }; | |
| 345 | + }, | |
| 346 | + created() { | |
| 347 | + this.getList(); | |
| 348 | + }, | |
| 349 | + methods: { | |
| 350 | + /** 查询趟次关联台账列表 */ | |
| 351 | + getList() { | |
| 352 | + this.loading = true; | |
| 353 | + listAsk(this.queryParams).then(response => { | |
| 354 | + this.askList = response.rows; | |
| 355 | + this.total = response.total; | |
| 356 | + this.loading = false; | |
| 357 | + }); | |
| 358 | + }, | |
| 359 | + // 取消按钮 | |
| 360 | + cancel() { | |
| 361 | + this.open = false; | |
| 362 | + this.reset(); | |
| 363 | + }, | |
| 364 | + // 表单重置 | |
| 365 | + reset() { | |
| 366 | + this.form = { | |
| 367 | + garId: null, | |
| 368 | + garOrderId: null, | |
| 369 | + garOrderHandlerTel: null, | |
| 370 | + garOrderHandlerName: null, | |
| 371 | + garOrderContainerVolume: null, | |
| 372 | + garOrderHandlerId: null, | |
| 373 | + garHandlerCarCode: null, | |
| 374 | + garOrderHandlerCompanyId: null, | |
| 375 | + garOrderHandlerCompanyName: null, | |
| 376 | + garCreateTime: null, | |
| 377 | + garUpdateTime: null, | |
| 378 | + garCreateBy: null, | |
| 379 | + garUpdateBy: null, | |
| 380 | + garRemark: null, | |
| 381 | + garCarryingWeight: null, | |
| 382 | + garReceptionQuantity: null, | |
| 383 | + dropPointId: null, | |
| 384 | + dropPointName: null, | |
| 385 | + garOrderType: null, | |
| 386 | + disposalId: null, | |
| 387 | + disposalSiteName: null, | |
| 388 | + garOrderNumber: null, | |
| 389 | + garOrderPhone: null, | |
| 390 | + garOrderName: null | |
| 391 | + }; | |
| 392 | + this.resetForm("form"); | |
| 393 | + }, | |
| 394 | + /** 搜索按钮操作 */ | |
| 395 | + handleQuery() { | |
| 396 | + this.queryParams.pageNum = 1; | |
| 397 | + this.getList(); | |
| 398 | + }, | |
| 399 | + /** 重置按钮操作 */ | |
| 400 | + resetQuery() { | |
| 401 | + this.resetForm("queryForm"); | |
| 402 | + this.handleQuery(); | |
| 403 | + }, | |
| 404 | + // 多选框选中数据 | |
| 405 | + handleSelectionChange(selection) { | |
| 406 | + this.ids = selection.map(item => item.garId) | |
| 407 | + this.single = selection.length!==1 | |
| 408 | + this.multiple = !selection.length | |
| 409 | + }, | |
| 410 | + /** 修改按钮操作 */ | |
| 411 | + handleUpdate(row) { | |
| 412 | + this.reset(); | |
| 413 | + const garId = row.garId || this.ids | |
| 414 | + getAsk(garId).then(response => { | |
| 415 | + this.form = response.data; | |
| 416 | + this.open = true; | |
| 417 | + this.title = "修改趟次关联台账"; | |
| 418 | + }); | |
| 419 | + }, | |
| 420 | + /** 导出按钮操作 */ | |
| 421 | + handleExport() { | |
| 422 | + const queryParams = this.queryParams; | |
| 423 | + this.$confirm('是否确认导出所有趟次关联台账数据项?', "警告", { | |
| 424 | + confirmButtonText: "确定", | |
| 425 | + cancelButtonText: "取消", | |
| 426 | + type: "warning" | |
| 427 | + }).then(function() { | |
| 428 | + return exportAsk(queryParams); | |
| 429 | + }).then(response => { | |
| 430 | + this.download(response.msg); | |
| 431 | + }) | |
| 432 | + } | |
| 433 | + } | |
| 434 | +}; | |
| 435 | +</script> | ... | ... |