1
This commit is contained in:
@@ -1,24 +1,26 @@
|
||||
package com.ruoyi.web.controller.jarvis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.jarvis.domain.OrderRows;
|
||||
import com.ruoyi.jarvis.service.IOrderRowsService;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.jarvis.domain.OrderRows;
|
||||
import com.ruoyi.jarvis.service.IOrderRowsService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.ruoyi.jarvis.enums.ValidCodeConverter;
|
||||
|
||||
/**
|
||||
* 京粉订单Controller
|
||||
@@ -35,7 +37,6 @@ public class OrderRowsController extends BaseController
|
||||
/**
|
||||
* 查询京粉订单列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(OrderRows orderRows)
|
||||
{
|
||||
@@ -47,7 +48,6 @@ public class OrderRowsController extends BaseController
|
||||
/**
|
||||
* 导出京粉订单列表
|
||||
*/
|
||||
|
||||
@Log(title = "京粉订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, OrderRows orderRows)
|
||||
@@ -60,12 +60,48 @@ public class OrderRowsController extends BaseController
|
||||
/**
|
||||
* 获取京粉订单详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(orderRowsService.selectOrderRowsById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增京粉订单
|
||||
*/
|
||||
@Log(title = "京粉订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody OrderRows orderRows)
|
||||
{
|
||||
return toAjax(orderRowsService.insertOrderRows(orderRows));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改京粉订单
|
||||
*/
|
||||
@Log(title = "京粉订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody OrderRows orderRows)
|
||||
{
|
||||
return toAjax(orderRowsService.updateOrderRows(orderRows));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除京粉订单
|
||||
*/
|
||||
@Log(title = "京粉订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(orderRowsService.deleteOrderRowsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单有效性下拉选项
|
||||
*/
|
||||
@GetMapping("/select/validCode")
|
||||
public AjaxResult getValidCodeOptions() {
|
||||
List<Map<String, Object>> options = ValidCodeConverter.getAllValidCodeOptions();
|
||||
return AjaxResult.success(options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ruoyi.jarvis.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Leo
|
||||
* @create 2024/11/9 下午3:08
|
||||
* @description:
|
||||
*/
|
||||
public class ValidCodeConverter {
|
||||
private static final Map<Integer, String> codeDescriptions = new HashMap<>();
|
||||
|
||||
static {
|
||||
codeDescriptions.put(-100, "无变化");
|
||||
codeDescriptions.put(-1, "未知");
|
||||
codeDescriptions.put(2, "无效-拆单");
|
||||
codeDescriptions.put(3, "无效-取消");
|
||||
codeDescriptions.put(4, "无效-京东帮帮主订单");
|
||||
codeDescriptions.put(5, "无效-账号异常");
|
||||
codeDescriptions.put(6, "无效-赠品类目不返佣");
|
||||
codeDescriptions.put(7, "无效-校园订单");
|
||||
codeDescriptions.put(8, "无效-企业订单");
|
||||
codeDescriptions.put(9, "无效-团购订单");
|
||||
codeDescriptions.put(11, "无效-乡村推广员下单");
|
||||
codeDescriptions.put(13, "违规订单-其他");
|
||||
codeDescriptions.put(14, "无效-来源与备案网址不符");
|
||||
codeDescriptions.put(15, "待付款");
|
||||
codeDescriptions.put(16, "已付款");
|
||||
codeDescriptions.put(17, "已完成(购买用户确认收货)");
|
||||
codeDescriptions.put(19, "无效-佣金比例为0");
|
||||
codeDescriptions.put(20, "无效-此复购订单对应的首购订单无效");
|
||||
codeDescriptions.put(21, "无效-云店订单");
|
||||
codeDescriptions.put(22, "无效-PLUS会员佣金比例为0");
|
||||
codeDescriptions.put(23, "无效-支付有礼");
|
||||
codeDescriptions.put(24, "已付定金");
|
||||
codeDescriptions.put(25, "违规订单-流量劫持");
|
||||
codeDescriptions.put(26, "违规订单-流量异常");
|
||||
codeDescriptions.put(27, "违规订单-违反京东平台规则");
|
||||
codeDescriptions.put(28, "违规订单-多笔交易异常");
|
||||
codeDescriptions.put(29, "无效-跨屏跨店");
|
||||
codeDescriptions.put(30, "无效-累计件数超出类目上限");
|
||||
codeDescriptions.put(31, "无效-黑名单sku");
|
||||
codeDescriptions.put(33, "超市卡充值订单");
|
||||
codeDescriptions.put(34, "无效-推卡订单无效");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取有效码所对应的描述
|
||||
*
|
||||
* @param code 有效码
|
||||
* @return 对应的描述信息
|
||||
*/
|
||||
public String getCodeDescription(Integer code) {
|
||||
return codeDescriptions.getOrDefault(code, "代码描述未定义");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有有效码选项
|
||||
*
|
||||
* @return 有效码选项列表
|
||||
*/
|
||||
public static List<Map<String, Object>> getAllValidCodeOptions() {
|
||||
List<Map<String, Object>> options = new ArrayList<>();
|
||||
for (Map.Entry<Integer, String> entry : codeDescriptions.entrySet()) {
|
||||
Map<String, Object> option = new HashMap<>();
|
||||
option.put("label", entry.getValue());
|
||||
option.put("value", entry.getKey());
|
||||
options.add(option);
|
||||
}
|
||||
return options;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user