1
This commit is contained in:
@@ -0,0 +1,102 @@
|
|||||||
|
package com.ruoyi.web.controller.system;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
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.JDOrder;
|
||||||
|
import com.ruoyi.jarvis.service.IJDOrderService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JD订单列表Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/jdorder")
|
||||||
|
public class JDOrderListController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IJDOrderService jdOrderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询JD订单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(JDOrder jdOrder)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<JDOrder> list = jdOrderService.selectJDOrderList(jdOrder);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出JD订单列表
|
||||||
|
*/
|
||||||
|
@Log(title = "JD订单", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, JDOrder jdOrder) throws IOException
|
||||||
|
{
|
||||||
|
String fileName = "JD订单数据";
|
||||||
|
|
||||||
|
List<JDOrder> list = jdOrderService.selectJDOrderList(jdOrder);
|
||||||
|
|
||||||
|
// 设置响应头,指定文件名
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
String encodedFileName = java.net.URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||||
|
response.setHeader("Content-Disposition", "attachment; filename=" + encodedFileName);
|
||||||
|
// 添加download-filename响应头,以支持前端工具类
|
||||||
|
response.setHeader("download-filename", encodedFileName);
|
||||||
|
|
||||||
|
ExcelUtil<JDOrder> util = new ExcelUtil<JDOrder>(JDOrder.class);
|
||||||
|
util.exportExcel(response, list, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取JD订单详细信息
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(jdOrderService.selectJDOrderById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增JD订单
|
||||||
|
*/
|
||||||
|
@Log(title = "JD订单", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody JDOrder jdOrder)
|
||||||
|
{
|
||||||
|
return toAjax(jdOrderService.insertJDOrder(jdOrder));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改JD订单
|
||||||
|
*/
|
||||||
|
@Log(title = "JD订单", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody JDOrder jdOrder)
|
||||||
|
{
|
||||||
|
return toAjax(jdOrderService.updateJDOrder(jdOrder));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除JD订单
|
||||||
|
*/
|
||||||
|
@Log(title = "JD订单", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(jdOrderService.deleteJDOrderByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.jarvis.domain;
|
package com.ruoyi.jarvis.domain;
|
||||||
|
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.data.annotation.Transient;
|
import org.springframework.data.annotation.Transient;
|
||||||
|
|
||||||
@@ -13,47 +15,63 @@ import java.util.Date;
|
|||||||
public class JDOrder extends BaseEntity {
|
public class JDOrder extends BaseEntity {
|
||||||
|
|
||||||
/** 主键ID */
|
/** 主键ID */
|
||||||
|
@Excel(name = "ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 单据备注(如日期编号) */
|
/** 单据备注(如日期编号) */
|
||||||
|
@Excel(name = "内部单号")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/** 分销标记 */
|
/** 分销标记 */
|
||||||
|
@Excel(name = "分销标记")
|
||||||
private String distributionMark;
|
private String distributionMark;
|
||||||
|
|
||||||
/** 型号 */
|
/** 型号 */
|
||||||
|
@Excel(name = "型号")
|
||||||
private String modelNumber;
|
private String modelNumber;
|
||||||
|
|
||||||
/** 链接 */
|
/** 链接 */
|
||||||
|
@Excel(name = "链接")
|
||||||
private String link;
|
private String link;
|
||||||
|
|
||||||
/** 下单付款金额 */
|
/** 下单付款金额 */
|
||||||
|
@Excel(name = "付款金额")
|
||||||
private Double paymentAmount;
|
private Double paymentAmount;
|
||||||
|
|
||||||
/** 后返金额 */
|
/** 后返金额 */
|
||||||
|
@Excel(name = "后返金额")
|
||||||
private Double rebateAmount;
|
private Double rebateAmount;
|
||||||
|
|
||||||
/** 地址 */
|
/** 地址 */
|
||||||
|
@Excel(name = "地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
/** 物流链接 */
|
/** 物流链接 */
|
||||||
|
@Excel(name = "物流链接")
|
||||||
private String logisticsLink;
|
private String logisticsLink;
|
||||||
|
|
||||||
/** 订单号 */
|
/** 订单号 */
|
||||||
|
@Excel(name = "订单号", cellType = ColumnType.STRING)
|
||||||
private String orderId;
|
private String orderId;
|
||||||
|
|
||||||
/** 下单人 */
|
/** 下单人 */
|
||||||
|
@Excel(name = "下单人")
|
||||||
private String buyer;
|
private String buyer;
|
||||||
|
|
||||||
/** 下单时间 */
|
/** 下单时间 */
|
||||||
|
@Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date orderTime;
|
private Date orderTime;
|
||||||
|
|
||||||
/** 备注(状态) */
|
/** 备注(状态) */
|
||||||
|
@Excel(name = "备注/状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
|
@Excel(name = "赔付金额")
|
||||||
private Double proPriceAmount;
|
private Double proPriceAmount;
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
|
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date finishTime;
|
private Date finishTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user