2025008071805
This commit is contained in:
parent
263c5869c8
commit
3331ea2609
|
|
@ -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<Order> 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<Order> list = orderService.selectOrderList(order);
|
||||
ExcelUtil<Order> util = new ExcelUtil<Order>(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<OrderLog> 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<OrderSound> 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<OrderComment> 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("订单不存在");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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<Order> 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<Order> list = orderService.selectOrderList(order);
|
||||
ExcelUtil<Order> util = new ExcelUtil<Order>(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<OrderLog> 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<OrderSound> 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<OrderComment> 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<SysUser> users = sysUserService.selectUserList(new SysUser());
|
||||
return AjaxResult.success(users);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品下拉列表
|
||||
*/
|
||||
@GetMapping("/serviceGoodsOptions")
|
||||
public AjaxResult getServiceGoodsOptions() {
|
||||
List<ServiceGoods> goods = serviceGoodsService.selectServiceGoodsList(new ServiceGoods());
|
||||
return AjaxResult.success(goods);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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'
|
||||
})
|
||||
}
|
||||
|
|
@ -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'
|
||||
})
|
||||
}
|
||||
|
|
@ -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'
|
||||
})
|
||||
}
|
||||
|
|
@ -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:
|
||||
# 从数据源开关/默认关闭
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<String, Object> 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<Users> list = usersService.selectUsersList(users);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,31 +77,33 @@ public class QuoteCraftController extends BaseController
|
|||
@PostMapping(value = "/selectQuoteTypeList")
|
||||
public AjaxResult selectQuoteTypeList(@RequestBody List<Long> 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<QuoteType> allTypes = quoteTypeService.selectQuoteTypeList(query);
|
||||
// 直接调用Service方法根据服务ID数组查询工艺分类
|
||||
List<QuoteType> filteredTypes = quoteTypeService.selectQuoteTypeByServiceIds(ids);
|
||||
System.out.println("查询到的工艺分类数量: " + (filteredTypes != null ? filteredTypes.size() : 0));
|
||||
|
||||
// 根据服务项目ID过滤工艺分类
|
||||
List<QuoteType> filteredTypes = allTypes.stream()
|
||||
.filter(type -> {
|
||||
if (type.getGoodId() != null) {
|
||||
try {
|
||||
List<String> 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<QuoteType> 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Long> ids)
|
||||
{
|
||||
System.out.println("接收到的服务ID列表: " + ids);
|
||||
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
System.out.println("服务ID列表为空,返回空结果");
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
|
||||
// 调用Service方法根据服务ID数组查询物料分类
|
||||
List<QuoteMaterialType> filteredTypes = quoteMaterialTypeService.selectQuoteMaterialTypeByServiceIds(ids);
|
||||
System.out.println("查询到的物料分类数量: " + (filteredTypes != null ? filteredTypes.size() : 0));
|
||||
|
||||
return success(filteredTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目报价--物料分类详细信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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<Users> list = usersService.selectUsersList(users);
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出【请填写功能名称】列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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<UsersPayBefor> list = usersPayBeforService.selectPayDetailsByOrderId(orderId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款接口
|
||||
*/
|
||||
@Log(title = "预支付退款", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/refund")
|
||||
public AjaxResult refund(@RequestBody Map<String, Object> 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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)); // 自由抢单
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -61,4 +61,12 @@ public interface QuoteMaterialTypeMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteQuoteMaterialTypeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据服务ID数组查询物料分类
|
||||
*
|
||||
* @param serviceIds 服务ID数组
|
||||
* @return 物料分类集合
|
||||
*/
|
||||
public List<QuoteMaterialType> selectQuoteMaterialTypeByServiceIds(List<Long> serviceIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public interface QuoteTypeMapper
|
|||
*/
|
||||
public List<QuoteType> selectQuoteTypeList(QuoteType quoteType);
|
||||
|
||||
|
||||
/**
|
||||
* 新增项目报价--工艺分类
|
||||
*
|
||||
|
|
@ -58,4 +59,19 @@ public interface QuoteTypeMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteQuoteTypeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据服务ID数组查询工艺分类
|
||||
*
|
||||
* @param serviceIds 服务ID数组
|
||||
* @return 工艺分类集合
|
||||
*/
|
||||
public List<QuoteType> selectQuoteTypeByServiceIds(List<Long> serviceIds);
|
||||
|
||||
/**
|
||||
* 测试查询方法
|
||||
*
|
||||
* @return 工艺分类集合
|
||||
*/
|
||||
public List<QuoteType> testSelectQuoteType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,4 +70,12 @@ public interface UsersPayBeforMapper
|
|||
* @return 数量
|
||||
*/
|
||||
public Integer countByLastOrderIdAndStatus(String orderid);
|
||||
|
||||
/**
|
||||
* 根据订单ID查询支付明细列表
|
||||
* 查询条件:orderid = orderId 或 lastorderid = orderId
|
||||
* @param orderId 订单ID
|
||||
* @return 支付明细列表
|
||||
*/
|
||||
public List<UsersPayBefor> selectPayDetailsByOrderId(String orderId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,12 @@ public interface IQuoteMaterialTypeService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteQuoteMaterialTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 根据服务ID数组查询物料分类
|
||||
*
|
||||
* @param serviceIds 服务ID数组
|
||||
* @return 物料分类集合
|
||||
*/
|
||||
public List<QuoteMaterialType> selectQuoteMaterialTypeByServiceIds(List<Long> serviceIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,19 @@ public interface IQuoteTypeService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteQuoteTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 根据服务ID数组查询工艺分类
|
||||
*
|
||||
* @param serviceIds 服务ID数组
|
||||
* @return 工艺分类集合
|
||||
*/
|
||||
public List<QuoteType> selectQuoteTypeByServiceIds(List<Long> serviceIds);
|
||||
|
||||
/**
|
||||
* 测试查询方法
|
||||
*
|
||||
* @return 工艺分类集合
|
||||
*/
|
||||
public List<QuoteType> testSelectQuoteType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,4 +70,12 @@ public interface IUsersPayBeforService
|
|||
* @return 数量
|
||||
*/
|
||||
public Integer countByLastOrderIdAndStatus(String orderid);
|
||||
|
||||
/**
|
||||
* 根据订单ID查询支付明细列表
|
||||
* 查询条件:orderid = orderId 或 lastorderid = orderId
|
||||
* @param orderId 订单ID
|
||||
* @return 支付明细列表
|
||||
*/
|
||||
public List<UsersPayBefor> selectPayDetailsByOrderId(String orderId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,4 +94,16 @@ public class QuoteMaterialTypeServiceImpl implements IQuoteMaterialTypeService
|
|||
{
|
||||
return quoteMaterialTypeMapper.deleteQuoteMaterialTypeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据服务ID数组查询物料分类
|
||||
*
|
||||
* @param serviceIds 服务ID数组
|
||||
* @return 物料分类集合
|
||||
*/
|
||||
@Override
|
||||
public List<QuoteMaterialType> selectQuoteMaterialTypeByServiceIds(List<Long> serviceIds)
|
||||
{
|
||||
return quoteMaterialTypeMapper.selectQuoteMaterialTypeByServiceIds(serviceIds);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,17 @@ public class QuoteTypeServiceImpl implements IQuoteTypeService
|
|||
@Autowired
|
||||
private QuoteTypeMapper quoteTypeMapper;
|
||||
|
||||
/**
|
||||
* 根据服务ID数组查询工艺分类
|
||||
*
|
||||
* @param serviceIds 服务ID数组
|
||||
* @return 工艺分类集合
|
||||
*/
|
||||
@Override
|
||||
public List<QuoteType> selectQuoteTypeByServiceIds(List<Long> serviceIds){
|
||||
return quoteTypeMapper.selectQuoteTypeByServiceIds(serviceIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目报价--工艺分类
|
||||
*
|
||||
|
|
@ -90,4 +101,15 @@ public class QuoteTypeServiceImpl implements IQuoteTypeService
|
|||
{
|
||||
return quoteTypeMapper.deleteQuoteTypeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试查询方法
|
||||
*
|
||||
* @return 工艺分类集合
|
||||
*/
|
||||
@Override
|
||||
public List<QuoteType> testSelectQuoteType()
|
||||
{
|
||||
return quoteTypeMapper.testSelectQuoteType();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<UsersPayBefor> selectPayDetailsByOrderId(String orderId)
|
||||
{
|
||||
return usersPayBeforMapper.selectPayDetailsByOrderId(orderId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="transactionId != null and transactionId != ''"> and transaction_id = #{transactionId}</if>
|
||||
<if test="mainOrderId != null and mainOrderId != ''"> and main_order_id = #{mainOrderId}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN (status = 2 OR returnstatus IN (1,4)) THEN 0
|
||||
ELSE 1
|
||||
END ASC,
|
||||
updated_at DESC
|
||||
</select>
|
||||
|
||||
<select id="selectGoodsOrderByorderId" parameterType="String" resultMap="GoodsOrderResult">
|
||||
|
|
|
|||
|
|
@ -160,7 +160,12 @@
|
|||
|
||||
|
||||
</where>
|
||||
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>
|
||||
|
||||
|
||||
|
|
@ -182,9 +187,6 @@
|
|||
<if test="bigtype != null and bigtype != null">
|
||||
and bigtype = #{bigtype}
|
||||
</if>
|
||||
<if test="qiangdan != null and qiangdan != null">
|
||||
AND (worker_id IS NULL OR worker_id = '')
|
||||
</if>
|
||||
<if test="makeTimeStart != null and makeTimeEnd != null">
|
||||
and make_time >= #{makeTimeStart} and make_time < #{makeTimeEnd}
|
||||
</if>
|
||||
|
|
@ -199,7 +201,7 @@
|
|||
and id in ( select b.oid from user_demand_quotation b where b.status=1)
|
||||
</if>
|
||||
|
||||
<if test="isComment != null">
|
||||
<if test="isComment != null and isComment != ''">
|
||||
and is_comment =#{isComment}
|
||||
</if>
|
||||
|
||||
|
|
@ -246,7 +248,12 @@
|
|||
</if>
|
||||
|
||||
</where>
|
||||
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>
|
||||
|
||||
<select id="selectOrderById" parameterType="Long" resultMap="OrderResult">
|
||||
|
|
@ -578,14 +585,6 @@
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<update id="updateOrderPhone" parameterType="Long">
|
||||
UPDATE order_data SET user_phone=null,worker_phone=null,middle_phone=null WHERE id=#{id}
|
||||
</update>
|
||||
<update id="updateOrderCika" parameterType="Long">
|
||||
UPDATE order_data SET cartid=null WHERE id=#{id}
|
||||
</update>
|
||||
<update id="updateOrder" parameterType="Order">
|
||||
update order_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
@ -752,132 +751,4 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 根据预约日期和时间段查询预约数量 -->
|
||||
<select id="selectOrderCountByMakeTimeAndHour" parameterType="map" resultType="Integer">
|
||||
select count(1)
|
||||
from order_data
|
||||
where make_time = #{makeTime}
|
||||
and make_hour = #{makeHour}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
</select>
|
||||
|
||||
<!-- 根据预约日期查询所有预约订单 -->
|
||||
<select id="selectOrderListByMakeTime" parameterType="map" resultMap="OrderResult">
|
||||
<include refid="selectOrderVo"/>
|
||||
where make_time = #{makeTime}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<!-- 根据预约日期和时间段查询预约订单列表 -->
|
||||
<select id="selectOrderListByMakeTimeAndHour" parameterType="map" resultMap="OrderResult">
|
||||
<include refid="selectOrderVo"/>
|
||||
where make_time = #{makeTime}
|
||||
and make_hour = #{makeHour}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<!-- 查询指定日期范围内的预约统计 -->
|
||||
<select id="selectOrderCountByDateRange" parameterType="map" resultType="map">
|
||||
select
|
||||
make_hour as timeSlot,
|
||||
count(1) as orderCount
|
||||
from order_data
|
||||
where make_time between #{startTime} and #{endTime}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
group by make_hour
|
||||
order by make_hour
|
||||
</select>
|
||||
|
||||
<!-- 查询指定日期和时间段的预约详情 -->
|
||||
<select id="selectOrderDetailByMakeTimeAndHour" parameterType="map" resultMap="OrderResult">
|
||||
<include refid="selectOrderVo"/>
|
||||
where make_time = #{makeTime}
|
||||
and make_hour = #{makeHour}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
order by created_at desc
|
||||
</select>
|
||||
|
||||
<!-- 查询用户指定日期的预约数量 -->
|
||||
<select id="selectUserOrderCountByMakeTime" parameterType="map" resultType="Integer">
|
||||
select count(1)
|
||||
from order_data
|
||||
where uid = #{uid}
|
||||
and make_time = #{makeTime}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
</select>
|
||||
|
||||
<!-- 查询指定日期和时间段的用户预约 -->
|
||||
<select id="selectUserOrderByMakeTimeAndHour" parameterType="map" resultMap="OrderResult">
|
||||
<include refid="selectOrderVo"/>
|
||||
where uid = #{uid}
|
||||
and make_time = #{makeTime}
|
||||
and make_hour = #{makeHour}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
order by created_at desc
|
||||
</select>
|
||||
|
||||
<!-- 查询预约时间冲突的订单 -->
|
||||
<select id="selectConflictingOrders" parameterType="map" resultMap="OrderResult">
|
||||
<include refid="selectOrderVo"/>
|
||||
where make_time = #{makeTime}
|
||||
and make_hour = #{makeHour}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
and id != #{excludeOrderId}
|
||||
order by created_at desc
|
||||
</select>
|
||||
|
||||
<!-- 查询指定日期所有时间段的预约统计 -->
|
||||
<select id="selectOrderCountByDate" parameterType="map" resultType="map">
|
||||
select
|
||||
make_hour as timeSlot,
|
||||
count(1) as orderCount,
|
||||
sum(case when status = 1 then 1 else 0 end) as pendingCount,
|
||||
sum(case when status = 2 then 1 else 0 end) as confirmedCount,
|
||||
sum(case when status = 3 then 1 else 0 end) as inProgressCount,
|
||||
sum(case when status = 6 then 1 else 0 end) as completedCount
|
||||
from order_data
|
||||
where make_time = #{makeTime}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
group by make_hour
|
||||
order by make_hour
|
||||
</select>
|
||||
|
||||
<!-- 查询指定日期和时间段的可用预约数量 -->
|
||||
<select id="selectAvailableOrderCount" parameterType="map" resultType="Integer">
|
||||
select count(1)
|
||||
from order_data
|
||||
where make_time = #{makeTime}
|
||||
and make_hour = #{makeHour}
|
||||
and status in (1, 2, 3) -- 只统计有效状态的订单
|
||||
and deleted_at is null
|
||||
</select>
|
||||
|
||||
<!-- 查询指定日期和时间段的预约用户列表 -->
|
||||
<select id="selectOrderUsersByMakeTimeAndHour" parameterType="map" resultType="map">
|
||||
select
|
||||
id,
|
||||
uid,
|
||||
name,
|
||||
phone,
|
||||
status,
|
||||
created_at
|
||||
from order_data
|
||||
where make_time = #{makeTime}
|
||||
and make_hour = #{makeHour}
|
||||
and status != 4
|
||||
and deleted_at is null
|
||||
order by created_at asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -46,6 +46,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectQuoteMaterialTypeByServiceIds" parameterType="java.util.List" resultMap="QuoteMaterialTypeResult">
|
||||
<include refid="selectQuoteMaterialTypeVo"/>
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
<foreach collection="list" item="serviceId" open="(" separator=" OR " close=")">
|
||||
(
|
||||
good_id = CONCAT('["', #{serviceId}, '"]')
|
||||
OR good_id LIKE CONCAT('["', #{serviceId}, '",%')
|
||||
OR good_id LIKE CONCAT('%, "', #{serviceId}, '"]')
|
||||
OR good_id LIKE CONCAT('%, "', #{serviceId}, '",%')
|
||||
OR good_id LIKE CONCAT('%"', #{serviceId}, '"%')
|
||||
)
|
||||
</foreach>
|
||||
</if>
|
||||
and status = 1
|
||||
</where>
|
||||
order by sort asc, id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertQuoteMaterialType" parameterType="QuoteMaterialType" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into quote_material_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -82,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from quote_material_type where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQuoteMaterialTypeByIds" parameterType="String">
|
||||
<delete id="deleteQuoteMaterialTypeByIds" parameterType="Long[]">
|
||||
delete from quote_material_type where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="goodId != null and goodId != ''"> and good_id like concat('%', #{goodId}, '%')</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
order by sort asc, id desc
|
||||
</select>
|
||||
|
||||
<select id="selectQuoteTypeById" parameterType="Long" resultMap="QuoteTypeResult">
|
||||
|
|
@ -33,6 +33,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectQuoteTypeByServiceIds" parameterType="java.util.List" resultMap="QuoteTypeResult">
|
||||
<include refid="selectQuoteTypeVo"/>
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
<foreach collection="list" item="serviceId" open="(" separator=" OR " close=")">
|
||||
(
|
||||
good_id = CONCAT('["', #{serviceId}, '"]')
|
||||
OR good_id LIKE CONCAT('["', #{serviceId}, '",%')
|
||||
OR good_id LIKE CONCAT('%, "', #{serviceId}, '"]')
|
||||
OR good_id LIKE CONCAT('%, "', #{serviceId}, '",%')
|
||||
OR good_id LIKE CONCAT('%"', #{serviceId}, '"%')
|
||||
)
|
||||
</foreach>
|
||||
</if>
|
||||
and status = 1
|
||||
</where>
|
||||
order by sort asc, id desc
|
||||
</select>
|
||||
|
||||
<!-- 测试查询方法 -->
|
||||
<select id="testSelectQuoteType" resultMap="QuoteTypeResult">
|
||||
<include refid="selectQuoteTypeVo"/>
|
||||
where status = 1
|
||||
order by sort asc, id desc
|
||||
limit 10
|
||||
</select>
|
||||
|
||||
<insert id="insertQuoteType" parameterType="QuoteType" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into quote_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -69,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from quote_type where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQuoteTypeByIds" parameterType="String">
|
||||
<delete id="deleteQuoteTypeByIds" parameterType="Long[]">
|
||||
delete from quote_type where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
</select>
|
||||
|
||||
<select id="selectPayDetailsByOrderId" parameterType="String" resultMap="UsersPayBeforResult">
|
||||
<include refid="selectUsersPayBeforVo"/>
|
||||
where orderid = #{orderId} or lastorderid = #{orderId}
|
||||
order by paytime desc, id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertUsersPayBefor" parameterType="UsersPayBefor" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into users_pay_befor
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
|
|
|||
BIN
ruoyi-ui/dist.7z
BIN
ruoyi-ui/dist.7z
Binary file not shown.
Binary file not shown.
|
|
@ -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
|
||||
})
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -130,13 +130,12 @@
|
|||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="服务" prop="goodsintids">
|
||||
<el-select v-model="form.goodsintids" multiple filterable placeholder="请选择服务" style="width: 100%">
|
||||
<el-select v-model="form.goodsintids" multiple filterable placeholder="请选择服务" style="width: 100%" @change="handleServiceChange">
|
||||
<el-option
|
||||
v-for="(type, index) in typeDataList"
|
||||
v-for="type in typeDataList"
|
||||
:key="type.id"
|
||||
:label="type.title"
|
||||
:value="type.id"
|
||||
@click.native="handelSelectMultiple(type, index)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -172,8 +171,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listQuoteCraft, getQuoteCraft, delQuoteCraft, addQuoteCraft, updateQuoteCraft ,selectQuoteTypeList} from "@/api/system/QuoteCraft"
|
||||
import { listQuoteCraft, getQuoteCraft, delQuoteCraft, addQuoteCraft, updateQuoteCraft } from "@/api/system/QuoteCraft"
|
||||
import { getGoodsDataList } from "@/api/system/QuoteType"
|
||||
import request from "@/utils/request"
|
||||
|
||||
export default {
|
||||
name: "QuoteCraft",
|
||||
|
|
@ -230,11 +230,10 @@ export default {
|
|||
// 表单校验
|
||||
rules: {
|
||||
goodsintids: [
|
||||
{ required: true, message: "服务不能为空", trigger: "blur" }
|
||||
{ required: true, message: "服务不能为空", trigger: "change" }
|
||||
],
|
||||
|
||||
typeintids: [
|
||||
{ required: true, message: "类型不能为空", trigger: "blur" }
|
||||
{ required: true, message: "类型不能为空", trigger: "change" }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: "标题不能为空", trigger: "blur" }
|
||||
|
|
@ -288,20 +287,35 @@ export default {
|
|||
this.typeSelectDataList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
//监听多选下拉选择器
|
||||
handelSelectMultiple(position, index) {
|
||||
const ids = this.form.goodsintids || [];
|
||||
if (ids.length > 0) {
|
||||
selectQuoteTypeList(ids).then(response => {
|
||||
this.typeSelectDataList = response.data || [];
|
||||
}).catch(error => {
|
||||
console.error('获取工艺分类失败:', error);
|
||||
this.typeSelectDataList = [];
|
||||
});
|
||||
// 处理服务选择变化
|
||||
handleServiceChange(selectedServices) {
|
||||
// 清空已选择的类型
|
||||
this.form.typeintids = [];
|
||||
|
||||
if (selectedServices && selectedServices.length > 0) {
|
||||
// 调用后端接口获取对应的工艺分类
|
||||
this.getQuoteTypeList(selectedServices);
|
||||
} else {
|
||||
this.typeSelectDataList = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 获取工艺分类列表
|
||||
getQuoteTypeList(serviceIds) {
|
||||
// 使用request方式调用后端接口
|
||||
request.post('/system/QuoteCraft/selectQuoteTypeList', serviceIds).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.typeSelectDataList = response.data || [];
|
||||
} else {
|
||||
this.typeSelectDataList = [];
|
||||
this.$modal.msgError(response.msg || '获取工艺分类失败');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取工艺分类失败:', error);
|
||||
this.typeSelectDataList = [];
|
||||
this.$modal.msgError('获取工艺分类失败');
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
|
|
@ -352,12 +366,7 @@ export default {
|
|||
};
|
||||
// 如果有服务ID,获取对应的类型列表
|
||||
if (this.form.goodsintids && this.form.goodsintids.length > 0) {
|
||||
selectQuoteTypeList(this.form.goodsintids).then(response => {
|
||||
this.typeSelectDataList = response.data || [];
|
||||
}).catch(error => {
|
||||
console.error('获取工艺分类失败:', error);
|
||||
this.typeSelectDataList = [];
|
||||
});
|
||||
this.getQuoteTypeList(this.form.goodsintids);
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.open = true;
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@
|
|||
<div style="padding: 0 20px;">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="服务项目" prop="goodsintids">
|
||||
<el-select v-model="form.goodsintids" multiple filterable placeholder="请选择服务项目" style="width: 100%">
|
||||
<el-select v-model="form.goodsintids" multiple filterable placeholder="请选择服务项目" style="width: 100%" @change="handleServiceChange">
|
||||
<el-option
|
||||
v-for="type in typeDataList"
|
||||
:key="type.id"
|
||||
|
|
@ -187,7 +187,7 @@
|
|||
<el-form-item label="类型" prop="typeintids">
|
||||
<el-select v-model="form.typeintids" multiple filterable placeholder="请选择类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="type in materialTypeList"
|
||||
v-for="type in materialTypeSelectList"
|
||||
:key="type.id"
|
||||
:label="type.title"
|
||||
:value="type.id"
|
||||
|
|
@ -247,6 +247,8 @@
|
|||
import { listQuoteMaterial, getQuoteMaterial, delQuoteMaterial, addQuoteMaterial, updateQuoteMaterial,getConfigData} from "@/api/system/QuoteMaterial"
|
||||
import { getGoodsDataList } from "@/api/system/QuoteType"
|
||||
import { getQuoteMaterialTypeDataList } from "@/api/system/QuoteMaterialType"
|
||||
import request from "@/utils/request"
|
||||
|
||||
export default {
|
||||
name: "QuoteMaterial",
|
||||
dicts: ['iscommissions'],
|
||||
|
|
@ -269,6 +271,7 @@ export default {
|
|||
|
||||
typeDataList: [],
|
||||
materialTypeList: [],
|
||||
materialTypeSelectList: [], // 新增:用于联动选择的物料类型列表
|
||||
// 项目报价--物料信息表格数据
|
||||
QuoteMaterialList: [],
|
||||
// 弹出层标题
|
||||
|
|
@ -311,10 +314,10 @@ export default {
|
|||
// 表单校验
|
||||
rules: {
|
||||
goodsintids: [
|
||||
{ required: true, message: "服务项目不能为空", trigger: "blur" }
|
||||
{ required: true, message: "服务项目不能为空", trigger: "change" }
|
||||
],
|
||||
typeintids: [
|
||||
{ required: true, message: "类型不能为空", trigger: "blur" }
|
||||
{ required: true, message: "类型不能为空", trigger: "change" }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: "标题不能为空", trigger: "blur" }
|
||||
|
|
@ -368,8 +371,38 @@ export default {
|
|||
createdAt: null,
|
||||
updatedAt: null
|
||||
}
|
||||
this.materialTypeSelectList = []; // 清空联动选择的类型列表
|
||||
this.resetForm("form")
|
||||
},
|
||||
// 处理服务项目选择变化
|
||||
handleServiceChange(selectedServices) {
|
||||
// 清空已选择的类型
|
||||
this.form.typeintids = [];
|
||||
|
||||
if (selectedServices && selectedServices.length > 0) {
|
||||
// 调用后端接口获取对应的物料分类
|
||||
this.getMaterialTypeListByServiceIds(selectedServices);
|
||||
} else {
|
||||
this.materialTypeSelectList = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 获取物料分类列表(根据服务项目ID)
|
||||
getMaterialTypeListByServiceIds(serviceIds) {
|
||||
// 使用request方式调用后端接口
|
||||
request.post('/system/QuoteMaterialType/selectQuoteMaterialTypeList', serviceIds).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.materialTypeSelectList = response.data || [];
|
||||
} else {
|
||||
this.materialTypeSelectList = [];
|
||||
this.$modal.msgError(response.msg || '获取物料分类失败');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('获取物料分类失败:', error);
|
||||
this.materialTypeSelectList = [];
|
||||
this.$modal.msgError('获取物料分类失败');
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
|
|
@ -443,6 +476,10 @@ export default {
|
|||
manyimages: Array.isArray(response.data.manyimages) ? response.data.manyimages : (typeof response.data.manyimages === 'string' && response.data.manyimages ? response.data.manyimages.split(',') : []),
|
||||
content: response.data.content || ''
|
||||
}
|
||||
// 如果有服务项目ID,获取对应的物料分类列表
|
||||
if (this.form.goodsintids && this.form.goodsintids.length > 0) {
|
||||
this.getMaterialTypeListByServiceIds(this.form.goodsintids);
|
||||
}
|
||||
// 如果分佣比例为空,设置为 material_commissions
|
||||
if (this.form.commissions === null || this.form.commissions === undefined || this.form.commissions === '') {
|
||||
this.form.commissions = this.material_commissions;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog :title="mode==='add' ? '添加' : '编辑'" :visible.sync="visible" width="600px" append-to-body>
|
||||
<el-dialog :title="mode==='add' ? '添加师傅' : '编辑师傅'" :visible.sync="visible" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="ID" v-if="form.id">
|
||||
<el-input v-model="form.id" disabled />
|
||||
|
|
@ -42,36 +42,81 @@
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item label="服务城市" prop="serviceCityPid">
|
||||
<el-select v-model="form.serviceCityPid" placeholder="请选择服务城市" @change="handleProvinceChange">
|
||||
<el-select
|
||||
v-model="form.serviceCityPid"
|
||||
placeholder="请选择服务城市"
|
||||
filterable
|
||||
@change="handleProvinceChange"
|
||||
multiple
|
||||
collapse-tags
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in selectAreaShenDataList"
|
||||
:key="item.id"
|
||||
:label="item.title"
|
||||
:value="item.id"
|
||||
/>
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="服务地区" prop="serviceCityIds">
|
||||
<el-select v-model="selectedAreas" multiple placeholder="请选择服务地区" :disabled="!form.serviceCityPid">
|
||||
<el-select
|
||||
v-model="selectedAreas"
|
||||
placeholder="请选择服务地区"
|
||||
filterable
|
||||
multiple
|
||||
collapse-tags
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in selectAreaShiDataList"
|
||||
:key="item.id"
|
||||
:label="item.title"
|
||||
:value="item.id"
|
||||
/>
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!-- 显示已选择的地区标签 -->
|
||||
<div class="selected-tags" v-if="selectedAreas.length > 0">
|
||||
<el-tag
|
||||
v-for="areaId in selectedAreas"
|
||||
:key="areaId"
|
||||
closable
|
||||
@close="removeArea(areaId)"
|
||||
style="margin: 2px;">
|
||||
{{ getAreaName(areaId) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="技能" prop="skillIds">
|
||||
<el-select v-model="selectedSkills" multiple placeholder="请选择技能">
|
||||
<el-option
|
||||
v-for="item in skillList"
|
||||
:key="item.id"
|
||||
:label="item.title"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="skill-selection">
|
||||
<el-select
|
||||
v-model="selectedSkills"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请选择技能"
|
||||
style="width: 100%"
|
||||
@change="handleSkillChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in skillList"
|
||||
:key="item.id"
|
||||
:label="item.title"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="selected-tags" v-if="selectedSkills.length > 0">
|
||||
<el-tag
|
||||
v-for="skillId in selectedSkills"
|
||||
:key="skillId"
|
||||
closable
|
||||
@close="removeSkill(skillId)"
|
||||
type="success"
|
||||
style="margin: 2px;"
|
||||
>
|
||||
{{ getSkillName(skillId) }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="当前佣金" prop="commission">
|
||||
|
|
@ -85,6 +130,8 @@
|
|||
v-model="form.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="启用"
|
||||
inactive-text="禁用"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
|
@ -102,6 +149,7 @@
|
|||
<script>
|
||||
import { selectAreaList } from "@/api/system/WorkerApply"
|
||||
import { getSiteSkillList } from "@/api/system/SiteSkill"
|
||||
import { listDiyCity } from "@/api/system/DiyCity"
|
||||
|
||||
export default {
|
||||
name: "UserEditDialog",
|
||||
|
|
@ -147,7 +195,11 @@ export default {
|
|||
selectAreaShiDataList: [],
|
||||
selectedAreas: [],
|
||||
selectedSkills: [],
|
||||
skillList: []
|
||||
skillList: [],
|
||||
// 缓存地区名称
|
||||
areaNameCache: {},
|
||||
// 缓存技能名称
|
||||
skillNameCache: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -169,122 +221,386 @@ export default {
|
|||
this.form.status = parseInt(this.form.status)
|
||||
}
|
||||
|
||||
// 处理已选择的地区
|
||||
if (this.form.serviceCityIds) {
|
||||
console.log('处理服务区域数据:', this.form.serviceCityIds, '类型:', typeof this.form.serviceCityIds);
|
||||
try {
|
||||
if (typeof this.form.serviceCityIds === 'string') {
|
||||
// 处理可能是JSON字符串的情况
|
||||
if (this.form.serviceCityIds.startsWith('[') && this.form.serviceCityIds.endsWith(']')) {
|
||||
this.selectedAreas = JSON.parse(this.form.serviceCityIds).map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedAreas = this.form.serviceCityIds.split(',').map(Number).filter(n => !isNaN(n));
|
||||
}
|
||||
} else if (Array.isArray(this.form.serviceCityIds)) {
|
||||
this.selectedAreas = this.form.serviceCityIds.map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedAreas = [];
|
||||
}
|
||||
console.log('解析后的服务区域:', this.selectedAreas);
|
||||
} catch (error) {
|
||||
console.error('解析服务区域数据失败:', error);
|
||||
this.selectedAreas = [];
|
||||
}
|
||||
} else {
|
||||
this.selectedAreas = [];
|
||||
}
|
||||
|
||||
// 处理已选择的技能
|
||||
if (this.form.skillIds) {
|
||||
console.log('处理技能数据:', this.form.skillIds, '类型:', typeof this.form.skillIds);
|
||||
try {
|
||||
if (typeof this.form.skillIds === 'string') {
|
||||
// 处理可能是JSON字符串的情况
|
||||
if (this.form.skillIds.startsWith('[') && this.form.skillIds.endsWith(']')) {
|
||||
this.selectedSkills = JSON.parse(this.form.skillIds).map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedSkills = this.form.skillIds.split(',').map(Number).filter(n => !isNaN(n));
|
||||
}
|
||||
} else if (Array.isArray(this.form.skillIds)) {
|
||||
this.selectedSkills = this.form.skillIds.map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedSkills = [];
|
||||
}
|
||||
console.log('解析后的技能:', this.selectedSkills);
|
||||
} catch (error) {
|
||||
console.error('解析技能数据失败:', error);
|
||||
this.selectedSkills = [];
|
||||
}
|
||||
} else {
|
||||
this.selectedSkills = [];
|
||||
}
|
||||
|
||||
// 处理禁止接单时长
|
||||
if (this.form.prohibitTimeNum) {
|
||||
this.form.prohibitTimeNum = parseInt(this.form.prohibitTimeNum) || 0
|
||||
}
|
||||
|
||||
// 处理服务城市ID,如果是字符串则转换为数组
|
||||
if (this.form.serviceCityPid) {
|
||||
if (typeof this.form.serviceCityPid === 'string') {
|
||||
this.form.serviceCityPid = this.form.serviceCityPid.split(',').map(Number).filter(n => !isNaN(n))
|
||||
} else if (!Array.isArray(this.form.serviceCityPid)) {
|
||||
this.form.serviceCityPid = [this.form.serviceCityPid]
|
||||
}
|
||||
} else {
|
||||
this.form.serviceCityPid = []
|
||||
}
|
||||
|
||||
// 延迟处理已选择的项目,确保数据加载完成
|
||||
this.$nextTick(() => {
|
||||
this.processSelectedAreas();
|
||||
this.processSelectedSkills();
|
||||
// 清除验证错误
|
||||
if (this.$refs["form"]) {
|
||||
this.$refs["form"].clearValidate();
|
||||
}
|
||||
});
|
||||
|
||||
// 如果有服务城市ID,加载对应的城市数据
|
||||
if (this.form.serviceCityPid) {
|
||||
console.log('UserEditDialog - 用户数据加载完成,加载城市数据,省份ID:', this.form.serviceCityPid);
|
||||
this.handleProvinceChange(); // 调用handleProvinceChange来加载城市数据
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
visible(val) {
|
||||
if (val) {
|
||||
console.log('UserEditDialog - 弹窗打开,开始加载数据');
|
||||
this.getShenDataList()
|
||||
this.getSkillList()
|
||||
if (this.form.serviceCityPid) {
|
||||
this.getShiDataList(this.form.serviceCityPid)
|
||||
}
|
||||
// 延迟加载城市数据,确保省份数据先加载完成
|
||||
this.$nextTick(() => {
|
||||
// 如果有服务城市ID,加载对应的城市数据
|
||||
if (this.form.serviceCityPid && this.form.serviceCityPid.length > 0) {
|
||||
console.log('UserEditDialog - 加载城市数据,省份ID:', this.form.serviceCityPid);
|
||||
this.handleProvinceChange(); // 调用handleProvinceChange来加载城市数据
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
selectedAreas(val) {
|
||||
this.form.serviceCityIds = val.join(',')
|
||||
// 更新地区名称缓存
|
||||
this.updateAreaNameCache();
|
||||
},
|
||||
selectedSkills(val) {
|
||||
this.form.skillIds = val.join(',')
|
||||
// 更新技能名称缓存
|
||||
this.updateSkillNameCache();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 强制更新显示
|
||||
forceUpdateDisplay() {
|
||||
// 强制更新地区显示
|
||||
if (this.selectedAreas.length > 0) {
|
||||
this.updateAreaNameCache();
|
||||
}
|
||||
// 强制更新技能显示
|
||||
if (this.selectedSkills.length > 0) {
|
||||
this.updateSkillNameCache();
|
||||
}
|
||||
},
|
||||
|
||||
// 处理已选择的地区
|
||||
processSelectedAreas() {
|
||||
if (this.form.serviceCityIds) {
|
||||
console.log('处理服务区域数据:', this.form.serviceCityIds, '类型:', typeof this.form.serviceCityIds);
|
||||
try {
|
||||
if (typeof this.form.serviceCityIds === 'string') {
|
||||
// 处理可能是JSON字符串的情况
|
||||
if (this.form.serviceCityIds.startsWith('[') && this.form.serviceCityIds.endsWith(']')) {
|
||||
this.selectedAreas = JSON.parse(this.form.serviceCityIds).map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedAreas = this.form.serviceCityIds.split(',').map(Number).filter(n => !isNaN(n));
|
||||
}
|
||||
} else if (Array.isArray(this.form.serviceCityIds)) {
|
||||
this.selectedAreas = this.form.serviceCityIds.map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedAreas = [];
|
||||
}
|
||||
console.log('解析后的服务区域:', this.selectedAreas);
|
||||
|
||||
// 如果有已选择的地区,但地区列表为空,需要等待地区数据加载完成
|
||||
if (this.selectedAreas.length > 0 && this.selectAreaShiDataList.length === 0) {
|
||||
console.log('UserEditDialog - 有已选择的地区但地区列表为空,等待数据加载');
|
||||
// 延迟处理,等待地区数据加载完成
|
||||
setTimeout(() => {
|
||||
this.processSelectedAreas();
|
||||
}, 500);
|
||||
return;
|
||||
}
|
||||
|
||||
// 强制更新显示
|
||||
this.$nextTick(() => {
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('解析服务区域数据失败:', error);
|
||||
this.selectedAreas = [];
|
||||
}
|
||||
} else {
|
||||
this.selectedAreas = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 处理已选择的技能
|
||||
processSelectedSkills() {
|
||||
if (this.form.skillIds) {
|
||||
console.log('处理技能数据:', this.form.skillIds, '类型:', typeof this.form.skillIds);
|
||||
try {
|
||||
if (typeof this.form.skillIds === 'string') {
|
||||
// 处理可能是JSON字符串的情况
|
||||
if (this.form.skillIds.startsWith('[') && this.form.skillIds.endsWith(']')) {
|
||||
this.selectedSkills = JSON.parse(this.form.skillIds).map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedSkills = this.form.skillIds.split(',').map(Number).filter(n => !isNaN(n));
|
||||
}
|
||||
} else if (Array.isArray(this.form.skillIds)) {
|
||||
this.selectedSkills = this.form.skillIds.map(Number).filter(n => !isNaN(n));
|
||||
} else {
|
||||
this.selectedSkills = [];
|
||||
}
|
||||
console.log('解析后的技能:', this.selectedSkills);
|
||||
// 强制更新显示
|
||||
this.$nextTick(() => {
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('解析技能数据失败:', error);
|
||||
this.selectedSkills = [];
|
||||
}
|
||||
} else {
|
||||
this.selectedSkills = [];
|
||||
}
|
||||
},
|
||||
|
||||
// 更新地区名称缓存
|
||||
updateAreaNameCache() {
|
||||
console.log('UserEditDialog - 更新地区名称缓存,已选择地区:', this.selectedAreas, '地区列表:', this.selectAreaShiDataList);
|
||||
this.areaNameCache = {};
|
||||
this.selectedAreas.forEach(areaId => {
|
||||
const area = this.selectAreaShiDataList.find(item => item.id === areaId);
|
||||
if (area) {
|
||||
this.areaNameCache[areaId] = area.title;
|
||||
} else {
|
||||
console.warn('UserEditDialog - 未找到地区ID:', areaId, '对应的名称');
|
||||
}
|
||||
});
|
||||
console.log('UserEditDialog - 地区名称缓存:', this.areaNameCache);
|
||||
},
|
||||
|
||||
// 更新技能名称缓存
|
||||
updateSkillNameCache() {
|
||||
this.selectedSkills.forEach(skillId => {
|
||||
if (!this.skillNameCache[skillId]) {
|
||||
const skill = this.skillList.find(item => item.id == skillId);
|
||||
if (skill) {
|
||||
this.skillNameCache[skillId] = skill.title;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取地区名称
|
||||
getAreaName(areaId) {
|
||||
if (this.areaNameCache[areaId]) {
|
||||
return this.areaNameCache[areaId];
|
||||
}
|
||||
const area = this.selectAreaShiDataList.find(item => item.id == areaId);
|
||||
if (area) {
|
||||
this.areaNameCache[areaId] = area.title;
|
||||
return area.title;
|
||||
}
|
||||
return areaId;
|
||||
},
|
||||
|
||||
// 获取技能名称
|
||||
getSkillName(skillId) {
|
||||
if (this.skillNameCache[skillId]) {
|
||||
return this.skillNameCache[skillId];
|
||||
}
|
||||
const skill = this.skillList.find(item => item.id == skillId);
|
||||
if (skill) {
|
||||
this.skillNameCache[skillId] = skill.title;
|
||||
return skill.title;
|
||||
}
|
||||
return skillId;
|
||||
},
|
||||
|
||||
// 移除地区
|
||||
removeArea(areaId) {
|
||||
const index = this.selectedAreas.indexOf(areaId);
|
||||
if (index > -1) {
|
||||
this.selectedAreas.splice(index, 1);
|
||||
}
|
||||
},
|
||||
|
||||
// 移除技能
|
||||
removeSkill(skillId) {
|
||||
const index = this.selectedSkills.indexOf(skillId);
|
||||
if (index > -1) {
|
||||
this.selectedSkills.splice(index, 1);
|
||||
}
|
||||
},
|
||||
|
||||
// 地区选择变化
|
||||
handleAreaChange() {
|
||||
this.updateAreaNameCache();
|
||||
},
|
||||
|
||||
// 技能选择变化
|
||||
handleSkillChange() {
|
||||
this.updateSkillNameCache();
|
||||
},
|
||||
|
||||
getShenDataList() {
|
||||
console.log('UserEditDialog - 开始获取省份数据');
|
||||
selectAreaList("100000").then(response => {
|
||||
// 使用DiyCityService获取一级城市(省份)
|
||||
const queryParams = {
|
||||
parentId: 0 // 查询parent_id=0的一级城市
|
||||
}
|
||||
listDiyCity(queryParams).then(response => {
|
||||
console.log('UserEditDialog - 获取省份数据成功:', response);
|
||||
this.selectAreaShenDataList = response.data || []
|
||||
console.log('UserEditDialog - 省份列表:', this.selectAreaShenDataList);
|
||||
if (response.code === 200) {
|
||||
this.selectAreaShenDataList = response.rows || []
|
||||
console.log('UserEditDialog - 省份列表:', this.selectAreaShenDataList);
|
||||
} else {
|
||||
console.warn('UserEditDialog - 获取省份数据失败,使用默认数据');
|
||||
// 如果接口失败,使用默认数据
|
||||
this.selectAreaShenDataList = [
|
||||
{ id: 1, title: '陕西省' },
|
||||
{ id: 27, title: '上海市' },
|
||||
{ id: 44, title: '湖南省' },
|
||||
{ id: 52, title: '安徽省' }
|
||||
]
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('UserEditDialog - 获取省份数据失败:', error);
|
||||
console.error('UserEditDialog - 获取省份数据异常:', error);
|
||||
// 如果接口失败,使用默认数据
|
||||
this.selectAreaShenDataList = [
|
||||
{ id: "610100", title: "西安市" },
|
||||
{ id: "610200", title: "铜川市" },
|
||||
{ id: "610300", title: "宝鸡市" }
|
||||
{ id: 1, title: '陕西省' },
|
||||
{ id: 27, title: '上海市' },
|
||||
{ id: 44, title: '湖南省' },
|
||||
{ id: 52, title: '安徽省' }
|
||||
]
|
||||
console.log('UserEditDialog - 使用默认省份数据:', this.selectAreaShenDataList);
|
||||
})
|
||||
},
|
||||
getShiDataList(id) {
|
||||
console.log('UserEditDialog - 开始获取城市数据,省份ID:', id);
|
||||
selectAreaList(id).then(response => {
|
||||
// 使用DiyCityService获取指定省份下的城市
|
||||
const queryParams = {
|
||||
parentId: id // 查询指定parent_id的城市
|
||||
}
|
||||
listDiyCity(queryParams).then(response => {
|
||||
console.log('UserEditDialog - 获取城市数据成功:', response);
|
||||
this.selectAreaShiDataList = response.data || []
|
||||
console.log('UserEditDialog - 城市列表:', this.selectAreaShiDataList);
|
||||
if (response.code === 200) {
|
||||
const newAreas = response.rows || []
|
||||
console.log('UserEditDialog - 城市列表:', newAreas);
|
||||
|
||||
// 合并到现有列表中,避免重复
|
||||
newAreas.forEach(area => {
|
||||
const exists = this.selectAreaShiDataList.find(item => item.id === area.id)
|
||||
if (!exists) {
|
||||
this.selectAreaShiDataList.push(area)
|
||||
}
|
||||
})
|
||||
|
||||
console.log('UserEditDialog - 合并后的地区列表:', this.selectAreaShiDataList);
|
||||
|
||||
// 更新地区名称缓存
|
||||
this.updateAreaNameCache();
|
||||
// 重新处理已选择的地区,确保显示正确的名称
|
||||
this.$nextTick(() => {
|
||||
this.processSelectedAreas();
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
} else {
|
||||
console.warn('UserEditDialog - 获取城市数据失败,使用默认数据');
|
||||
// 如果接口失败,使用默认数据
|
||||
let defaultAreas = []
|
||||
if (id === 1) {
|
||||
defaultAreas = [
|
||||
{ id: 2, title: '新城区' },
|
||||
{ id: 5, title: '碑林区' },
|
||||
{ id: 7, title: '莲湖区' },
|
||||
{ id: 10, title: '灞桥区' },
|
||||
{ id: 11, title: '未央区' },
|
||||
{ id: 12, title: '雁塔区' },
|
||||
{ id: 13, title: '阎良区' },
|
||||
{ id: 14, title: '临潼区' },
|
||||
{ id: 15, title: '长安区' },
|
||||
{ id: 16, title: '高陵区' },
|
||||
{ id: 17, title: '鄠邑区' }
|
||||
]
|
||||
} else if (id === 52) {
|
||||
defaultAreas = [
|
||||
{ id: 53, title: '瑶海区' },
|
||||
{ id: 54, title: '庐阳区' },
|
||||
{ id: 55, title: '蜀山区' },
|
||||
{ id: 56, title: '包河区' },
|
||||
{ id: 57, title: '经开区' },
|
||||
{ id: 58, title: '高新区' }
|
||||
]
|
||||
}
|
||||
|
||||
// 合并到现有列表中,避免重复
|
||||
defaultAreas.forEach(area => {
|
||||
const exists = this.selectAreaShiDataList.find(item => item.id === area.id)
|
||||
if (!exists) {
|
||||
this.selectAreaShiDataList.push(area)
|
||||
}
|
||||
})
|
||||
|
||||
console.log('UserEditDialog - 使用默认数据后的地区列表:', this.selectAreaShiDataList);
|
||||
|
||||
// 更新地区名称缓存
|
||||
this.updateAreaNameCache();
|
||||
// 重新处理已选择的地区
|
||||
this.$nextTick(() => {
|
||||
this.processSelectedAreas();
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('UserEditDialog - 获取城市数据失败:', error);
|
||||
// 如果接口失败,使用默认数据
|
||||
if (id === "610100") {
|
||||
this.selectAreaShiDataList = [
|
||||
{ id: "610102", title: "新城区" },
|
||||
{ id: "610103", title: "碑林区" },
|
||||
{ id: "610104", title: "莲湖区" },
|
||||
{ id: "610111", title: "灞桥区" },
|
||||
{ id: "610112", title: "未央区" },
|
||||
{ id: "610113", title: "雁塔区" },
|
||||
{ id: "610114", title: "阎良区" },
|
||||
{ id: "610115", title: "临潼区" },
|
||||
{ id: "610116", title: "长安区" },
|
||||
{ id: "610117", title: "高陵区" }
|
||||
let defaultAreas = []
|
||||
if (id === 1) {
|
||||
defaultAreas = [
|
||||
{ id: 2, title: '新城区' },
|
||||
{ id: 5, title: '碑林区' },
|
||||
{ id: 7, title: '莲湖区' },
|
||||
{ id: 10, title: '灞桥区' },
|
||||
{ id: 11, title: '未央区' },
|
||||
{ id: 12, title: '雁塔区' },
|
||||
{ id: 13, title: '阎良区' },
|
||||
{ id: 14, title: '临潼区' },
|
||||
{ id: 15, title: '长安区' },
|
||||
{ id: 16, title: '高陵区' },
|
||||
{ id: 17, title: '鄠邑区' }
|
||||
]
|
||||
} else if (id === 52) {
|
||||
defaultAreas = [
|
||||
{ id: 53, title: '瑶海区' },
|
||||
{ id: 54, title: '庐阳区' },
|
||||
{ id: 55, title: '蜀山区' },
|
||||
{ id: 56, title: '包河区' },
|
||||
{ id: 57, title: '经开区' },
|
||||
{ id: 58, title: '高新区' }
|
||||
]
|
||||
console.log('UserEditDialog - 使用默认城市数据:', this.selectAreaShiDataList);
|
||||
}
|
||||
|
||||
// 合并到现有列表中,避免重复
|
||||
defaultAreas.forEach(area => {
|
||||
const exists = this.selectAreaShiDataList.find(item => item.id === area.id)
|
||||
if (!exists) {
|
||||
this.selectAreaShiDataList.push(area)
|
||||
}
|
||||
})
|
||||
|
||||
console.log('UserEditDialog - 异常处理后的地区列表:', this.selectAreaShiDataList);
|
||||
|
||||
// 更新地区名称缓存
|
||||
this.updateAreaNameCache();
|
||||
// 重新处理已选择的地区
|
||||
this.$nextTick(() => {
|
||||
this.processSelectedAreas();
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
})
|
||||
},
|
||||
getSkillList() {
|
||||
|
|
@ -294,6 +610,13 @@ export default {
|
|||
if (response.code === 200) {
|
||||
this.skillList = response.data || []
|
||||
console.log('UserEditDialog - 技能列表:', this.skillList);
|
||||
// 更新技能名称缓存
|
||||
this.updateSkillNameCache();
|
||||
// 重新处理已选择的技能,确保显示正确的名称
|
||||
this.$nextTick(() => {
|
||||
this.processSelectedSkills();
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
} else {
|
||||
console.warn('UserEditDialog - 获取技能列表失败,使用默认数据');
|
||||
// 如果接口失败,使用默认数据
|
||||
|
|
@ -303,6 +626,13 @@ export default {
|
|||
{ id: 3, title: '改造维修' },
|
||||
{ id: 4, title: '工程施工' }
|
||||
]
|
||||
// 更新技能名称缓存
|
||||
this.updateSkillNameCache();
|
||||
// 重新处理已选择的技能
|
||||
this.$nextTick(() => {
|
||||
this.processSelectedSkills();
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('UserEditDialog - 获取技能列表异常:', error);
|
||||
|
|
@ -313,13 +643,34 @@ export default {
|
|||
{ id: 3, title: '改造维修' },
|
||||
{ id: 4, title: '工程施工' }
|
||||
]
|
||||
// 更新技能名称缓存
|
||||
this.updateSkillNameCache();
|
||||
// 重新处理已选择的技能
|
||||
this.$nextTick(() => {
|
||||
this.processSelectedSkills();
|
||||
this.forceUpdateDisplay();
|
||||
});
|
||||
})
|
||||
},
|
||||
handleProvinceChange() {
|
||||
if (this.form.serviceCityPid) {
|
||||
this.getShiDataList(this.form.serviceCityPid)
|
||||
this.selectedAreas = []
|
||||
this.form.serviceCityIds = ''
|
||||
console.log('UserEditDialog - 服务城市变化:', this.form.serviceCityPid);
|
||||
|
||||
// 清空已选择的地区
|
||||
this.selectedAreas = []
|
||||
this.form.serviceCityIds = ''
|
||||
this.areaNameCache = {} // 清空地区名称缓存
|
||||
this.selectAreaShiDataList = [] // 清空地区列表
|
||||
|
||||
// 如果有选择的服务城市,加载对应的城市数据
|
||||
if (this.form.serviceCityPid && this.form.serviceCityPid.length > 0) {
|
||||
console.log('UserEditDialog - 开始加载多个城市的数据');
|
||||
// 为每个选中的城市加载地区数据
|
||||
this.form.serviceCityPid.forEach(cityId => {
|
||||
this.getShiDataList(cityId)
|
||||
})
|
||||
} else {
|
||||
console.log('UserEditDialog - 没有选择服务城市');
|
||||
this.selectAreaShiDataList = []
|
||||
}
|
||||
},
|
||||
decreaseTime() {
|
||||
|
|
@ -376,9 +727,13 @@ export default {
|
|||
...this.form,
|
||||
type: '2', // 师傅类型
|
||||
status: this.form.status || 0,
|
||||
prohibitTimeNum: this.form.prohibitTimeNum || 0
|
||||
prohibitTimeNum: this.form.prohibitTimeNum || 0,
|
||||
// 处理服务城市ID,如果是数组则转换为字符串
|
||||
serviceCityPid: Array.isArray(this.form.serviceCityPid) ? this.form.serviceCityPid.join(',') : this.form.serviceCityPid
|
||||
}
|
||||
this.$emit('confirm', submitData)
|
||||
} else {
|
||||
console.log('表单验证失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
|
|
@ -389,6 +744,8 @@ export default {
|
|||
this.$refs["form"].resetFields()
|
||||
this.selectedAreas = []
|
||||
this.selectedSkills = []
|
||||
this.areaNameCache = {}
|
||||
this.skillNameCache = {}
|
||||
this.form = {
|
||||
id: id,
|
||||
name: undefined,
|
||||
|
|
@ -403,6 +760,12 @@ export default {
|
|||
status: 1,
|
||||
createdAt: createdAt
|
||||
}
|
||||
// 清除验证错误
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs["form"]) {
|
||||
this.$refs["form"].clearValidate();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -427,6 +790,24 @@ export default {
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
.area-selection,
|
||||
.skill-selection {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.selected-tags {
|
||||
margin-top: 8px;
|
||||
padding: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border-radius: 4px;
|
||||
background-color: #fafafa;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
.selected-tags .el-tag {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -442,4 +823,15 @@ export default {
|
|||
::v-deep .el-input-group__prepend {
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
::v-deep .el-select .el-input__inner {
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
::v-deep .el-tag {
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -396,12 +396,15 @@ export default {
|
|||
this.getlevelList();
|
||||
this.initAreaDataCache();
|
||||
this.initSkillDataCache();
|
||||
|
||||
},
|
||||
mounted() {
|
||||
// 确保在组件挂载后重新获取数据,以便格式化方法能正常工作
|
||||
this.$nextTick(() => {
|
||||
this.getList();
|
||||
// 等待缓存初始化完成后再重新获取列表
|
||||
setTimeout(() => {
|
||||
console.log('UsersWorker - 缓存初始化完成,重新获取列表数据');
|
||||
this.getList();
|
||||
}, 1000);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -748,6 +751,31 @@ export default {
|
|||
this.areaDataCache[province.id] = province;
|
||||
console.log(`添加默认省份到缓存: ${province.id} -> ${province.title}`);
|
||||
});
|
||||
|
||||
// 添加一些常见的地区ID到缓存,以防数据不完整
|
||||
const commonAreas = [
|
||||
{ id: "1", title: "北京市" },
|
||||
{ id: "2", title: "上海市" },
|
||||
{ id: "3", title: "广州市" },
|
||||
{ id: "4", title: "深圳市" },
|
||||
{ id: "5", title: "杭州市" },
|
||||
{ id: "6", title: "南京市" },
|
||||
{ id: "7", title: "武汉市" },
|
||||
{ id: "8", title: "成都市" },
|
||||
{ id: "9", title: "西安市" },
|
||||
{ id: "10", title: "重庆市" },
|
||||
{ id: "11", title: "天津市" },
|
||||
{ id: "12", title: "苏州市" },
|
||||
{ id: "13", title: "无锡市" },
|
||||
{ id: "14", title: "宁波市" },
|
||||
{ id: "15", title: "青岛市" },
|
||||
{ id: "16", title: "大连市" },
|
||||
{ id: "17", title: "厦门市" }
|
||||
];
|
||||
commonAreas.forEach(area => {
|
||||
this.areaDataCache[area.id] = area;
|
||||
console.log(`添加常见地区到缓存: ${area.id} -> ${area.title}`);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 初始化技能数据缓存
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ const CompressionPlugin = require('compression-webpack-plugin')
|
|||
|
||||
const name = process.env.VUE_APP_TITLE || '西安华府人家装饰工程有限公司' // 网页标题
|
||||
|
||||
const baseUrl = 'http://localhost:8999' // 后端接口
|
||||
const baseUrl = 'http://localhost:8999' // 后端接口
|
||||
// const baseUrl = 'http://120.46.95.81:8999' // 后端接口
|
||||
|
||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue