parent
b0fd97fe6d
commit
1d86ef3d03
@ -0,0 +1,107 @@
|
||||
package com.ruoyi.web.controller.mall;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.redis.RedisService;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.mall.domain.Aftersale;
|
||||
import com.ruoyi.mall.domain.form.DealWithAftersaleForm;
|
||||
import com.ruoyi.mall.domain.form.ManagerAftersaleOrderForm;
|
||||
import com.ruoyi.mall.domain.vo.ManagerRefundOrderDetailVO;
|
||||
import com.ruoyi.mall.domain.vo.ManagerRefundOrderVO;
|
||||
import com.ruoyi.mall.domain.vo.OrderOperateHistoryVO;
|
||||
import com.ruoyi.mall.service.AftersaleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单售后Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-12-29
|
||||
*/
|
||||
@Api(description ="订单售后接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/oms/aftersale")
|
||||
@Slf4j
|
||||
public class AftersaleController extends BaseController {
|
||||
@Autowired
|
||||
private AftersaleService service;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@ApiOperation("查询订单售后列表")
|
||||
@PreAuthorize("@ss.hasPermi('oms:aftersale:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<ManagerRefundOrderVO>> list(@RequestBody ManagerAftersaleOrderForm query, Pageable page) {
|
||||
List<ManagerRefundOrderVO> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
// @ApiOperation("导出订单售后列表")
|
||||
// @PreAuthorize("@ss.hasPermi('oms:aftersale:export')")
|
||||
// @Log(title = "订单售后", businessType = BusinessType.EXPORT)
|
||||
// @GetMapping("/export")
|
||||
// public ResponseEntity<String> export(AftersaleQuery query) {
|
||||
// List<Aftersale> list = service.selectList(query, null);
|
||||
// ExcelUtil<AftersaleVO> util = new ExcelUtil<>(AftersaleVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "订单售后数据"));
|
||||
// return null;
|
||||
// }
|
||||
|
||||
@ApiOperation("获取订单售后详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('oms:aftersale:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<ManagerRefundOrderDetailVO> getInfo(@PathVariable("id") Long orderId) {
|
||||
return ResponseEntity.ok(service.selectById(orderId));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("修改订单售后")
|
||||
@PreAuthorize("@ss.hasPermi('oms:aftersale:edit')")
|
||||
@Log(title = "订单售后", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody Aftersale aftersale) {
|
||||
return ResponseEntity.ok(service.update(aftersale));
|
||||
}
|
||||
|
||||
@ApiOperation("售后订单操作")
|
||||
@PostMapping("/dealWith")
|
||||
public ResponseEntity<Boolean> updateStatus(@RequestBody DealWithAftersaleForm request){
|
||||
LoginUser user = SecurityUtils.getLoginUser();
|
||||
String redisKey = "manager_oms_order_updateOrderStatus_" + user.getUserId();
|
||||
String redisValue = user.getUserId() + "_" + System.currentTimeMillis();
|
||||
try {
|
||||
redisService.lock(redisKey, redisValue, 60);
|
||||
service.dealWith(request, user.getUserId(), user.getUser().getNickName());
|
||||
return ResponseEntity.ok(true);
|
||||
} catch (Exception e) {
|
||||
log.error("售后订单操作发生异常", e);
|
||||
throw new RuntimeException(e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
redisService.unLock(redisKey, redisValue);
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查看日志")
|
||||
@GetMapping("/log/{orderId}")
|
||||
public ResponseEntity<List<OrderOperateHistoryVO>> log(@PathVariable Long orderId){
|
||||
return ResponseEntity.ok(service.log(orderId));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.ruoyi.web.controller.mall;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.mall.domain.Express;
|
||||
import com.ruoyi.mall.service.ExpressService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递管理Controller
|
||||
*/
|
||||
@Api(description ="快递管理接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/pms/express")
|
||||
public class ExpressController extends BaseController {
|
||||
@Autowired
|
||||
private ExpressService service;
|
||||
|
||||
@ApiOperation("查询快递管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<Express>> list(@RequestBody Express query, Pageable page) {
|
||||
List<Express> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
@ApiOperation("所有快递管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:list')")
|
||||
@PostMapping("/all")
|
||||
public ResponseEntity<List<Express>> all(@RequestBody Express query) {
|
||||
return ResponseEntity.ok(service.selectList(query, null));
|
||||
}
|
||||
|
||||
@ApiOperation("导出快递管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:export')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(Express query) {
|
||||
// List<Express> list = service.selectList(query, null);
|
||||
// ExcelUtil<ExpressVO> util = new ExcelUtil<>(ExpressVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "快递管理数据"));
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation("获取快递管理详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<Express> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增快递管理")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:add')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody Express Express) {
|
||||
return ResponseEntity.ok(service.insert(Express));
|
||||
}
|
||||
|
||||
@ApiOperation("修改快递管理")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:edit')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody Express Express) {
|
||||
return ResponseEntity.ok(service.update(Express));
|
||||
}
|
||||
|
||||
@ApiOperation("删除快递管理")
|
||||
@PreAuthorize("@ss.hasPermi('pms:Express:remove')")
|
||||
@Log(title = "快递管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,141 @@
|
||||
package com.ruoyi.web.controller.mall;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.redis.RedisService;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.mall.domain.Order;
|
||||
import com.ruoyi.mall.domain.query.DeliverProductForm;
|
||||
import com.ruoyi.mall.domain.query.ManagerOrderQueryForm;
|
||||
import com.ruoyi.mall.domain.vo.ManagerOrderDetailVO;
|
||||
import com.ruoyi.mall.domain.vo.ManagerOrderVO;
|
||||
import com.ruoyi.mall.domain.vo.OrderOperateHistoryVO;
|
||||
import com.ruoyi.mall.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单表Controller
|
||||
*
|
||||
* @author
|
||||
* @date 2022-12-01
|
||||
*/
|
||||
@Api(description ="订单表接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/oms/order")
|
||||
@Slf4j
|
||||
public class OrderController extends BaseController {
|
||||
@Autowired
|
||||
private OrderService service;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@ApiOperation("查询订单表列表")
|
||||
@PreAuthorize("@ss.hasPermi('oms:order:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<ManagerOrderVO>> list(@RequestBody ManagerOrderQueryForm query, Pageable page) {
|
||||
return ResponseEntity.ok(service.selectList(query, page));
|
||||
}
|
||||
|
||||
@ApiOperation("修改收件人信息")
|
||||
@PostMapping("/receiver/update")
|
||||
public ResponseEntity<Boolean> updateReceiver(@RequestBody Order order) {
|
||||
return ResponseEntity.ok(service.updateReceiver(order));
|
||||
}
|
||||
|
||||
// @ApiOperation("导出订单表列表")
|
||||
// @PreAuthorize("@ss.hasPermi('oms:order:export')")
|
||||
// @Log(title = "订单表", businessType = BusinessType.EXPORT)
|
||||
// @GetMapping("/export")
|
||||
// public ResponseEntity<String> export(OrderQuery query) {
|
||||
// List<Order> list = service.selectList(query, null);
|
||||
// ExcelUtil<OrderVO> util = new ExcelUtil<>(OrderVO.class);
|
||||
// return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "订单表数据"));
|
||||
// return null;
|
||||
// }
|
||||
|
||||
@ApiOperation("获取订单表详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('oms:order:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<ManagerOrderDetailVO> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增订单表")
|
||||
@PreAuthorize("@ss.hasPermi('oms:order:add')")
|
||||
@Log(title = "订单表", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody Order order) {
|
||||
return ResponseEntity.ok(service.insert(order));
|
||||
}
|
||||
|
||||
@ApiOperation("修改订单表")
|
||||
@PreAuthorize("@ss.hasPermi('oms:order:edit')")
|
||||
@Log(title = "订单表", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody Order order) {
|
||||
return ResponseEntity.ok(service.update(order));
|
||||
}
|
||||
|
||||
@ApiOperation("删除订单表")
|
||||
@PreAuthorize("@ss.hasPermi('oms:order:remove')")
|
||||
@Log(title = "订单表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加备注")
|
||||
@PreAuthorize("@ss.hasPermi('oms:order:note:add')")
|
||||
@Log(title = "订单表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/merchantNote/add")
|
||||
public ResponseEntity<Integer> saveMerchantNote(@RequestBody Order order){
|
||||
return ResponseEntity.ok(service.saveMerchantNote(order));
|
||||
}
|
||||
|
||||
@ApiOperation("管理后台订单发货")
|
||||
@PreAuthorize("@ss.hasPermi('oms:order:delivery')")
|
||||
@PostMapping("/deliverProduct")
|
||||
public ResponseEntity<String> delivery(@RequestBody DeliverProductForm request){
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
String redisKey = "oms_order_deliverProduct" + request.getOrderId();
|
||||
String redisValue = request.getOrderId() + "_" + System.currentTimeMillis();
|
||||
try{
|
||||
redisService.lock(redisKey, redisValue, 60);
|
||||
return ResponseEntity.ok(service.deliverProduct(request, userId));
|
||||
}catch (Exception e){
|
||||
log.error("订单发货接口异常");
|
||||
throw new RuntimeException("发货失败");
|
||||
}finally {
|
||||
try{
|
||||
redisService.unLock(redisKey, redisValue);;
|
||||
}catch (Exception e){
|
||||
log.error("", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("订单日志")
|
||||
@GetMapping("/log/{orderId}")
|
||||
public ResponseEntity<List<OrderOperateHistoryVO>> log(@PathVariable Long orderId){
|
||||
return ResponseEntity.ok(service.log(orderId));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyRoles('admin')")
|
||||
@ApiOperation("订单解密")
|
||||
@GetMapping("/decryptPhone/{orderId}")
|
||||
public ResponseEntity<String> decryptPhone(@PathVariable Long orderId){
|
||||
String decryptPhone = service.decryptPhone(orderId);
|
||||
return ResponseEntity.ok(decryptPhone);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.ruoyi.web.controller.mall;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.mall.domain.Sku;
|
||||
import com.ruoyi.mall.domain.query.SkuQuery;
|
||||
import com.ruoyi.mall.domain.vo.SkuVO;
|
||||
import com.ruoyi.mall.service.SkuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* sku信息Controller
|
||||
*
|
||||
* @author zcc
|
||||
* @date 2022-11-28
|
||||
*/
|
||||
@Api(description ="sku信息接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/pms/sku")
|
||||
public class SkuController extends BaseController {
|
||||
@Autowired
|
||||
private SkuService service;
|
||||
|
||||
@ApiOperation("查询sku信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:sku:list')")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<Sku>> list(@RequestBody SkuQuery query, Pageable page) {
|
||||
service.getOutProductId(query);
|
||||
List<Sku> list = service.selectList(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("导出sku信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('pms:sku:export')")
|
||||
@Log(title = "sku信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public ResponseEntity<String> export(SkuQuery query) {
|
||||
List<Sku> list = service.selectList(query, null);
|
||||
ExcelUtil<SkuVO> util = new ExcelUtil<>(SkuVO.class);
|
||||
return ResponseEntity.ok(util.writeExcel(BeanUtil.copyToList(list,SkuVO.class), "sku信息数据"));
|
||||
}
|
||||
|
||||
@ApiOperation("获取sku信息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('pms:sku:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<Sku> getInfo(@PathVariable("id") Long id) {
|
||||
return ResponseEntity.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@ApiOperation("新增sku信息")
|
||||
@PreAuthorize("@ss.hasPermi('pms:sku:add')")
|
||||
@Log(title = "sku信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public ResponseEntity<Integer> add(@RequestBody Sku sku) {
|
||||
return ResponseEntity.ok(service.insert(sku));
|
||||
}
|
||||
|
||||
@ApiOperation("修改sku信息")
|
||||
@PreAuthorize("@ss.hasPermi('pms:sku:edit')")
|
||||
@Log(title = "sku信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public ResponseEntity<Integer> edit(@RequestBody Sku sku) {
|
||||
return ResponseEntity.ok(service.update(sku));
|
||||
}
|
||||
|
||||
@ApiOperation("删除sku信息")
|
||||
@PreAuthorize("@ss.hasPermi('pms:sku:remove')")
|
||||
@Log(title = "sku信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Integer> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteById(id));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.ruoyi.mall.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 地址对象
|
||||
*
|
||||
*/
|
||||
//"地址对象")
|
||||
@Data
|
||||
@TableName("address")
|
||||
public class Address {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//"ID")
|
||||
private Integer id;
|
||||
|
||||
//"地区邮编")
|
||||
@Excel(name = "地区邮编")
|
||||
private Long code;
|
||||
|
||||
//"父地区邮编")
|
||||
@Excel(name = "父地区邮编")
|
||||
private Long parentCode;
|
||||
|
||||
//"地区名")
|
||||
@Excel(name = "地区名")
|
||||
private String name;
|
||||
|
||||
//"地区层级")
|
||||
@Excel(name = "地区层级")
|
||||
private Integer level;
|
||||
|
||||
//"CREATED_AT")
|
||||
@Excel(name = "CREATED_AT")
|
||||
private String createdAt;
|
||||
|
||||
//"UPDATED_AT")
|
||||
@Excel(name = "UPDATED_AT")
|
||||
private String updatedAt;
|
||||
|
||||
//"DELETED_AT")
|
||||
@Excel(name = "DELETED_AT")
|
||||
private String deletedAt;
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.mall.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 地址对象
|
||||
*
|
||||
*/
|
||||
//"地址对象")
|
||||
@Data
|
||||
@TableName("mall_express")
|
||||
public class Express extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type=IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
private String expressName;
|
||||
|
||||
|
||||
private String expressCode;
|
||||
|
||||
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.ruoyi.mall.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户地址
|
||||
* </p>
|
||||
*
|
||||
* @author xn
|
||||
* @since 2022-09-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("mall_member_address")
|
||||
public class MemberAddress extends BaseAudit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 收货人名称
|
||||
*/
|
||||
//"收货人名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 是否默认
|
||||
*/
|
||||
//"是否默认")
|
||||
private Boolean isDefault;
|
||||
|
||||
//"邮政编码")
|
||||
private String postCode;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
//"省")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
//"市")
|
||||
private String city;
|
||||
|
||||
//"区")
|
||||
private String district;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
//"详细地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
//"电话")
|
||||
private String phone;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.mall.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 订单发货记录对象 oms_order_delivery_history
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
//"订单发货记录对象")
|
||||
@Data
|
||||
@TableName("oms_order_delivery_history")
|
||||
public class OrderDeliveryHistory extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//"ID")
|
||||
private Long id;
|
||||
|
||||
//"订单id")
|
||||
@Excel(name = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
//"物流公司(配送方式)")
|
||||
@Excel(name = "物流公司(配送方式)")
|
||||
private String deliveryCompany;
|
||||
|
||||
//"物流单号")
|
||||
@Excel(name = "物流单号")
|
||||
private String deliverySn;
|
||||
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package com.ruoyi.mall.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseAudit;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 订单中所包含的商品对象 oms_order_item
|
||||
*
|
||||
* @author /
|
||||
*/
|
||||
//"订单中所包含的商品对象")
|
||||
@Data
|
||||
@TableName("oms_order_item")
|
||||
public class OrderItem extends BaseAudit {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//"ID")
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
//"订单id")
|
||||
@Excel(name = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
//"PRODUCT_ID")
|
||||
@Excel(name = "PRODUCT_ID")
|
||||
private Long productId;
|
||||
|
||||
//"商品编码")
|
||||
@Excel(name = "商品编码")
|
||||
private String outProductId;
|
||||
|
||||
//"商品sku id")
|
||||
@Excel(name = "商品sku id")
|
||||
private Long skuId;
|
||||
|
||||
//"sku编码")
|
||||
@Excel(name = "sku编码")
|
||||
private String outSkuId;
|
||||
|
||||
//"商品快照id")
|
||||
@Excel(name = "商品快照id")
|
||||
private Long productSnapshotId;
|
||||
|
||||
//"sku快照id")
|
||||
@Excel(name = "sku快照id")
|
||||
private Long skuSnapshotId;
|
||||
|
||||
//"展示图片")
|
||||
@Excel(name = "展示图片")
|
||||
private String pic;
|
||||
|
||||
//"PRODUCT_NAME")
|
||||
@Excel(name = "PRODUCT_NAME")
|
||||
private String productName;
|
||||
|
||||
//"销售价格")
|
||||
@Excel(name = "销售价格")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
//"采购价")
|
||||
@Excel(name = "采购价")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
//"购买数量")
|
||||
@Excel(name = "购买数量")
|
||||
private Integer quantity;
|
||||
|
||||
//"商品分类id")
|
||||
@Excel(name = "商品分类id")
|
||||
private Long productCategoryId;
|
||||
|
||||
//"商品sku属性:[{\"key\":\"颜色\",\"value\":\"颜色\"},{\"key\":\"容量\",\"value\":\"4G\"}]")
|
||||
@Excel(name = "商品sku属性:[{\"key\":\"颜色\",\"value\":\"颜色\"},{\"key\":\"容量\",\"value\":\"4G\"}]")
|
||||
private String spData;
|
||||
|
||||
private Long storeId;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.mall.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】 DTO 对象
|
||||
*
|
||||
* @author sjm
|
||||
*/
|
||||
@Data
|
||||
public class AddressDTO {
|
||||
private Long id;
|
||||
private Long pid;
|
||||
private String name;
|
||||
private String level;
|
||||
private List<AddressDTO> children;
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.mall.domain.form;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
@Data
|
||||
//"商城售后订单处理操作请求体")
|
||||
public class DealWithAftersaleForm {
|
||||
//name = "orderId",value = "订单id",required = true,dataType = "Long")
|
||||
@NotBlank(message = "订单id不能为空")
|
||||
private Long orderId;
|
||||
|
||||
//name = "optType",value = "操作类型 1同意 2拒绝 3确认收货",required = true,dataType = "String")
|
||||
@NotNull(message = "操作类型不能为空")
|
||||
private Integer optType;
|
||||
|
||||
//name = "remark",value = "拒绝理由 操作类型为2时必填",required = true,dataType = "String")
|
||||
private String remark;
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.mall.domain.query;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class DeliverProductForm {
|
||||
//"订单id")
|
||||
@NotBlank(message = "订单id不能为空")
|
||||
@Excel(name = "订单号")
|
||||
private Long orderId;
|
||||
|
||||
//"快递名称")
|
||||
@NotBlank(message = "快递名称不能为空")
|
||||
@Excel(name = "快递公司")
|
||||
private String expressName;
|
||||
|
||||
//"快递单号")
|
||||
@NotBlank(message = "快递单号不能为空")
|
||||
@Excel(name = "运单号")
|
||||
private String expressSn;
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package com.ruoyi.mall.domain.query;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 订单中所包含的商品 查询 对象
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
//"订单中所包含的商品 查询 对象")
|
||||
@Data
|
||||
public class OrderItemQuery {
|
||||
//"订单id 精确匹配")
|
||||
private Long orderId;
|
||||
|
||||
//"PRODUCT_ID 精确匹配")
|
||||
private Long productId;
|
||||
|
||||
//"商品编码 精确匹配")
|
||||
private String outProductId;
|
||||
|
||||
//"商品sku id 精确匹配")
|
||||
private Long skuId;
|
||||
|
||||
//"sku编码 精确匹配")
|
||||
private String outSkuId;
|
||||
|
||||
//"商品快照id 精确匹配")
|
||||
private Long productSnapshotId;
|
||||
|
||||
//"sku快照id 精确匹配")
|
||||
private Long skuSnapshotId;
|
||||
|
||||
//"展示图片 精确匹配")
|
||||
private String pic;
|
||||
|
||||
//"PRODUCT_NAME 精确匹配")
|
||||
private String productNameLike;
|
||||
|
||||
//"销售价格 精确匹配")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
//"采购价 精确匹配")
|
||||
private BigDecimal purchasePrice;
|
||||
|
||||
//"购买数量 精确匹配")
|
||||
private Integer quantity;
|
||||
|
||||
//"商品分类id 精确匹配")
|
||||
private Long productCategoryId;
|
||||
|
||||
//"商品sku属性:[{\"key\":\"颜色\",\"value\":\"颜色\"},{\"key\":\"容量\",\"value\":\"4G\"}] 精确匹配")
|
||||
private String spData;
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.mall.domain.vo;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author: Jinxin
|
||||
* @date: 2022/4/22 14:12
|
||||
* @Description:
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
//"订单收获地址")
|
||||
public class ManagerOrderAddressVo {
|
||||
//"收货人姓名")
|
||||
private String name;
|
||||
//"收货人手机号")
|
||||
private String userPhone;
|
||||
//"收获区域")
|
||||
private String area;
|
||||
//"详细地址")
|
||||
private String address;
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.mall.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
//"订单")
|
||||
public class ManagerOrderProductVO {
|
||||
//"商品id")
|
||||
private Long productId;
|
||||
//"商品名称")
|
||||
private String productName;
|
||||
//"商品规格")
|
||||
private String spData;
|
||||
//"商品图片")
|
||||
private String pic;
|
||||
//"购买数量")
|
||||
private Integer buyNum;
|
||||
//"销售价格")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.mall.domain.vo;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author:
|
||||
* @date: 2022/4/22 14:12
|
||||
* @Description:
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
//"订单收获地址")
|
||||
public class OrderAddressVO {
|
||||
//"收货人姓名")
|
||||
private String name;
|
||||
//"收货人手机号")
|
||||
private String userPhone;
|
||||
//"收获区域")
|
||||
private String area;
|
||||
//"详细地址")
|
||||
private String address;
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.Address;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author sjm
|
||||
*/
|
||||
public interface AddressMapper extends BaseMapper<Address> {
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param address 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
List<Address> selectByEntity(Address address);
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.Express;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author
|
||||
*/
|
||||
public interface ExpressMapper extends BaseMapper<Express> {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.MemberAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员收货地址Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface MemberAddressMapper extends BaseMapper<MemberAddress> {
|
||||
/**
|
||||
* 查询会员收货地址列表
|
||||
*
|
||||
* @param memberAddress 会员收货地址
|
||||
* @return 会员收货地址集合
|
||||
*/
|
||||
List<MemberAddress> selectByEntity(MemberAddress memberAddress);
|
||||
|
||||
int updateByPrimaryKeySelective(MemberAddress address);
|
||||
|
||||
void updateDefault(int IsDefault, Long id);
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.OrderDeliveryHistory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单发货记录Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface OrderDeliveryHistoryMapper extends BaseMapper<OrderDeliveryHistory> {
|
||||
/**
|
||||
* 查询订单发货记录列表
|
||||
*
|
||||
* @param orderDeliveryHistory 订单发货记录
|
||||
* @return 订单发货记录集合
|
||||
*/
|
||||
List<OrderDeliveryHistory> selectByEntity(OrderDeliveryHistory orderDeliveryHistory);
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.OrderItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单中所包含的商品Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface OrderItemMapper extends BaseMapper<OrderItem> {
|
||||
/**
|
||||
* 查询订单中所包含的商品列表
|
||||
*
|
||||
* @param orderItem 订单中所包含的商品
|
||||
* @return 订单中所包含的商品集合
|
||||
*/
|
||||
List<OrderItem> selectByEntity(OrderItem orderItem);
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.OrderOperateHistory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单操作历史记录Mapper接口
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
public interface OrderOperateHistoryMapper extends BaseMapper<OrderOperateHistory> {
|
||||
/**
|
||||
* 查询订单操作历史记录列表
|
||||
*
|
||||
* @param orderOperateHistory 订单操作历史记录
|
||||
* @return 订单操作历史记录集合
|
||||
*/
|
||||
List<OrderOperateHistory> selectByEntity(OrderOperateHistory orderOperateHistory);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.AppUser;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author xn
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface YjAppUserMapper extends BaseMapper<AppUser> {
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.ruoyi.mall.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.mall.domain.Express;
|
||||
import com.ruoyi.mall.mapper.ExpressMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递管理Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class ExpressService {
|
||||
@Autowired
|
||||
private ExpressMapper mapper;
|
||||
|
||||
/**
|
||||
* 查询快递管理
|
||||
*
|
||||
* @param id 快递管理主键
|
||||
* @return 快递管理
|
||||
*/
|
||||
public Express selectById(Long id) {
|
||||
return mapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递管理列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 快递管理
|
||||
*/
|
||||
public List<Express> selectList(Express query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<Express> qw = new QueryWrapper<>();
|
||||
String nameLike = query.getExpressName();
|
||||
if (!StringUtils.isEmpty(nameLike)) {
|
||||
qw.like("express_name", "%".concat(nameLike).concat("%"));
|
||||
}
|
||||
String status = query.getStatus();
|
||||
if (status != null) {
|
||||
qw.eq("status", status);
|
||||
}
|
||||
|
||||
return mapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增快递管理
|
||||
*
|
||||
* @param 快递管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(Express express) {
|
||||
express.setCreateTime(LocalDateTime.now());
|
||||
return mapper.insert(express);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改快递管理
|
||||
*
|
||||
* @param express 快递管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(Express express) {
|
||||
return mapper.updateById(express);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除快递管理信息
|
||||
*
|
||||
* @param id 快递管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return mapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,142 @@
|
||||
package com.ruoyi.mall.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.mall.domain.OrderItem;
|
||||
import com.ruoyi.mall.domain.query.OrderItemQuery;
|
||||
import com.ruoyi.mall.mapper.OrderItemMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单中所包含的商品Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class OrderItemService extends ServiceImpl<OrderItemMapper, OrderItem> {
|
||||
@Autowired
|
||||
private OrderItemMapper orderItemMapper;
|
||||
|
||||
/**
|
||||
* 查询订单中所包含的商品
|
||||
*
|
||||
* @param id 订单中所包含的商品主键
|
||||
* @return 订单中所包含的商品
|
||||
*/
|
||||
public OrderItem selectById(Long id) {
|
||||
return orderItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单中所包含的商品列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 订单中所包含的商品
|
||||
*/
|
||||
public List<OrderItem> selectList(OrderItemQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<OrderItem> qw = new QueryWrapper<>();
|
||||
Long orderId = query.getOrderId();
|
||||
if (orderId != null) {
|
||||
qw.eq("order_id", orderId);
|
||||
}
|
||||
Long productId = query.getProductId();
|
||||
if (productId != null) {
|
||||
qw.eq("product_id", productId);
|
||||
}
|
||||
String outProductId = query.getOutProductId();
|
||||
if (!StringUtils.isEmpty(outProductId)) {
|
||||
qw.eq("out_product_id", outProductId);
|
||||
}
|
||||
Long skuId = query.getSkuId();
|
||||
if (skuId != null) {
|
||||
qw.eq("sku_id", skuId);
|
||||
}
|
||||
String outSkuId = query.getOutSkuId();
|
||||
if (!StringUtils.isEmpty(outSkuId)) {
|
||||
qw.eq("out_sku_id", outSkuId);
|
||||
}
|
||||
Long productSnapshotId = query.getProductSnapshotId();
|
||||
if (productSnapshotId != null) {
|
||||
qw.eq("product_snapshot_id", productSnapshotId);
|
||||
}
|
||||
Long skuSnapshotId = query.getSkuSnapshotId();
|
||||
if (skuSnapshotId != null) {
|
||||
qw.eq("sku_snapshot_id", skuSnapshotId);
|
||||
}
|
||||
String pic = query.getPic();
|
||||
if (!StringUtils.isEmpty(pic)) {
|
||||
qw.eq("pic", pic);
|
||||
}
|
||||
String productNameLike = query.getProductNameLike();
|
||||
if (!StringUtils.isEmpty(productNameLike)) {
|
||||
qw.like("product_name", productNameLike);
|
||||
}
|
||||
BigDecimal salePrice = query.getSalePrice();
|
||||
if (salePrice != null) {
|
||||
qw.eq("sale_price", salePrice);
|
||||
}
|
||||
BigDecimal purchasePrice = query.getPurchasePrice();
|
||||
if (purchasePrice != null) {
|
||||
qw.eq("purchase_price", purchasePrice);
|
||||
}
|
||||
Integer quantity = query.getQuantity();
|
||||
if (quantity != null) {
|
||||
qw.eq("quantity", quantity);
|
||||
}
|
||||
Long productCategoryId = query.getProductCategoryId();
|
||||
if (productCategoryId != null) {
|
||||
qw.eq("product_category_id", productCategoryId);
|
||||
}
|
||||
String spData = query.getSpData();
|
||||
if (!StringUtils.isEmpty(spData)) {
|
||||
qw.eq("sp_data", spData);
|
||||
}
|
||||
return orderItemMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单中所包含的商品
|
||||
*
|
||||
* @param orderItem 订单中所包含的商品
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(OrderItem orderItem) {
|
||||
orderItem.setCreateTime(LocalDateTime.now());
|
||||
return orderItemMapper.insert(orderItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单中所包含的商品
|
||||
*
|
||||
* @param orderItem 订单中所包含的商品
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(OrderItem orderItem) {
|
||||
return orderItemMapper.updateById(orderItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单中所包含的商品信息
|
||||
*
|
||||
* @param id 订单中所包含的商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return orderItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
package com.ruoyi.mall.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.mall.domain.Product;
|
||||
import com.ruoyi.mall.domain.Sku;
|
||||
import com.ruoyi.mall.domain.query.SkuQuery;
|
||||
import com.ruoyi.mall.mapper.ProductMapper;
|
||||
import com.ruoyi.mall.mapper.SkuMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* sku信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
public class SkuService {
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
/**
|
||||
* 查询sku信息
|
||||
*
|
||||
* @param id sku信息主键
|
||||
* @return sku信息
|
||||
*/
|
||||
public Sku selectById(Long id) {
|
||||
return skuMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询sku信息列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return sku信息
|
||||
*/
|
||||
public List<Sku> selectList(SkuQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<Sku> qw = new QueryWrapper<>();
|
||||
Long productId = query.getProductId();
|
||||
if (productId != null) {
|
||||
qw.eq("product_id", productId);
|
||||
}
|
||||
String outSkuId = query.getOutSkuId();
|
||||
if (!StringUtils.isEmpty(outSkuId)) {
|
||||
qw.eq("out_sku_id", outSkuId);
|
||||
}
|
||||
BigDecimal price = query.getPrice();
|
||||
if (price != null) {
|
||||
qw.eq("price", price);
|
||||
}
|
||||
String pic = query.getPic();
|
||||
if (!StringUtils.isEmpty(pic)) {
|
||||
qw.eq("pic", pic);
|
||||
}
|
||||
String spData = query.getSpData();
|
||||
if (!StringUtils.isEmpty(spData)) {
|
||||
qw.eq("sp_data", spData);
|
||||
}
|
||||
return skuMapper.selectList(qw);
|
||||
}
|
||||
|
||||
public void getOutProductId(SkuQuery query){
|
||||
if (StrUtil.isNotEmpty(query.getOutProductId())){
|
||||
Product product=productMapper.selectOne(new QueryWrapper<Product>().eq("out_product_id",query.getOutProductId()));
|
||||
if (ObjectUtil.isEmpty(product)){
|
||||
throw new RuntimeException("商品编码不存在!");
|
||||
}else {
|
||||
query.setProductId(product.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 新增sku信息
|
||||
*
|
||||
* @param sku sku信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(Sku sku) {
|
||||
sku.setCreateTime(LocalDateTime.now());
|
||||
return skuMapper.insert(sku);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改sku信息
|
||||
*
|
||||
* @param sku sku信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(Sku sku) {
|
||||
return skuMapper.updateById(sku);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除sku信息信息
|
||||
*
|
||||
* @param id sku信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return skuMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.AddressMapper">
|
||||
|
||||
<resultMap type="Address" id="AddressResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="parentCode" column="parent_code"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="level" column="level"/>
|
||||
<result property="createdAt" column="created_at"/>
|
||||
<result property="updatedAt" column="updated_at"/>
|
||||
<result property="deletedAt" column="deleted_at"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAddressVo">
|
||||
select id, code, parent_code, name, level, created_at, updated_at, deleted_at from address
|
||||
</sql>
|
||||
|
||||
<select id="selectByEntity" parameterType="Address" resultMap="AddressResult">
|
||||
<include refid="selectAddressVo"/>
|
||||
<where>
|
||||
<if test="code != null "> and code = #{code}</if>
|
||||
<if test="parentCode != null "> and parent_code = #{parentCode}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="level != null "> and level = #{level}</if>
|
||||
<if test="createdAt != null and createdAt != ''"> and created_at = #{createdAt}</if>
|
||||
<if test="updatedAt != null and updatedAt != ''"> and updated_at = #{updatedAt}</if>
|
||||
<if test="deletedAt != null and deletedAt != ''"> and deleted_at = #{deletedAt}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.ExpressMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.MemberAddressMapper">
|
||||
|
||||
<resultMap type="MemberAddress" id="MemberAddressResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="memberId" column="member_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="phoneHidden" column="phone_hidden"/>
|
||||
<result property="phoneEncrypted" column="phone_encrypted"/>
|
||||
<result property="defaultStatus" column="default_status"/>
|
||||
<result property="postCode" column="post_code"/>
|
||||
<result property="province" column="province"/>
|
||||
<result property="city" column="city"/>
|
||||
<result property="district" column="district"/>
|
||||
<result property="detailAddress" column="detail_address"/>
|
||||
<result property="isDefault" column="is_default"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMemberAddressVo">
|
||||
select id, member_id, name, phone_hidden,phone_encrypted, default_status, post_code, province, city, district, detail_address, is_default, create_by, create_time, update_by, update_time from mall_member_address
|
||||
</sql>
|
||||
|
||||
<select id="selectByEntity" parameterType="MemberAddress" resultMap="MemberAddressResult">
|
||||
<include refid="selectMemberAddressVo"/>
|
||||
<where>
|
||||
<if test="memberId != null "> and member_id = #{memberId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="defaultStatus != null "> and default_status = #{defaultStatus}</if>
|
||||
<if test="postCode != null and postCode != ''"> and post_code = #{postCode}</if>
|
||||
<if test="province != null and province != ''"> and province = #{province}</if>
|
||||
<if test="city != null and city != ''"> and city = #{city}</if>
|
||||
<if test="district != null and district != ''"> and district = #{district}</if>
|
||||
<if test="detailAddress != null and detailAddress != ''"> and detail_address = #{detailAddress}</if>
|
||||
<if test="isDefault != null "> and is_default = #{isDefault}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateByPrimaryKeySelective" parameterType="MemberAddress">
|
||||
update mall_member_address
|
||||
<set>
|
||||
<if test="memberId != null">
|
||||
member_id = #{memberId, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="defaultStatus != null">
|
||||
default_status = #{defaultStatus, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="postCode != null">
|
||||
post_code = #{postCode, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="province != null">
|
||||
province = #{province, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="city != null">
|
||||
city = #{city, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="district != null">
|
||||
district = #{district, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="detailAddress != null">
|
||||
detail_address = #{detailAddress, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
is_default = #{isDefault, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createBy != null">
|
||||
create_by = #{createBy, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy, jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime, jdbcType=BIGINT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id, jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateDefault">
|
||||
update mall_member_address
|
||||
set is_default = #{param1}
|
||||
where member_id = #{param2}
|
||||
</update>
|
||||
</mapper>
|
||||
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.OrderDeliveryHistoryMapper">
|
||||
|
||||
<resultMap type="OrderDeliveryHistory" id="OrderDeliveryHistoryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="deliveryCompany" column="delivery_company"/>
|
||||
<result property="deliverySn" column="delivery_sn"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderDeliveryHistoryVo">
|
||||
select id, order_id, delivery_company, delivery_sn, create_by, create_time, update_by, update_time from oms_order_delivery_history
|
||||
</sql>
|
||||
|
||||
<select id="selectByEntity" parameterType="OrderDeliveryHistory" resultMap="OrderDeliveryHistoryResult">
|
||||
<include refid="selectOrderDeliveryHistoryVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="deliveryCompany != null and deliveryCompany != ''"> and delivery_company = #{deliveryCompany}</if>
|
||||
<if test="deliverySn != null and deliverySn != ''"> and delivery_sn = #{deliverySn}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.OrderItemMapper">
|
||||
|
||||
<resultMap type="OrderItem" id="OrderItemResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="outProductId" column="out_product_id"/>
|
||||
<result property="skuId" column="sku_id"/>
|
||||
<result property="outSkuId" column="out_sku_id"/>
|
||||
<result property="productSnapshotId" column="product_snapshot_id"/>
|
||||
<result property="skuSnapshotId" column="sku_snapshot_id"/>
|
||||
<result property="pic" column="pic"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="salePrice" column="sale_price"/>
|
||||
<result property="purchasePrice" column="purchase_price"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="productCategoryId" column="product_category_id"/>
|
||||
<result property="spData" column="sp_data"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderItemVo">
|
||||
select id, order_id, product_id, out_product_id, sku_id, out_sku_id, product_snapshot_id, sku_snapshot_id, pic, product_name, sale_price, purchase_price, quantity, product_category_id, sp_data, create_by, create_time, update_by, update_time from oms_order_item
|
||||
</sql>
|
||||
|
||||
<select id="selectByEntity" parameterType="OrderItem" resultMap="OrderItemResult">
|
||||
<include refid="selectOrderItemVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="productId != null "> and product_id = #{productId}</if>
|
||||
<if test="outProductId != null and outProductId != ''"> and out_product_id = #{outProductId}</if>
|
||||
<if test="skuId != null "> and sku_id = #{skuId}</if>
|
||||
<if test="outSkuId != null and outSkuId != ''"> and out_sku_id = #{outSkuId}</if>
|
||||
<if test="productSnapshotId != null "> and product_snapshot_id = #{productSnapshotId}</if>
|
||||
<if test="skuSnapshotId != null "> and sku_snapshot_id = #{skuSnapshotId}</if>
|
||||
<if test="pic != null and pic != ''"> and pic = #{pic}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="salePrice != null "> and sale_price = #{salePrice}</if>
|
||||
<if test="purchasePrice != null "> and purchase_price = #{purchasePrice}</if>
|
||||
<if test="quantity != null "> and quantity = #{quantity}</if>
|
||||
<if test="productCategoryId != null "> and product_category_id = #{productCategoryId}</if>
|
||||
<if test="spData != null and spData != ''"> and sp_data = #{spData}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.OrderOperateHistoryMapper">
|
||||
|
||||
<resultMap type="OrderOperateHistory" id="OrderOperateHistoryResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="orderSn" column="order_sn"/>
|
||||
<result property="operateMan" column="operate_man"/>
|
||||
<result property="orderStatus" column="order_status"/>
|
||||
<result property="note" column="note"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrderOperateHistoryVo">
|
||||
select id, order_id, operate_man, order_status, note, create_by, create_time, update_by, update_time from oms_order_operate_history
|
||||
</sql>
|
||||
|
||||
<select id="selectByEntity" parameterType="OrderOperateHistory" resultMap="OrderOperateHistoryResult">
|
||||
<include refid="selectOrderOperateHistoryVo"/>
|
||||
<where>
|
||||
<if test="orderId != null "> and order_id = #{orderId}</if>
|
||||
<if test="operateMan != null and operateMan != ''"> and operate_man = #{operateMan}</if>
|
||||
<if test="orderStatus != null "> and order_status = #{orderStatus}</if>
|
||||
<if test="note != null and note != ''"> and note = #{note}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.YjAppUserMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in new issue