From 7e48da6fb3023d736e4c007de56b3df112208e9a Mon Sep 17 00:00:00 2001 From: donqi <240832390@qq.com> Date: Sat, 4 Nov 2023 02:28:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9=E6=8C=89=E9=92=AE=E5=8F=8A=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/order/OrderController.java | 14 +- .../order/OrderMasterController.java | 25 +++ .../templates/order/orderManager.html | 6 + .../order/popup/editServingInfo.html | 205 ++++++++++++++++++ 4 files changed, 246 insertions(+), 4 deletions(-) create mode 100644 ghy-admin/src/main/resources/templates/order/popup/editServingInfo.html diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java index 26c19f6e..b9508058 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderController.java @@ -44,12 +44,10 @@ import org.apache.commons.lang3.time.DateUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; +import org.springframework.ui.ModelMap; import org.springframework.util.Assert; import org.springframework.util.StopWatch; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; @@ -109,6 +107,14 @@ public class OrderController extends BaseController { @Resource private IOrderCallRecordService orderCallRecordService; + + @GetMapping("/popup/editServingInfo") + public String record(Long orderId, String pageCode, ModelMap mmap) { + mmap.put("orderId", orderId); + mmap.put("pageCode", pageCode); + return "order/popup/editServingInfo"; + } + /** * 可派单商品数量 */ diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java index 49586f86..276ee5a3 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/order/OrderMasterController.java @@ -43,11 +43,13 @@ import com.ghy.worker.service.IWorkerCertificationService; import com.ghy.worker.service.WorkerService; import com.huifu.adapay.core.exception.BaseAdaPayException; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.ibatis.annotations.Param; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.ModelMap; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -112,6 +114,8 @@ public class OrderMasterController extends BaseController { private IAfterServiceRecordService afterServiceRecordService; @Resource private FinancialChangeRecordService financialChangeRecordService; + @Resource + private CustomerAddressService customerAddressService; // @RequiresPermissions("order:master:view") @@ -872,6 +876,27 @@ public class OrderMasterController extends BaseController { } } + @PostMapping("/editServingInfo") + @ResponseBody + @Transactional(rollbackFor = Exception.class) + public AjaxResult editServingInfo(@RequestBody OrderMaster request) { + try { + // 更新期望时间 + orderMasterService.updateOrderMaster(request); + // 更新客户联系方式和地址 + OrderMaster order = orderMasterService.selectById(request.getId()); + CustomerAddress address2Update = new CustomerAddress(); + address2Update.setAddress(request.getAddress()); + address2Update.setPhone(request.getAddressPhone()); + address2Update.setCustomerAddressId(order.getAddressId()); + customerAddressService.updateCustomerAddress(address2Update); + return AjaxResult.success(); + } catch (Exception e) { + logger.error(ExceptionUtils.getStackTrace(e)); + return AjaxResult.error("修改失败"); + } + } + @PostMapping("/callCustomer") @ResponseBody public AjaxResult callCustomer(@RequestBody OrderMaster orderMaster) { diff --git a/ghy-admin/src/main/resources/templates/order/orderManager.html b/ghy-admin/src/main/resources/templates/order/orderManager.html index a8595dfb..13f1fce5 100644 --- a/ghy-admin/src/main/resources/templates/order/orderManager.html +++ b/ghy-admin/src/main/resources/templates/order/orderManager.html @@ -683,6 +683,7 @@ formatter: function (value, row, index) { var actions = []; actions.push('查看 '); + actions.push('修改 '); actions.push('拨号详情 '); if(row.orderStatus == 0 || row.orderStatus == 1){ actions.push('主单退单 '); @@ -816,6 +817,11 @@ $.modal.open("商品信息", url); } + function editServingInfo(id) { + let url = "order/popup/editServingInfo?orderId=" + id + "&pageCode=orderManager"; + $.modal.open("信息修改", url); + } + function callDetail(id) { var url = "order/record?orderId=" + id; $.modal.open("拨号记录", url); diff --git a/ghy-admin/src/main/resources/templates/order/popup/editServingInfo.html b/ghy-admin/src/main/resources/templates/order/popup/editServingInfo.html new file mode 100644 index 00000000..d7b269e5 --- /dev/null +++ b/ghy-admin/src/main/resources/templates/order/popup/editServingInfo.html @@ -0,0 +1,205 @@ + + + +
+