diff --git a/.history/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController_20250520164331.java b/.history/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController_20250520164331.java deleted file mode 100644 index c034720..0000000 --- a/.history/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController_20250520164331.java +++ /dev/null @@ -1,240 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.ruoyi.system.domain.*; -import com.ruoyi.system.service.*; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; - -/** - * 服务订单Controller - * - * @author ruoyi - * @date 2025-05-13 - */ -@RestController -@RequestMapping("/system/Order") -public class OrderController extends BaseController -{ - @Autowired - private IOrderService orderService; - @Autowired - private IServiceGoodsService serviceGoodsService; - @Autowired - IUsersService usersService; - @Autowired - IOrderCallService orderCallService; - @Autowired - IOrderCommentService orderCommentService; - @Autowired - IOrderSoundLogService orderSoundLogService; - @Autowired - IOrderSoundService orderSoundService; - - @Autowired - IOrderLogService orderLogService; - @Autowired - INotifyOrderService notifyOrderService; - /** - * 查询服务订单列表 - */ - @PreAuthorize("@ss.hasPermi('system:Order:list')") - @GetMapping("/list") - public TableDataInfo list(Order order) - { - startPage(); - List list = orderService.selectOrderList(order); - for(Order orderdata:list){ - - ServiceGoods serviceGoods=serviceGoodsService.selectServiceGoodsById(orderdata.getProductId()); - if(serviceGoods!=null){ - orderdata.setProductName(serviceGoods.getTitle()); - } - Users users=usersService.selectUsersById(orderdata.getUid()); - if (users!=null){ - orderdata.setUname(users.getName()); - } - orderdata.setThjl(orderCallService.selectCountOrderCallByOid(orderdata.getId())); - orderdata.setFwpj(orderCommentService.selectCountOrderCommentByOid(orderdata.getId())); - orderdata.setLywj(orderSoundService.selectCountOrderSoundByOid(orderdata.getId())); - orderdata.setJdjl(orderLogService.selectCountOrderLogByOrderId(orderdata.getOrderId())); - orderdata.setTzjl(notifyOrderService.selectNotifyOrderCountByOid(orderdata.getId())); - - } - return getDataTable(list); - } - - /** - * 导出服务订单列表 - */ - @PreAuthorize("@ss.hasPermi('system:Order:export')") - @Log(title = "服务订单", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Order order) - { - List list = orderService.selectOrderList(order); - ExcelUtil util = new ExcelUtil(Order.class); - util.exportExcel(response, list, "服务订单数据"); - } - - - /** - * 获取服务订单详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(orderService.selectOrderById(id)); - } - - /** - * 新增服务订单 - */ - @PreAuthorize("@ss.hasPermi('system:Order:add')") - @Log(title = "服务订单", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody Order order) - { - return toAjax(orderService.insertOrder(order)); - } - - /** - * 修改服务订单 - */ - @PreAuthorize("@ss.hasPermi('system:Order:edit')") - @Log(title = "服务订单", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody Order order) - { - return toAjax(orderService.updateOrder(order)); - } - - /** - * 删除服务订单 - */ - @PreAuthorize("@ss.hasPermi('system:Order:remove')") - @Log(title = "服务订单", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(orderService.deleteOrderByIds(ids)); - } - - - - /** - * 获取订单接单记录 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/receive-records/{orderId}") - public AjaxResult getReceiveRecords(@PathVariable("orderId") String orderId) - { - List list =orderLogService.selectOrderLogByOrderId(orderId); - for(OrderLog orderLogdata:list){ - Users users=usersService.selectUsersById(orderLogdata.getWorkerId()); - if(users!=null){ - orderLogdata.setWorkerName(users.getName()); - } - } - return success(list); - } - - // /** - // * 获取订单通话记录 - // */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/call-records/{orderId}") - public AjaxResult getCallRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - return success(orderCallService.selectOrderCallByOid(data.getId())); - }else{ - return AjaxResult.error("订单不存在"); - } - - } - - /** - * 获取订单录音文件 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/audio-records/{orderId}") - public AjaxResult getAudioRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - List list =orderSoundService.selectOrderSoundByOid(data.getId()); - for(OrderSound orderSounddata:list){ - orderSounddata.setFile("https://img.huafurenjia.cn/"+orderSounddata.getFile()); - // https://img.huafurenjia.cn/ - Users users=usersService.selectUsersById(orderSounddata.getWorkerUid()) ; - Order order=orderService.selectOrderById(orderSounddata.getOid()); - if(users!=null){ - orderSounddata.setWorkerName(users.getName()); - } - if(order!=null){ - orderSounddata.setOcode(order.getOrderId()); - } - } - return success(list); - }else{ - return AjaxResult.error("订单不存在"); - } - } - - /** - * 获取订单通知记录 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/notify-records/{orderId}") - public AjaxResult getNotifyRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - return success(notifyOrderService.selectNotifyOrderByOid(data.getId())); - }else{ - return AjaxResult.error("订单不存在"); - } - } - - /** - * 获取订单通知记录 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/comment-records/{orderId}") - public AjaxResult getCommentRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - List list =orderCommentService.selectOrderCommentByOid(data.getId()); - for(OrderComment orderCommentdata:list){ - Users users=usersService.selectUsersById(orderCommentdata.getUid()); - if(users!=null){ - orderCommentdata.setUname(users.getName()); - } - } - return success(list); - }else{ - return AjaxResult.error("订单不存在"); - } - } - -} diff --git a/.history/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController_20250522152224.java b/.history/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController_20250522152224.java deleted file mode 100644 index 7013dc1..0000000 --- a/.history/ruoyi-system/src/main/java/com/ruoyi/system/controller/OrderController_20250522152224.java +++ /dev/null @@ -1,264 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.ruoyi.system.domain.*; -import com.ruoyi.system.service.*; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.system.service.ISysUserService; -import com.ruoyi.system.service.IServiceGoodsService; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.system.domain.ServiceGoods; - -/** - * 服务订单Controller - * - * @author ruoyi - * @date 2025-05-13 - */ -@RestController -@RequestMapping("/system/Order") -public class OrderController extends BaseController -{ - @Autowired - private IOrderService orderService; - @Autowired - private IServiceGoodsService serviceGoodsService; - @Autowired - IUsersService usersService; - @Autowired - IOrderCallService orderCallService; - @Autowired - IOrderCommentService orderCommentService; - @Autowired - IOrderSoundLogService orderSoundLogService; - @Autowired - IOrderSoundService orderSoundService; - - @Autowired - IOrderLogService orderLogService; - @Autowired - INotifyOrderService notifyOrderService; - @Autowired - private ISysUserService sysUserService; - /** - * 查询服务订单列表 - */ - @PreAuthorize("@ss.hasPermi('system:Order:list')") - @GetMapping("/list") - public TableDataInfo list(Order order) - { - startPage(); - List list = orderService.selectOrderList(order); - for(Order orderdata:list){ - - ServiceGoods serviceGoods=serviceGoodsService.selectServiceGoodsById(orderdata.getProductId()); - if(serviceGoods!=null){ - orderdata.setProductName(serviceGoods.getTitle()); - } - Users users=usersService.selectUsersById(orderdata.getUid()); - if (users!=null){ - orderdata.setUname(users.getName()); - } - orderdata.setThjl(orderCallService.selectCountOrderCallByOid(orderdata.getId())); - orderdata.setFwpj(orderCommentService.selectCountOrderCommentByOid(orderdata.getId())); - orderdata.setLywj(orderSoundService.selectCountOrderSoundByOid(orderdata.getId())); - orderdata.setJdjl(orderLogService.selectCountOrderLogByOrderId(orderdata.getOrderId())); - orderdata.setTzjl(notifyOrderService.selectNotifyOrderCountByOid(orderdata.getId())); - - } - return getDataTable(list); - } - - /** - * 导出服务订单列表 - */ - @PreAuthorize("@ss.hasPermi('system:Order:export')") - @Log(title = "服务订单", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, Order order) - { - List list = orderService.selectOrderList(order); - ExcelUtil util = new ExcelUtil(Order.class); - util.exportExcel(response, list, "服务订单数据"); - } - - - /** - * 获取服务订单详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(orderService.selectOrderById(id)); - } - - /** - * 新增服务订单 - */ - @PreAuthorize("@ss.hasPermi('system:Order:add')") - @Log(title = "服务订单", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody Order order) - { - return toAjax(orderService.insertOrder(order)); - } - - /** - * 修改服务订单 - */ - @PreAuthorize("@ss.hasPermi('system:Order:edit')") - @Log(title = "服务订单", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody Order order) - { - return toAjax(orderService.updateOrder(order)); - } - - /** - * 删除服务订单 - */ - @PreAuthorize("@ss.hasPermi('system:Order:remove')") - @Log(title = "服务订单", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(orderService.deleteOrderByIds(ids)); - } - - - - /** - * 获取订单接单记录 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/receive-records/{orderId}") - public AjaxResult getReceiveRecords(@PathVariable("orderId") String orderId) - { - List list =orderLogService.selectOrderLogByOrderId(orderId); - for(OrderLog orderLogdata:list){ - Users users=usersService.selectUsersById(orderLogdata.getWorkerId()); - if(users!=null){ - orderLogdata.setWorkerName(users.getName()); - } - } - return success(list); - } - - // /** - // * 获取订单通话记录 - // */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/call-records/{orderId}") - public AjaxResult getCallRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - return success(orderCallService.selectOrderCallByOid(data.getId())); - }else{ - return AjaxResult.error("订单不存在"); - } - - } - - /** - * 获取订单录音文件 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/audio-records/{orderId}") - public AjaxResult getAudioRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - List list =orderSoundService.selectOrderSoundByOid(data.getId()); - for(OrderSound orderSounddata:list){ - orderSounddata.setFile("https://img.huafurenjia.cn/"+orderSounddata.getFile()); - // https://img.huafurenjia.cn/ - Users users=usersService.selectUsersById(orderSounddata.getWorkerUid()) ; - Order order=orderService.selectOrderById(orderSounddata.getOid()); - if(users!=null){ - orderSounddata.setWorkerName(users.getName()); - } - if(order!=null){ - orderSounddata.setOcode(order.getOrderId()); - } - } - return success(list); - }else{ - return AjaxResult.error("订单不存在"); - } - } - - /** - * 获取订单通知记录 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/notify-records/{orderId}") - public AjaxResult getNotifyRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - return success(notifyOrderService.selectNotifyOrderByOid(data.getId())); - }else{ - return AjaxResult.error("订单不存在"); - } - } - - /** - * 获取订单通知记录 - */ - @PreAuthorize("@ss.hasPermi('system:Order:query')") - @GetMapping("/comment-records/{orderId}") - public AjaxResult getCommentRecords(@PathVariable("orderId") String orderId) - { - Order data=orderService.selectOrderByOrderId(orderId);; - if(data!=null){ - List list =orderCommentService.selectOrderCommentByOid(data.getId()); - for(OrderComment orderCommentdata:list){ - Users users=usersService.selectUsersById(orderCommentdata.getUid()); - if(users!=null){ - orderCommentdata.setUname(users.getName()); - } - } - return success(list); - }else{ - return AjaxResult.error("订单不存在"); - } - } - - /** - * 获取用户下拉列表 - */ - @GetMapping("/userOptions") - public AjaxResult getUserOptions() { - List users = sysUserService.selectUserList(new SysUser()); - return AjaxResult.success(users); - } - - /** - * 获取商品下拉列表 - */ - @GetMapping("/serviceGoodsOptions") - public AjaxResult getServiceGoodsOptions() { - List goods = serviceGoodsService.selectServiceGoodsList(new ServiceGoods()); - return AjaxResult.success(goods); - } - -} diff --git a/.history/ruoyi-ui/src/api/system/Order_20250520114537.js b/.history/ruoyi-ui/src/api/system/Order_20250520114537.js deleted file mode 100644 index fdfb81c..0000000 --- a/.history/ruoyi-ui/src/api/system/Order_20250520114537.js +++ /dev/null @@ -1,87 +0,0 @@ -import request from '@/utils/request' - -// 查询服务订单列表 -export function listOrder(query) { - return request({ - url: '/system/Order/list', - method: 'get', - params: query - }) -} - -// 查询服务订单详细 -export function getOrder(id) { - return request({ - url: '/system/Order/' + id, - method: 'get' - }) -} - -// 新增服务订单 -export function addOrder(data) { - return request({ - url: '/system/Order', - method: 'post', - data: data - }) -} - -// 修改服务订单 -export function updateOrder(data) { - return request({ - url: '/system/Order', - method: 'put', - data: data - }) -} - -// 删除服务订单 -export function delOrder(id) { - return request({ - url: '/system/Order/' + id, - method: 'delete' - }) -} - -// 获取接单记录列表 -export function getReceiveRecords(orderId) { - return request({ - url: '/system/Order/receive-records/' + orderId, - method: 'get' - }) -} - -// 获取通话记录列表 -export function getCallRecords(orderId) { - return request({ - url: '/system/Order/call-records/' + orderId, - method: 'get' - }) -} - -// 获取通话记录列表 -export function getCommentRecords(orderId) { - return request({ - url: '/system/Order/comment-records/' + orderId, - method: 'get' - }) -} - - - - -// 获取录音文件列表 -export function getAudioRecords(orderId) { - return request({ - url: '/system/Order/audio-records/' + orderId, - method: 'get' - }) -} - -// 获取通知记录列表 -export function getNotifyRecords(orderId) { - return request({ - url: '/system/Order/notify-records/' + orderId, - method: 'get' - }) -} diff --git a/.history/ruoyi-ui/src/api/system/Order_20250522153217.js b/.history/ruoyi-ui/src/api/system/Order_20250522153217.js deleted file mode 100644 index 352e4e2..0000000 --- a/.history/ruoyi-ui/src/api/system/Order_20250522153217.js +++ /dev/null @@ -1,91 +0,0 @@ -import request from '@/utils/request' - -// 查询服务订单列表 -export function listOrder(query) { - return request({ - url: '/system/Order/list', - method: 'get', - params: query - }) -} - -// 查询服务订单详细 -export function getOrder(id) { - return request({ - url: '/system/Order/' + id, - method: 'get' - }) -} - -// 新增服务订单 -export function addOrder(data) { - return request({ - url: '/system/Order', - method: 'post', - data: data - }) -} - -// 修改服务订单 -export function updateOrder(data) { - return request({ - url: '/system/Order', - method: 'put', - data: data - }) -} - -// 删除服务订单 -export function delOrder(id) { - return request({ - url: '/system/Order/' + id, - method: 'delete' - }) -} - -// 获取接单记录列表 -export function getReceiveRecords(orderId) { - return request({ - url: '/system/Order/receive-records/' + orderId, - method: 'get' - }) -} -getUserDataList () { - getUserDataList().then(response => { - this.userDataList = response.data - }) -}, -// 获取通话记录列表 -export function getCallRecords(orderId) { - return request({ - url: '/system/Order/call-records/' + orderId, - method: 'get' - }) -} - -// 获取通话记录列表 -export function getCommentRecords(orderId) { - return request({ - url: '/system/Order/comment-records/' + orderId, - method: 'get' - }) -} - - - - -// 获取录音文件列表 -export function getAudioRecords(orderId) { - return request({ - url: '/system/Order/audio-records/' + orderId, - method: 'get' - }) -} - -// 获取通知记录列表 -export function getNotifyRecords(orderId) { - return request({ - url: '/system/Order/notify-records/' + orderId, - method: 'get' - }) -} diff --git a/.history/ruoyi-ui/src/api/system/Order_20250522174732.js b/.history/ruoyi-ui/src/api/system/Order_20250522174732.js deleted file mode 100644 index 3b109de..0000000 --- a/.history/ruoyi-ui/src/api/system/Order_20250522174732.js +++ /dev/null @@ -1,101 +0,0 @@ -import request from '@/utils/request' - -// 查询服务订单列表 -export function listOrder(query) { - return request({ - url: '/system/Order/list', - method: 'get', - params: query - }) -} - -// 查询服务订单详细 -export function getOrder(id) { - return request({ - url: '/system/Order/' + id, - method: 'get' - }) -} - -// 新增服务订单 -export function addOrder(data) { - return request({ - url: '/system/Order', - method: 'post', - data: data - }) -} - -// 修改服务订单 -export function updateOrder(data) { - return request({ - url: '/system/Order', - method: 'put', - data: data - }) -} - -// 删除服务订单 -export function delOrder(id) { - return request({ - url: '/system/Order/' + id, - method: 'delete' - }) -} - -// 获取接单记录列表 -export function getReceiveRecords(orderId) { - return request({ - url: '/system/Order/receive-records/' + orderId, - method: 'get' - }) -} -export function getGoodsDataList() { - return request({ - url: '/system/QuoteType/goodsDataList', - method: 'get' - }) -} -// 获取接单记录列表 -export function getUserDataList() { - return request({ - url: '/system/transfer/getUsersDataList', - method: 'get' - }) -} - - -// 获取通话记录列表 -export function getCallRecords(orderId) { - return request({ - url: '/system/Order/call-records/' + orderId, - method: 'get' - }) -} - -// 获取通话记录列表 -export function getCommentRecords(orderId) { - return request({ - url: '/system/Order/comment-records/' + orderId, - method: 'get' - }) -} - - - - -// 获取录音文件列表 -export function getAudioRecords(orderId) { - return request({ - url: '/system/Order/audio-records/' + orderId, - method: 'get' - }) -} - -// 获取通知记录列表 -export function getNotifyRecords(orderId) { - return request({ - url: '/system/Order/notify-records/' + orderId, - method: 'get' - }) -} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 0ec0607..0d718b5 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,9 +6,9 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://localhost:3306/hfrj_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: 123456 + url: jdbc:mysql://120.46.95.81:3306/hfrj_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: hfrj_db + password: c6rs2ThbrtxmCTYY # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java index 2ae25cf..546b291 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java @@ -1636,6 +1636,9 @@ public class AppleOrderController extends BaseController { if (groupBuying != null){ orderMap.put("groupid", groupBuying.getOrderid()); } + + + orderMap.put("is_comment", order.getIsComment()); // 基本信息 orderMap.put("goodsid", order.getProductId()); orderMap.put("id", order.getId()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java index 51641e1..d0a9500 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java @@ -4906,7 +4906,7 @@ public class AppletController extends BaseController { queryParams.put("makeHour", timeKey); // 查询当前时间段的预约数量 - Integer makeCount = orderService.selectOrderCountByMakeTimeAndHour(queryParams); + Integer makeCount = 0; if (makeCount == null) { makeCount = 0; 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 a44b0db..d8716cc 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 @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.system.ControllerUtil.DispatchUtil; import com.ruoyi.system.ControllerUtil.OrderUtil; import com.ruoyi.system.ControllerUtil.VerificationResult; import com.ruoyi.system.domain.*; @@ -345,4 +346,65 @@ public class OrderController extends BaseController { return AjaxResult.success(goods); } + /** + * 派单接口 + */ + @PreAuthorize("@ss.hasPermi('system:Order:edit')") + @Log(title = "订单派单", businessType = BusinessType.UPDATE) + @PostMapping("/dispatch") + public AjaxResult dispatch(@RequestBody Map params) { + try { + Long orderId = Long.valueOf(params.get("orderId").toString()); + Integer receiveType = Integer.valueOf(params.get("receiveType").toString()); + Long workerId = null; + if (params.get("workerId") != null) { + workerId = Long.valueOf(params.get("workerId").toString()); + } + // 查询师傅 + Users users = usersService.selectUsersById(workerId); + if (users == null) { + return error("工人不存在"); + } + + // 查询订单 + Order order = orderService.selectOrderById(orderId); + if (order == null) { + return error("订单不存在"); + } + + // 验证订单状态 + if (order.getStatus() != 1) { + return error("只有待接单状态的订单才能派单"); + } + + DispatchUtil.creatWorkerForOrder(order,users); +// +// // 更新订单的派单类型 +// order.setReceiveType(receiveType.longValue()); +// +// // 如果是指定工人,需要验证工人信息 +// if (receiveType == 3 && workerId != null) { +// // 这里可以添加工人验证逻辑 +// // 暂时跳过工人验证 +// } +// +// // 更新订单状态为待服务 +// order.setStatus(2L); + + return toAjax(1); + } catch (Exception e) { + return error("派单失败:" + e.getMessage()); + } + } + + /** + * 获取可派单工人列表 + */ + @PreAuthorize("@ss.hasPermi('system:Order:query')") + @GetMapping("/getCanDoWorkerList") + public TableDataInfo getCanDoWorkerList(Users users) { + startPage(); + List list = usersService.selectUsersList(users); + return getDataTable(list); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java index b4e955c..3b1ec2a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteCraftController.java @@ -77,31 +77,33 @@ public class QuoteCraftController extends BaseController @PostMapping(value = "/selectQuoteTypeList") public AjaxResult selectQuoteTypeList(@RequestBody List ids) { + System.out.println("接收到的服务ID列表: " + ids); + if (ids == null || ids.isEmpty()) { + System.out.println("服务ID列表为空,返回空结果"); return success(new ArrayList<>()); } - QuoteType query = new QuoteType(); - query.setStatus(1L); // 只获取启用状态的数据 - List allTypes = quoteTypeService.selectQuoteTypeList(query); + // 直接调用Service方法根据服务ID数组查询工艺分类 + List filteredTypes = quoteTypeService.selectQuoteTypeByServiceIds(ids); + System.out.println("查询到的工艺分类数量: " + (filteredTypes != null ? filteredTypes.size() : 0)); - // 根据服务项目ID过滤工艺分类 - List filteredTypes = allTypes.stream() - .filter(type -> { - if (type.getGoodId() != null) { - try { - List typeGoodIds = JSON.parseArray(type.getGoodId(), String.class); - return typeGoodIds.stream().anyMatch(goodId -> ids.contains(Long.parseLong(goodId))); - } catch (Exception e) { - return false; - } - } - return false; - }) - .collect(Collectors.toList()); - return success(filteredTypes); } + + /** + * 测试查询方法 + */ + @GetMapping(value = "/testQuoteType") + public AjaxResult testQuoteType() + { + List allTypes = quoteTypeService.testSelectQuoteType(); + System.out.println("测试查询到的工艺分类数量: " + (allTypes != null ? allTypes.size() : 0)); + if (allTypes != null && !allTypes.isEmpty()) { + System.out.println("第一个工艺分类的good_id: " + allTypes.get(0).getGoodId()); + } + return success(allTypes); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java index bad1e73..db27ac7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/QuoteMaterialTypeController.java @@ -27,6 +27,8 @@ import com.ruoyi.system.service.IQuoteMaterialTypeService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import java.util.ArrayList; + /** * 项目报价--物料分类Controller * @@ -88,6 +90,27 @@ public class QuoteMaterialTypeController extends BaseController return success(list); } + /** + * 根据服务ID数组查询物料分类 + */ + @PreAuthorize("@ss.hasPermi('system:QuoteMaterialType:query')") + @PostMapping(value = "/selectQuoteMaterialTypeList") + public AjaxResult selectQuoteMaterialTypeList(@RequestBody List ids) + { + System.out.println("接收到的服务ID列表: " + ids); + + if (ids == null || ids.isEmpty()) { + System.out.println("服务ID列表为空,返回空结果"); + return success(new ArrayList<>()); + } + + // 调用Service方法根据服务ID数组查询物料分类 + List filteredTypes = quoteMaterialTypeService.selectQuoteMaterialTypeByServiceIds(ids); + System.out.println("查询到的物料分类数量: " + (filteredTypes != null ? filteredTypes.size() : 0)); + + return success(filteredTypes); + } + /** * 获取项目报价--物料分类详细信息 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersController.java index 4f9184c..2564968 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersController.java @@ -68,6 +68,22 @@ public class UsersController extends BaseController + /** + * 查询【请填写功能名称】列表 + */ + @PreAuthorize("@ss.hasPermi('system:users:list')") + @GetMapping("/cando/workerlist") + public TableDataInfo candoworkerlist() + { + Users users = new Users(); + users.setType("2"); + List list = usersService.selectUsersList(users); + return getDataTable(list); + + } + + + /** * 导出【请填写功能名称】列表 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersPayBeforController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersPayBeforController.java index 947f657..dea9a6c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersPayBeforController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersPayBeforController.java @@ -1,7 +1,16 @@ package com.ruoyi.system.controller; +import java.math.BigDecimal; import java.util.List; import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +import com.alibaba.fastjson.JSONObject; +import com.ruoyi.system.ControllerUtil.OrderUtil; +import com.ruoyi.system.domain.Order; +import com.ruoyi.system.domain.OrderLog; +import com.ruoyi.system.service.IOrderLogService; +import com.ruoyi.system.service.IOrderService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -33,6 +42,10 @@ public class UsersPayBeforController extends BaseController { @Autowired private IUsersPayBeforService usersPayBeforService; + @Autowired + private IOrderService orderService; + @Autowired + private IOrderLogService orderLogService; /** * 查询预支付列表 @@ -111,4 +124,93 @@ public class UsersPayBeforController extends BaseController UsersPayBefor usersPayBefor = usersPayBeforService.selectUsersPayBeforByOrderId(orderId); return success(usersPayBefor); } + + /** + * 根据订单ID查询支付明细列表 + */ + @GetMapping("/getPayDetailsByOrderId/{orderId}") + public AjaxResult getPayDetailsByOrderId(@PathVariable("orderId") String orderId) + { + List list = usersPayBeforService.selectPayDetailsByOrderId(orderId); + return success(list); + } + + /** + * 退款接口 + */ + @Log(title = "预支付退款", businessType = BusinessType.UPDATE) + @PostMapping("/refund") + public AjaxResult refund(@RequestBody Map params) + { + // 参数解析 + Long id = params.get("id") == null ? null : Long.valueOf(params.get("id").toString()); + BigDecimal returnMoney = params.get("returnmoney") == null ? null : new BigDecimal(params.get("returnmoney").toString()); + String orderIdFromRequest = params.get("orderid") == null ? null : params.get("orderid").toString(); + + // 基础校验 + if (id == null) { + return error("预支付ID不能为空"); + } + if (returnMoney == null || returnMoney.compareTo(BigDecimal.ZERO) <= 0) { + return error("退款金额必须大于0"); + } + + // 查询原始支付记录 + UsersPayBefor originalRecord = usersPayBeforService.selectUsersPayBeforById(id); + if (originalRecord == null) { + return error("支付记录不存在"); + } + // 优先使用前端传入的订单表 orderId,避免使用预支付中的同名字段 + String orderId = orderIdFromRequest != null ? orderIdFromRequest : originalRecord.getOrderid(); + if (orderId == null) { + return error("订单ID不能为空"); + } + Order order = orderService.selectOrderByOrderId(orderId); + if (order == null){ + return error("订单不存在"); + } + //添加流水并修改订单状态7上门费 8定金 9尾款 10差价 + OrderLog orderLog = new OrderLog(); + orderLog.setOrderId(orderId); + orderLog.setOid(order.getId()); + orderLog.setTitle("退款"); + orderLog.setType(new BigDecimal(11)); + JSONObject jsonObject = new JSONObject(); + if (originalRecord.getType()==7){ + jsonObject.put("name", "上门费退款,退款金额:"+returnMoney); + } + if (originalRecord.getType()==8){ + jsonObject.put("name", "定金退款,退款金额:"+returnMoney); + } + if (originalRecord.getType()==9){ + jsonObject.put("name", "尾款退款,退款金额:"+returnMoney); + } + if (originalRecord.getType()==10){ + jsonObject.put("name", "差价退款,退款金额:"+returnMoney); + } + if (originalRecord.getType()==1||originalRecord.getType()==2||originalRecord.getType()==3||originalRecord.getType()==4||originalRecord.getType()==5){ + jsonObject.put("name", "订单预付付款退款,退款金额:"+returnMoney); + } + orderLog.setContent(jsonObject.toJSONString()); + int flg=orderLogService.insertOrderLog(orderLog); +// if (flg>0){ +// +// } +// OrderUtil orderUtil = new OrderUtil(); +// OrderUtil.refund(order, usersPayBefor); + // 验证退款金额不能超过支付金额 + BigDecimal currentReturnMoney = originalRecord.getReturnmoney() != null ? originalRecord.getReturnmoney() : BigDecimal.ZERO; + BigDecimal totalRefund = currentReturnMoney.add(returnMoney); + BigDecimal paymentAmount = originalRecord.getAllmoney() != null ? originalRecord.getAllmoney() : BigDecimal.ZERO; + + if (totalRefund.compareTo(paymentAmount) > 0) { + return error("退款金额不能超过支付金额"); + } + //更新退款状态 + originalRecord.setStatus(3L); + // 更新退款金额 + originalRecord.setReturnmoney(totalRefund); + + return toAjax(usersPayBeforService.updateUsersPayBefor(originalRecord)); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java index a0bb986..94b96d4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java @@ -5579,6 +5579,7 @@ public class AppletControllerUtil { order.setDeduction(new BigDecimal(0)); order.setFileData(attachments); // 设置附件数据 order.setType(1); + //order.setPayPrice(new BigDecimal(0)); int insertResult = orderService.insertOrder(order); if (insertResult <= 0) { result.put("success", false); @@ -5745,7 +5746,7 @@ public class AppletControllerUtil { order.setTotalPrice(itemPrice); order.setGoodPrice(BigDecimal.ZERO); order.setServicePrice(BigDecimal.ZERO); - order.setPayPrice(itemPrice); + order.setPayPrice(BigDecimal.ZERO); //有次卡直接形成订单 if (StringUtils.isNotBlank(cikaid)){ order.setStatus(1L); // 待接单 @@ -5924,7 +5925,7 @@ public class AppletControllerUtil { order.setTotalPrice(itemPrice); order.setGoodPrice(BigDecimal.ZERO); order.setServicePrice(BigDecimal.ZERO); - order.setPayPrice(itemPrice); + order.setPayPrice(BigDecimal.ZERO); order.setStatus(11L); // 待待接单 order.setReceiveType(Long.valueOf(dispatchtype)); // 自由抢单 order.setIsAccept(0); @@ -6028,10 +6029,10 @@ public class AppletControllerUtil { } //order.setNum(num); - order.setTotalPrice(itemPrice); + order.setTotalPrice(BigDecimal.ZERO); order.setGoodPrice(BigDecimal.ZERO); order.setServicePrice(BigDecimal.ZERO); - order.setPayPrice(itemPrice); + order.setPayPrice(BigDecimal.ZERO); order.setStatus(8L); // 待待报价 order.setBigtype(serviceGoods.getServicetype()); order.setReceiveType(Long.valueOf(dispatchtype)); // 自由抢单 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java index 6d02fd8..deee3a8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/CartOrderUtil.java @@ -95,7 +95,7 @@ public class CartOrderUtil { order.setTotalPrice(itemPrice); order.setGoodPrice(BigDecimal.ZERO); order.setServicePrice(BigDecimal.ZERO); - order.setPayPrice(itemPrice); + order.setPayPrice(BigDecimal.ZERO); order.setStatus(1L); order.setReceiveType(1L); order.setIsAccept(0); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/OrderUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/OrderUtil.java index 6474c7c..7b31127 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/OrderUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/OrderUtil.java @@ -707,6 +707,12 @@ public class OrderUtil { orderLog.setPayTime(System.currentTimeMillis()/1000); //orderLog.setUpdateTime(new Date()); int updateResult = orderLogService.updateOrderLog(orderLog); + Order order = orderService.selectOrderByOrderId(payBefor.getLastorderid()); + if (order != null){ + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); + orderService.updateOrder(order); + } + if (updateResult > 0){ ISTOPAYSIZE(payBefor.getLastorderid()); } @@ -729,6 +735,11 @@ public class OrderUtil { orderLog.setDepPayTime(System.currentTimeMillis()/1000); int updateResult = orderLogService.updateOrderLog(orderLog); if (updateResult > 0){ + Order order = orderService.selectOrderByOrderId(payBefor.getLastorderid()); + if (order != null){ + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); + orderService.updateOrder(order); + } ISTOPAYSIZE(payBefor.getLastorderid()); } } @@ -739,6 +750,11 @@ public class OrderUtil { Order order = orderService.selectOrderByOrderId(payBefor.getLastorderid()); if (order != null) { + + + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); + orderService.updateOrder(order); + //更新最新的一条日志信息 OrderLog orderLog = orderLogService.selectOrderLogById(payBefor.getOid()); orderLog.setPayTime(System.currentTimeMillis()/1000); @@ -768,6 +784,11 @@ public class OrderUtil { orderLog.setDepPayTime(System.currentTimeMillis()/1000); int updateResult = orderLogService.updateOrderLog(orderLog); if (updateResult > 0){ + Order order = orderService.selectOrderByOrderId(payBefor.getLastorderid()); + if (order != null){ + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); + orderService.updateOrder(order); + } ISTOPAYSIZE(payBefor.getLastorderid()); } } @@ -804,6 +825,7 @@ public class OrderUtil { order.setStatus(2L); order.setJsonStatus(2); + order.setPayPrice(order.getPayPrice().add(userDemandQuotation.getMoney())); order.setFirstWorkerId(users.getId()); order.setIsAccept(1); order.setWorkerPhone(users.getPhone()); @@ -878,6 +900,7 @@ public class OrderUtil { System.out.println("订单日志插入结果: " + logInsertResult); System.out.println("更新订单状态为待派单"); + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); order.setStatus(1L); // 1=待预约 int orderUpdateResult = orderService.updateOrder(order); System.out.println("订单状态更新结果: " + orderUpdateResult); @@ -921,6 +944,7 @@ public class OrderUtil { Order order = new Order(); order.setOdertype(1); // 拼团 order.setStatus(9L); // 9=待成团 + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); order.setOrderId(ptorderid); order.setUid(payBefor.getUid()); order.setNum(payBefor.getNum()); // 默认1,可根据业务调整 @@ -1085,6 +1109,7 @@ public class OrderUtil { if (logInsertResult>0){ DispatchUtil.dispatchOrder(order.getId()); } + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); order.setStatus(1L); // 1=待预约 int orderUpdateResult = orderService.updateOrder(order); dispatchOrderCheck(order); @@ -1114,6 +1139,7 @@ public class OrderUtil { System.out.println("订单日志插入结果: " + logInsertResult); System.out.println("更新订单状态为待派单"); + order.setPayPrice(order.getPayPrice().add(payBefor.getAllmoney())); order.setStatus(1L); // 1=待预约 int orderUpdateResult = orderService.updateOrder(order); System.out.println("订单状态更新结果: " + orderUpdateResult); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteMaterialTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteMaterialTypeMapper.java index 73092dc..5f4173e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteMaterialTypeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteMaterialTypeMapper.java @@ -61,4 +61,12 @@ public interface QuoteMaterialTypeMapper * @return 结果 */ public int deleteQuoteMaterialTypeByIds(Long[] ids); + + /** + * 根据服务ID数组查询物料分类 + * + * @param serviceIds 服务ID数组 + * @return 物料分类集合 + */ + public List selectQuoteMaterialTypeByServiceIds(List serviceIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteTypeMapper.java index 4a57cd5..b10c0f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteTypeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/QuoteTypeMapper.java @@ -27,6 +27,7 @@ public interface QuoteTypeMapper */ public List selectQuoteTypeList(QuoteType quoteType); + /** * 新增项目报价--工艺分类 * @@ -58,4 +59,19 @@ public interface QuoteTypeMapper * @return 结果 */ public int deleteQuoteTypeByIds(Long[] ids); + + /** + * 根据服务ID数组查询工艺分类 + * + * @param serviceIds 服务ID数组 + * @return 工艺分类集合 + */ + public List selectQuoteTypeByServiceIds(List serviceIds); + + /** + * 测试查询方法 + * + * @return 工艺分类集合 + */ + public List testSelectQuoteType(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UsersPayBeforMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UsersPayBeforMapper.java index 44ec88d..5426423 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UsersPayBeforMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UsersPayBeforMapper.java @@ -70,4 +70,12 @@ public interface UsersPayBeforMapper * @return 数量 */ public Integer countByLastOrderIdAndStatus(String orderid); + + /** + * 根据订单ID查询支付明细列表 + * 查询条件:orderid = orderId 或 lastorderid = orderId + * @param orderId 订单ID + * @return 支付明细列表 + */ + public List selectPayDetailsByOrderId(String orderId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteMaterialTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteMaterialTypeService.java index e42f33e..bbcc4b5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteMaterialTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteMaterialTypeService.java @@ -60,4 +60,12 @@ public interface IQuoteMaterialTypeService * @return 结果 */ public int deleteQuoteMaterialTypeById(Long id); + + /** + * 根据服务ID数组查询物料分类 + * + * @param serviceIds 服务ID数组 + * @return 物料分类集合 + */ + public List selectQuoteMaterialTypeByServiceIds(List serviceIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteTypeService.java index 163ab77..fd8ffcb 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteTypeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IQuoteTypeService.java @@ -58,4 +58,19 @@ public interface IQuoteTypeService * @return 结果 */ public int deleteQuoteTypeById(Long id); + + /** + * 根据服务ID数组查询工艺分类 + * + * @param serviceIds 服务ID数组 + * @return 工艺分类集合 + */ + public List selectQuoteTypeByServiceIds(List serviceIds); + + /** + * 测试查询方法 + * + * @return 工艺分类集合 + */ + public List testSelectQuoteType(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUsersPayBeforService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUsersPayBeforService.java index bf6f2eb..2fcfa9c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUsersPayBeforService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUsersPayBeforService.java @@ -70,4 +70,12 @@ public interface IUsersPayBeforService * @return 数量 */ public Integer countByLastOrderIdAndStatus(String orderid); + + /** + * 根据订单ID查询支付明细列表 + * 查询条件:orderid = orderId 或 lastorderid = orderId + * @param orderId 订单ID + * @return 支付明细列表 + */ + public List selectPayDetailsByOrderId(String orderId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteMaterialTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteMaterialTypeServiceImpl.java index a1805e9..7a1590b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteMaterialTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteMaterialTypeServiceImpl.java @@ -94,4 +94,16 @@ public class QuoteMaterialTypeServiceImpl implements IQuoteMaterialTypeService { return quoteMaterialTypeMapper.deleteQuoteMaterialTypeById(id); } + + /** + * 根据服务ID数组查询物料分类 + * + * @param serviceIds 服务ID数组 + * @return 物料分类集合 + */ + @Override + public List selectQuoteMaterialTypeByServiceIds(List serviceIds) + { + return quoteMaterialTypeMapper.selectQuoteMaterialTypeByServiceIds(serviceIds); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteTypeServiceImpl.java index e9c9e2e..2a79f4d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QuoteTypeServiceImpl.java @@ -19,6 +19,17 @@ public class QuoteTypeServiceImpl implements IQuoteTypeService @Autowired private QuoteTypeMapper quoteTypeMapper; + /** + * 根据服务ID数组查询工艺分类 + * + * @param serviceIds 服务ID数组 + * @return 工艺分类集合 + */ + @Override + public List selectQuoteTypeByServiceIds(List serviceIds){ + return quoteTypeMapper.selectQuoteTypeByServiceIds(serviceIds); + } + /** * 查询项目报价--工艺分类 * @@ -90,4 +101,15 @@ public class QuoteTypeServiceImpl implements IQuoteTypeService { return quoteTypeMapper.deleteQuoteTypeById(id); } + + /** + * 测试查询方法 + * + * @return 工艺分类集合 + */ + @Override + public List testSelectQuoteType() + { + return quoteTypeMapper.testSelectQuoteType(); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UsersPayBeforServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UsersPayBeforServiceImpl.java index 7ec1dd7..4440ae6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UsersPayBeforServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UsersPayBeforServiceImpl.java @@ -100,4 +100,16 @@ public class UsersPayBeforServiceImpl implements IUsersPayBeforService public Integer countByLastOrderIdAndStatus(String orderid) { return usersPayBeforMapper.countByLastOrderIdAndStatus(orderid); } + + /** + * 根据订单ID查询支付明细列表 + * + * @param orderId 订单ID + * @return 支付明细列表 + */ + @Override + public List selectPayDetailsByOrderId(String orderId) + { + return usersPayBeforMapper.selectPayDetailsByOrderId(orderId); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml b/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml index 6065792..7c7a16c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml @@ -87,7 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and transaction_id = #{transactionId} and main_order_id = #{mainOrderId} - order by id desc + ORDER BY + CASE + WHEN (status = 2 OR returnstatus IN (1,4)) THEN 0 + ELSE 1 + END ASC, + updated_at DESC @@ -182,9 +187,6 @@ and bigtype = #{bigtype} - - AND (worker_id IS NULL OR worker_id = '') - and make_time >= #{makeTimeStart} and make_time < #{makeTimeEnd} @@ -199,7 +201,7 @@ and id in ( select b.oid from user_demand_quotation b where b.status=1) - + and is_comment =#{isComment} @@ -246,7 +248,12 @@ - order by id desc + ORDER BY + CASE + WHEN status = 1 AND (worker_id IS NULL OR worker_id = 0) THEN 0 + ELSE 1 + END ASC, + updated_at DESC - select count(1) - from order_data - where make_time = #{makeTime} - and make_hour = #{makeHour} - and status != 4 - and deleted_at is null - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/QuoteMaterialTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/QuoteMaterialTypeMapper.xml index 99ecd0a..9c94ffe 100644 --- a/ruoyi-system/src/main/resources/mapper/system/QuoteMaterialTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/QuoteMaterialTypeMapper.xml @@ -46,6 +46,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + insert into quote_material_type @@ -82,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from quote_material_type where id = #{id} - + delete from quote_material_type where id in #{id} diff --git a/ruoyi-system/src/main/resources/mapper/system/QuoteTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/QuoteTypeMapper.xml index 42ace3b..eb21273 100644 --- a/ruoyi-system/src/main/resources/mapper/system/QuoteTypeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/QuoteTypeMapper.xml @@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and good_id like concat('%', #{goodId}, '%') and status = #{status} - order by id desc + order by sort asc, id desc + + + + + insert into quote_type @@ -69,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from quote_type where id = #{id} - + delete from quote_type where id in #{id} diff --git a/ruoyi-system/src/main/resources/mapper/system/UsersPayBeforMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UsersPayBeforMapper.xml index cb62336..da77114 100644 --- a/ruoyi-system/src/main/resources/mapper/system/UsersPayBeforMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/UsersPayBeforMapper.xml @@ -89,6 +89,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select count(1) from users_pay_befor where lastorderid = #{orderid} and status = 1 + + insert into users_pay_befor diff --git a/ruoyi-ui/dist.7z b/ruoyi-ui/dist.7z index b55061a..300984f 100644 Binary files a/ruoyi-ui/dist.7z and b/ruoyi-ui/dist.7z differ diff --git a/ruoyi-ui/dist.zip b/ruoyi-ui/dist.zip new file mode 100644 index 0000000..77bc638 Binary files /dev/null and b/ruoyi-ui/dist.zip differ diff --git a/ruoyi-ui/src/api/system/Order.js b/ruoyi-ui/src/api/system/Order.js index 1875883..b16aec7 100644 --- a/ruoyi-ui/src/api/system/Order.js +++ b/ruoyi-ui/src/api/system/Order.js @@ -17,6 +17,16 @@ export function getOrder(id) { }) } +// // 查询服务订单详细 +// export function getCanDoWorkerList() { +// return request({ +// url: '/system/users/cando/workerlist/', +// method: 'get' +// }) +// } + + + // 新增服务订单 export function addOrder(data) { return request({ @@ -158,3 +168,38 @@ export function getNotifyRecords(orderId) { method: 'get' }) } + +// 获取支付明细列表 +export function getPaymentDetails(orderId) { + return request({ + url: '/system/UsersPayBefor/getPayDetailsByOrderId/' + orderId, + method: 'get' + }) +} + +// 申请退款 +export function refundPayment(data) { + return request({ + url: '/system/UsersPayBefor/refund', + method: 'post', + data: data + }) +} + +// 派单 +export function dispatchOrder(data) { + return request({ + url: '/system/Order/dispatch', + method: 'post', + data: data + }) +} + +// 获取可派单工人列表 +export function getCanDoWorkerList(params) { + return request({ + url: '/system/Order/getCanDoWorkerList', + method: 'get', + params: params + }) +} diff --git a/ruoyi-ui/src/views/system/Order/index.vue b/ruoyi-ui/src/views/system/Order/index.vue index ad6a164..2286dc4 100644 --- a/ruoyi-ui/src/views/system/Order/index.vue +++ b/ruoyi-ui/src/views/system/Order/index.vue @@ -200,11 +200,27 @@ ¥{{ (scope.row.totalPrice != null ? scope.row.totalPrice : 0).toFixed(2) }} - - - + + + + + +