From f1e33acac9f7d483030ce85cf78be6a2a8748769 Mon Sep 17 00:00:00 2001 From: "925116093-qq.com" <925116093@qq.com> Date: Sun, 24 Aug 2025 18:06:22 +0800 Subject: [PATCH] 2025008071805 --- .../IntegralProduct/index_20250519100359.vue | 475 --------------- .../IntegralProduct/index_20250520142702.vue | 483 --------------- .../IntegralProduct/index_20250520142706.vue | 483 --------------- .../IntegralProduct/index_20250520142711.vue | 483 --------------- .../IntegralProduct/index_20250522113421.vue | 549 ------------------ .../IntegralProduct/index_20250522113517.vue | 512 ---------------- .../IntegralProduct/index_20250522113803.vue | 516 ---------------- .../IntegralProduct/index_20250522114540.vue | 522 ----------------- .../IntegralProduct/index_20250522115404.vue | 529 ----------------- .../IntegralProduct/index_20250522115442.vue | 529 ----------------- .../IntegralProduct/index_20250522115458.vue | 529 ----------------- .../IntegralProduct/index_20250522115546.vue | 529 ----------------- .../IntegralProduct/index_20250522115657.vue | 529 ----------------- .../IntegralProduct/index_20250522115658.vue | 529 ----------------- .../IntegralProduct/index_20250522115732.vue | 532 ----------------- .../IntegralProduct/index_20250522115759.vue | 532 ----------------- .../IntegralProduct/index_20250522115814.vue | 532 ----------------- .../IntegralProduct/index_20250522115858.vue | 535 ----------------- .../IntegralProduct/index_20250522115932.vue | 535 ----------------- .../IntegralProduct/index_20250522120102.vue | 535 ----------------- .../IntegralProduct/index_20250522120130.vue | 535 ----------------- .../IntegralProduct/index_20250522120207.vue | 530 ----------------- .../IntegralProduct/index_20250522140954.vue | 530 ----------------- .../IntegralProduct/index_20250522141151.vue | 530 ----------------- .../IntegralProduct/index_20250522141914.vue | 531 ----------------- .../controller/IntegralProductController.java | 53 +- .../system/controller/OrderController.java | 129 +++- .../controller/ServiceGoodsController.java | 45 +- .../mapper/system/ServiceGoodsMapper.xml | 2 +- .../mapper/system/WorkerMoneyLogMapper.xml | 7 +- ruoyi-ui/src/components/ImageUpload/index.vue | 90 ++- .../views/system/IntegralProduct/index.vue | 116 +++- .../Order/components/OrderDetailDialog.vue | 29 +- .../src/views/system/ServiceGoods/index.vue | 373 ++++++++++-- 34 files changed, 738 insertions(+), 13160 deletions(-) delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250519100359.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142702.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142706.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142711.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113421.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113517.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113803.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522114540.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115404.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115442.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115458.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115546.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115657.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115658.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115732.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115759.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115814.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115858.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115932.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120102.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120130.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120207.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522140954.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141151.vue delete mode 100644 .history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141914.vue diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250519100359.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250519100359.vue deleted file mode 100644 index efb1ee2..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250519100359.vue +++ /dev/null @@ -1,475 +0,0 @@ - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142702.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142702.vue deleted file mode 100644 index 4082ef0..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142702.vue +++ /dev/null @@ -1,483 +0,0 @@ - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142706.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142706.vue deleted file mode 100644 index 4082ef0..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142706.vue +++ /dev/null @@ -1,483 +0,0 @@ - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142711.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142711.vue deleted file mode 100644 index 4082ef0..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250520142711.vue +++ /dev/null @@ -1,483 +0,0 @@ - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113421.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113421.vue deleted file mode 100644 index ef99742..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113421.vue +++ /dev/null @@ -1,549 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 搜索 - 重置 - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113517.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113517.vue deleted file mode 100644 index c8109e8..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113517.vue +++ /dev/null @@ -1,512 +0,0 @@ - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113803.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113803.vue deleted file mode 100644 index 0e0f129..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522113803.vue +++ /dev/null @@ -1,516 +0,0 @@ - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522114540.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522114540.vue deleted file mode 100644 index 443deb0..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522114540.vue +++ /dev/null @@ -1,522 +0,0 @@ - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115404.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115404.vue deleted file mode 100644 index 063fbf1..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115404.vue +++ /dev/null @@ -1,529 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115442.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115442.vue deleted file mode 100644 index 2513f50..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115442.vue +++ /dev/null @@ -1,529 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115458.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115458.vue deleted file mode 100644 index ae198f6..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115458.vue +++ /dev/null @@ -1,529 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115546.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115546.vue deleted file mode 100644 index 2269620..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115546.vue +++ /dev/null @@ -1,529 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115657.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115657.vue deleted file mode 100644 index 81346f6..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115657.vue +++ /dev/null @@ -1,529 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115658.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115658.vue deleted file mode 100644 index 81346f6..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115658.vue +++ /dev/null @@ -1,529 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115732.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115732.vue deleted file mode 100644 index f40d5e7..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115732.vue +++ /dev/null @@ -1,532 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115759.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115759.vue deleted file mode 100644 index bb486b2..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115759.vue +++ /dev/null @@ -1,532 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115814.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115814.vue deleted file mode 100644 index 525c676..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115814.vue +++ /dev/null @@ -1,532 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115858.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115858.vue deleted file mode 100644 index 819cfe2..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115858.vue +++ /dev/null @@ -1,535 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115932.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115932.vue deleted file mode 100644 index c6d07cd..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522115932.vue +++ /dev/null @@ -1,535 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120102.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120102.vue deleted file mode 100644 index 3071944..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120102.vue +++ /dev/null @@ -1,535 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120130.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120130.vue deleted file mode 100644 index 3071944..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120130.vue +++ /dev/null @@ -1,535 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120207.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120207.vue deleted file mode 100644 index 865e87b..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522120207.vue +++ /dev/null @@ -1,530 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522140954.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522140954.vue deleted file mode 100644 index 8e69c9e..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522140954.vue +++ /dev/null @@ -1,530 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141151.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141151.vue deleted file mode 100644 index c69ac61..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141151.vue +++ /dev/null @@ -1,530 +0,0 @@ - - - - - diff --git a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141914.vue b/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141914.vue deleted file mode 100644 index 423aca5..0000000 --- a/.history/ruoyi-ui/src/views/system/IntegralProduct/index_20250522141914.vue +++ /dev/null @@ -1,531 +0,0 @@ - - - - - diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/IntegralProductController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/IntegralProductController.java index acf79d8..7e6850e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/IntegralProductController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/IntegralProductController.java @@ -3,6 +3,8 @@ package com.ruoyi.system.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.system.ControllerUtil.AppletControllerUtil; import com.ruoyi.system.domain.IntegralCate; import com.ruoyi.system.service.IIntegralCateService; import org.springframework.security.access.prepost.PreAuthorize; @@ -48,6 +50,7 @@ public class IntegralProductController extends BaseController startPage(); List list = integralProductService.selectIntegralProductList(integralProduct); for(IntegralProduct data:list){ + data.setImage(AppletControllerUtil.buildImageUrl(data.getImage())); IntegralCate integralCate=integralCateService.selectIntegralCateById(data.getCateId()); if(integralCate!=null){ data.setCateName(integralCate.getTitle()); @@ -80,7 +83,24 @@ public class IntegralProductController extends BaseController @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(integralProductService.selectIntegralProductById(id)); + IntegralProduct serviceGoods = integralProductService.selectIntegralProductById(id); + serviceGoods.setImage(AppletControllerUtil.buildImageUrl(serviceGoods.getImage())); + if (serviceGoods.getSkuType()==null){ + serviceGoods.setSkuType(1L); + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + serviceGoods.setSku(jsonObject.toJSONString()); + integralProductService.updateIntegralProduct(serviceGoods); + } + if (serviceGoods.getSku()!=null){ + if (serviceGoods.getSku().equals("{}")){ + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + serviceGoods.setSku(jsonObject.toJSONString()); + integralProductService.updateIntegralProduct(serviceGoods); + } + } + return success(serviceGoods); } @@ -102,6 +122,21 @@ public class IntegralProductController extends BaseController @PostMapping public AjaxResult add(@RequestBody IntegralProduct integralProduct) { + if (integralProduct.getSkuType()==null){ + integralProduct.setSkuType(1L); + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + integralProduct.setSku(jsonObject.toJSONString()); + integralProductService.updateIntegralProduct(integralProduct); + } + if (integralProduct.getSku()!=null){ + if (integralProduct.getSku().equals("{}")){ + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + integralProduct.setSku(jsonObject.toJSONString()); + integralProductService.updateIntegralProduct(integralProduct); + } + } return toAjax(integralProductService.insertIntegralProduct(integralProduct)); } @@ -113,6 +148,22 @@ public class IntegralProductController extends BaseController @PutMapping public AjaxResult edit(@RequestBody IntegralProduct integralProduct) { + + if (integralProduct.getSkuType()==null){ + integralProduct.setSkuType(1L); + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + integralProduct.setSku(jsonObject.toJSONString()); + integralProductService.updateIntegralProduct(integralProduct); + } + if (integralProduct.getSku()!=null){ + if (integralProduct.getSku().equals("{}")){ + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + integralProduct.setSku(jsonObject.toJSONString()); + integralProductService.updateIntegralProduct(integralProduct); + } + } return toAjax(integralProductService.updateIntegralProduct(integralProduct)); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java index 1feedf1..6b2b808 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController.java @@ -1,6 +1,7 @@ package com.ruoyi.system.controller; import java.math.BigDecimal; +import java.text.SimpleDateFormat; import java.util.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -667,14 +668,25 @@ public class OrderController extends BaseController { return error("订单不存在"); } - // 验证订单状态 - if (order.getStatus() != 1) { - return error("只有待接单状态的订单才能派单"); +// // 验证订单状态 +// if (order.getStatus() != 1) { +// return error("只有待接单状态的订单才能派单"); +// } + + if (order.getWorkerId()!=null){ + //给师傅派单的时候的推送 + ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId()); + WXsendMsgUtil.sendMsgForWorkerInfo(users.getOpenid(), order, serviceGoods); + DispatchUtil.creatWorkerForOrder(order,users); + }else{ + + changeWorkerOrder(order.getId(), workerId); + } - //给师傅派单的时候的推送 - ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId()); - WXsendMsgUtil.sendMsgForWorkerInfo(users.getOpenid(), order, serviceGoods); - DispatchUtil.creatWorkerForOrder(order,users); + + + + // // // 更新订单的派单类型 // order.setReceiveType(receiveType.longValue()); @@ -694,6 +706,109 @@ public class OrderController extends BaseController { } } + + public AjaxResult changeWorkerOrder(Long orderId,Long newWorkerId) { + try { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + // 1. 查询订单 + Order order = orderService.selectOrderById(orderId); + if (order == null) { + return AjaxResult.error("订单不存在"); + } + // 2. 查询新师傅信息 + Users newWorker = usersService.selectUsersById(newWorkerId); + if (newWorker == null) { + return AjaxResult.error("新师傅不存在"); + } + // 3. 查询原师傅信息 + Users oldWorker = null; + if (order.getWorkerId() != null) { + oldWorker = usersService.selectUsersById(order.getWorkerId()); + } + // 4. 修改订单的师傅id + order.setWorkerId(newWorkerId); + order.setStatus(1L); + order.setIsAccept(0); + int updateOrder = orderService.updateOrder(order); + if (updateOrder <= 0) { + return AjaxResult.error("订单更新失败"); + } + //查询最新的订单日志 + OrderLog log = orderLogService.selectDataTheFirstNew(order.getId()); + OrderLog log1 = new OrderLog(); + log1.setOid(order.getId()); + //原订单日志下所有师傅id需更换为新的师傅id + List logList = orderLogService.selectOrderLogList(log1); + if (!logList.isEmpty()) { + for (OrderLog l : logList) { + if (l.getWorkerId() != null) { + l.setWorkerId(newWorkerId); + orderLogService.updateOrderLog(l); + } + } + } + //如果订单状态为6就继续做 + if (log.getType().compareTo(new BigDecimal("6.0")) == 0) { + // 2. 组装日志内容为数组格式 + Map logItem = new LinkedHashMap<>(); + JSONArray jsonArray = JSONArray.parseArray(log.getContent()); + logItem.put("name", "师傅" + newWorker.getName() + "将继续为您服务 不需要预约时间"); + logItem.put("name", "暂停服务"); + logItem.put("image", ""); + logItem.put("reson", "由于订单师傅更换,自动暂停服务"); + logItem.put("next_time", ""); + logItem.put("type", 2); + logItem.put("date", sdf.format(new Date())); + jsonArray.add(logItem); + if (log != null) { + log.setIsPause(2); + log.setContent(jsonArray.toJSONString()); + orderLogService.updateOrderLog(log); + order.setIsPause(2); + order.setWorkerId(newWorkerId); + orderService.updateOrder(order); + } + } else { + // 5. 插入转单日志 + OrderLog newlog = new OrderLog(); + if (log.getType().compareTo(new BigDecimal("5.0")) == 0) { + newlog.setType(new BigDecimal(6.0)); + } else { + newlog.setType(new BigDecimal(1.1)); + } + com.alibaba.fastjson2.JSONObject jsonObjectnew = new com.alibaba.fastjson2.JSONObject(); + jsonObjectnew.put("name", "师傅" + newWorker.getName() + "将继续为您服务 不需要预约时间"); + jsonObjectnew.put("convert", oldWorker.getName() + "将订单转给" + newWorker.getName()); + newlog.setContent(jsonObjectnew.toJSONString()); + newlog.setOid(order.getId()); + newlog.setOrderId(order.getOrderId()); + newlog.setWorkerId(newWorkerId); + newlog.setWorkerLogId(newWorkerId); + newlog.setTitle("转单"); + newlog.setIsPause(2); + orderLogService.insertOrderLog(newlog); + //需要解绑原订单上原师傅和客户的虚拟号 + VoiceResponseResult resultObj = YunXinPhoneUtilAPI.httpsPrivacyUnbind(order.getWorkerPhone(), order.getUserPhone(), order.getMiddlePhone(), order.getId()); + if (resultObj.getResult().equals("000000")) { + orderService.updateOrderPhone(order.getId()); + // orderService.updateOrder(order); + } + //绑定新师傅的虚拟号 + //给新师傅进行电话通知 + YunXinPhoneUtilAPI.httpsAxbTransfer(newWorker.getPhone(), order.getId()); + } + return AjaxResult.success("转单成功"); + } catch (Exception e) { + return AjaxResult.error("转单失败:" + e.getMessage()); + } + } + + + + + + + /** * 获取可派单工人列表 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/ServiceGoodsController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/ServiceGoodsController.java index c1dd362..f05bebc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/ServiceGoodsController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/ServiceGoodsController.java @@ -4,6 +4,9 @@ import java.math.BigDecimal; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.ControllerUtil.AppletControllerUtil; import com.ruoyi.system.domain.ServiceCate; import com.ruoyi.system.service.IServiceCateService; import org.springframework.security.access.prepost.PreAuthorize; @@ -311,7 +314,35 @@ public class ServiceGoodsController extends BaseController { @PreAuthorize("@ss.hasPermi('system:ServiceGoods:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(serviceGoodsService.selectServiceGoodsById(id)); + + ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(id); + + serviceGoods.setIcon(AppletControllerUtil.buildImageUrl(serviceGoods.getIcon())); + if (serviceGoods != null){ + if (serviceGoods.getSkuType()==null){ + serviceGoods.setSkuType(1); + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + serviceGoods.setSku(jsonObject.toJSONString()); + serviceGoodsService.updateServiceGoods(serviceGoods); + } + if (serviceGoods.getSku()!=null){ + if (serviceGoods.getSku().equals("{}")){ + JSONObject jsonObject =new JSONObject(); + jsonObject.put("type","single"); + serviceGoods.setSku(jsonObject.toJSONString()); + serviceGoodsService.updateServiceGoods(serviceGoods); + } + } + if(StringUtils.isNotBlank(serviceGoods.getSkillIds())){ + serviceGoods.setSkillIds(AppletControllerUtil.convertToJSONArray(serviceGoods.getSkillIds()).toJSONString()); + } + + if(StringUtils.isNotBlank(serviceGoods.getImgs())){ + serviceGoods.setImgs(AppletControllerUtil.convertToJSONArray(serviceGoods.getImgs()).toJSONString()); + } + } + return success(serviceGoods); } /** @@ -330,7 +361,13 @@ public class ServiceGoodsController extends BaseController { if (serviceGoods.getPostage()==null){ serviceGoods.setPostage(BigDecimal.ZERO); } + if(StringUtils.isNotBlank(serviceGoods.getSkillIds())){ + serviceGoods.setSkillIds(AppletControllerUtil.convertToJSONArray(serviceGoods.getSkillIds()).toJSONString()); + } + if(StringUtils.isNotBlank(serviceGoods.getImgs())){ + serviceGoods.setImgs(AppletControllerUtil.convertToJSONArray(serviceGoods.getImgs()).toJSONString()); + } return toAjax(serviceGoodsService.insertServiceGoods(serviceGoods)); } @@ -343,7 +380,13 @@ public class ServiceGoodsController extends BaseController { public AjaxResult edit(@RequestBody ServiceGoods serviceGoods) { // 验证和处理基检现象数据格式 validateAndProcessBasicField(serviceGoods); + if(StringUtils.isNotBlank(serviceGoods.getSkillIds())){ + serviceGoods.setSkillIds(AppletControllerUtil.convertToJSONArray(serviceGoods.getSkillIds()).toJSONString()); + } + if(StringUtils.isNotBlank(serviceGoods.getImgs())){ + serviceGoods.setImgs(AppletControllerUtil.convertToJSONArray(serviceGoods.getImgs()).toJSONString()); + } // 处理一级和二级分类ID processCategoryIds(serviceGoods); diff --git a/ruoyi-system/src/main/resources/mapper/system/ServiceGoodsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ServiceGoodsMapper.xml index 5d2d446..3f54add 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ServiceGoodsMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ServiceGoodsMapper.xml @@ -60,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, title, icon, imgs,isforservice,forserviceid, sub_title, info, price,questions, price_zn, sales,servicetype, stock, status, description, sku_type,groupnum,sku, latitude, longitude, type, cate_id, first_cate_id, second_cate_id, project, sort, material, postage, basic, margin, skill_ids, created_at, updated_at, deleted_at, isgroup, groupprice, isonce, onceprice, commissiontype, commission, dispatchtype, workerids, isfixed, fixedprice from service_goods + select id, title, icon, imgs,isforservice,city,forserviceid, sub_title, info, price,questions, price_zn, sales,servicetype, stock, status, description, sku_type,groupnum,sku, latitude, longitude, type, cate_id, first_cate_id, second_cate_id, project, sort, material, postage, basic, margin, skill_ids, created_at, updated_at, deleted_at, isgroup, groupprice, isonce, onceprice, commissiontype, commission, dispatchtype, workerids, isfixed, fixedprice from service_goods - UPDATE worker_money_log - SET status = 2 - WHERE endlook > NOW() AND status = 1 + + UPDATE worker_money_log SET status = 2 WHERE endlook < NOW() AND status = 1 + + diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue index f37c72a..69ab14f 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -1,14 +1,14 @@