Commit 322bf3a30cbf17dfe3756cd08ecf5bbe6e0e2db4
1 parent
b9ab82ad
feat: 修改askTransport接口和update接口
Showing
3 changed files
with
23 additions
and
17 deletions
trash-garbage/src/main/java/com/trash/garbage/pojo/vo/OrderDetailTransportVo.java
| @@ -11,6 +11,7 @@ public class OrderDetailTransportVo { | @@ -11,6 +11,7 @@ public class OrderDetailTransportVo { | ||
| 11 | private String garOrderId; | 11 | private String garOrderId; |
| 12 | private String garRealCarCount; | 12 | private String garRealCarCount; |
| 13 | private List<String> currentImages; | 13 | private List<String> currentImages; |
| 14 | + private Integer garOrderDisposalStatus; | ||
| 14 | /** | 15 | /** |
| 15 | * 承接经营单位 | 16 | * 承接经营单位 |
| 16 | */ | 17 | */ |
| @@ -245,4 +246,11 @@ public class OrderDetailTransportVo { | @@ -245,4 +246,11 @@ public class OrderDetailTransportVo { | ||
| 245 | this.garOrderCompanyTel = garOrderCompanyTel; | 246 | this.garOrderCompanyTel = garOrderCompanyTel; |
| 246 | } | 247 | } |
| 247 | 248 | ||
| 249 | + public Integer getGarOrderDisposalStatus() { | ||
| 250 | + return garOrderDisposalStatus; | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + public void setGarOrderDisposalStatus(Integer garOrderDisposalStatus) { | ||
| 254 | + this.garOrderDisposalStatus = garOrderDisposalStatus; | ||
| 255 | + } | ||
| 248 | } | 256 | } |
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java
| @@ -297,13 +297,22 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -297,13 +297,22 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 297 | // TODO 处理场所负责人 | 297 | // TODO 处理场所负责人 |
| 298 | return handlerDisposalSiteOrderStatus(dto, user); | 298 | return handlerDisposalSiteOrderStatus(dto, user); |
| 299 | } | 299 | } |
| 300 | - | ||
| 301 | throw new BizException(ResultCode.CODE_500); | 300 | throw new BizException(ResultCode.CODE_500); |
| 302 | 301 | ||
| 303 | } | 302 | } |
| 304 | 303 | ||
| 305 | private String handlerDisposalSiteOrderStatus(OrderUpdateDto dto, GarUser user) { | 304 | private String handlerDisposalSiteOrderStatus(OrderUpdateDto dto, GarUser user) { |
| 306 | - throw new BizException(ResultCode.CODE_500); | 305 | + // 完成订单 |
| 306 | + GarOrder order = getById(dto.getGarOrderId()); | ||
| 307 | + // TODO 发送短信 通知企业和用户 修改订单状态为完成 disposal 和 handler表的状态一起修改 | ||
| 308 | + String message = "您的清运订单已完成,可前往小程序进行评价,感谢您的使用"; | ||
| 309 | + smsUtils.sendMessage(order.getGarOrderContactTel(), message); | ||
| 310 | + smsUtils.sendMessage(order.getGarOrderCompanyTel(), "您的清运订单已完成,详情可在小程序查看。"); | ||
| 311 | + successOrder(order); | ||
| 312 | + redisCache.deleteObject(order.getGarOrderId()); | ||
| 313 | + // TODO 用户消息通知 订单菜单消息 | ||
| 314 | + userOrderMessageSend(order, message); | ||
| 315 | + return "当前订单已完成"; | ||
| 307 | } | 316 | } |
| 308 | 317 | ||
| 309 | private boolean checkCode(String code, String orderId, String userId) { | 318 | private boolean checkCode(String code, String orderId, String userId) { |
| @@ -799,7 +808,6 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -799,7 +808,6 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 799 | public String askTransport(AskTransportDto dto) { | 808 | public String askTransport(AskTransportDto dto) { |
| 800 | // TODO 判断是否运载完毕 已经到预估趟次则不在生成验证码 | 809 | // TODO 判断是否运载完毕 已经到预估趟次则不在生成验证码 |
| 801 | String orderId = dto.getGarOrderId(); | 810 | String orderId = dto.getGarOrderId(); |
| 802 | - | ||
| 803 | // 查询当前运载几趟 如果全部运输完毕则发送成功短信 | 811 | // 查询当前运载几趟 如果全部运输完毕则发送成功短信 |
| 804 | LambdaQueryWrapper<GarOrderMatchAsk> qw = new LambdaQueryWrapper<>(); | 812 | LambdaQueryWrapper<GarOrderMatchAsk> qw = new LambdaQueryWrapper<>(); |
| 805 | qw.eq(GarOrderMatchAsk::getGarOrderId, dto.getGarOrderId()); | 813 | qw.eq(GarOrderMatchAsk::getGarOrderId, dto.getGarOrderId()); |
| @@ -825,36 +833,25 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | @@ -825,36 +833,25 @@ public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder> | ||
| 825 | imageList.add(image); | 833 | imageList.add(image); |
| 826 | } | 834 | } |
| 827 | garOrderImageService.saveBatch(imageList); | 835 | garOrderImageService.saveBatch(imageList); |
| 828 | - if (transportCount == (order.getGarRealCarCount() - 1)) { | ||
| 829 | - // TODO 发送短信 通知企业和用户 修改订单状态为完成 disposal 和 handler表的状态一起修改 | ||
| 830 | - String message = "您的清运订单已完成,可前往小程序进行评价,感谢您的使用"; | ||
| 831 | - smsUtils.sendMessage(order.getGarOrderContactTel(), message); | ||
| 832 | - smsUtils.sendMessage(order.getGarOrderCompanyTel(), "您的清运订单已完成,详情可在小程序查看。"); | ||
| 833 | - successOrder(order, dto); | ||
| 834 | - redisCache.deleteObject(orderId); | ||
| 835 | - // TODO 用户消息通知 订单菜单消息 | ||
| 836 | - userOrderMessageSend(order, message); | ||
| 837 | - return "当前订单已完成"; | ||
| 838 | - } | ||
| 839 | return "当前趟次记录成功"; | 836 | return "当前趟次记录成功"; |
| 840 | } | 837 | } |
| 841 | 838 | ||
| 842 | throw new BizException(ResultCode.CODE_400, "当前记录无效,已完成所有趟次!"); | 839 | throw new BizException(ResultCode.CODE_400, "当前记录无效,已完成所有趟次!"); |
| 843 | } | 840 | } |
| 844 | 841 | ||
| 845 | - private void successOrder(GarOrder order, AskTransportDto dto) { | 842 | + private void successOrder(GarOrder order) { |
| 846 | order.setGarOrderHandlerStatus(GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); | 843 | order.setGarOrderHandlerStatus(GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); |
| 847 | order.setGarHandlerEvaluateFlag(GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue()); | 844 | order.setGarHandlerEvaluateFlag(GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue()); |
| 848 | order.setGarEvaluateFlag(GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue()); | 845 | order.setGarEvaluateFlag(GlobalStatus.GarOrderStatus.EVALUATE_ORDER_NO.getValue()); |
| 849 | updateById(order); | 846 | updateById(order); |
| 850 | // 更新disposal | 847 | // 更新disposal |
| 851 | LambdaUpdateWrapper<GarOrderMatchDisposal> uwd = new LambdaUpdateWrapper<>(); | 848 | LambdaUpdateWrapper<GarOrderMatchDisposal> uwd = new LambdaUpdateWrapper<>(); |
| 852 | - uwd.eq(GarOrderMatchDisposal::getGarOrderId, dto.getGarOrderId()) | 849 | + uwd.eq(GarOrderMatchDisposal::getGarOrderId, order.getGarOrderId()) |
| 853 | .set(GarOrderMatchDisposal::getGarOrderDisposalStatus, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); | 850 | .set(GarOrderMatchDisposal::getGarOrderDisposalStatus, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); |
| 854 | disposalService.update(uwd); | 851 | disposalService.update(uwd); |
| 855 | // 更新handler | 852 | // 更新handler |
| 856 | LambdaUpdateWrapper<GarOrderMatchHandler> uwh = new LambdaUpdateWrapper<>(); | 853 | LambdaUpdateWrapper<GarOrderMatchHandler> uwh = new LambdaUpdateWrapper<>(); |
| 857 | - uwh.eq(GarOrderMatchHandler::getGarOrderId, dto.getGarOrderId()) | 854 | + uwh.eq(GarOrderMatchHandler::getGarOrderId, order.getGarOrderId()) |
| 858 | .set(GarOrderMatchHandler::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); | 855 | .set(GarOrderMatchHandler::getGarOrderHandlerStatus, GlobalStatus.GarOrderStatus.SUCCESS_ORDER.getValue()); |
| 859 | handlerService.update(uwh); | 856 | handlerService.update(uwh); |
| 860 | } | 857 | } |
trash-garbage/src/main/resources/mapper/GarOrderMapper.xml
| @@ -41,6 +41,7 @@ | @@ -41,6 +41,7 @@ | ||
| 41 | <result property="garOrderContactTel" column="gar_order_contact_tel" jdbcType="VARCHAR"/> | 41 | <result property="garOrderContactTel" column="gar_order_contact_tel" jdbcType="VARCHAR"/> |
| 42 | <result property="garOrderCompanyId" column="gar_order_company_id" jdbcType="VARCHAR"/> | 42 | <result property="garOrderCompanyId" column="gar_order_company_id" jdbcType="VARCHAR"/> |
| 43 | <result property="garOrderCompanyName" column="gar_order_company_name" jdbcType="VARCHAR"/> | 43 | <result property="garOrderCompanyName" column="gar_order_company_name" jdbcType="VARCHAR"/> |
| 44 | + <result property="garOrderDisposalStatus" column="gar_order_disposal_status" jdbcType="INTEGER"/> | ||
| 44 | <result property="garOrderCompanyTel" column="gar_order_company_tel" jdbcType="VARCHAR"/> | 45 | <result property="garOrderCompanyTel" column="gar_order_company_tel" jdbcType="VARCHAR"/> |
| 45 | <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/> | 46 | <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/> |
| 46 | <result property="garLatitude" column="gar_latitude" jdbcType="DOUBLE"/> | 47 | <result property="garLatitude" column="gar_latitude" jdbcType="DOUBLE"/> |