推送新架构
This commit is contained in:
parent
67f329cb14
commit
99eefafe4e
|
|
@ -63,21 +63,33 @@
|
||||||
<artifactId>security</artifactId>
|
<artifactId>security</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>cn.qihangerp.module</groupId>
|
<!-- <groupId>cn.qihangerp.module</groupId>-->
|
||||||
<artifactId>goods</artifactId>
|
<!-- <artifactId>goods</artifactId>-->
|
||||||
<version>1.0</version>
|
<!-- <version>1.0</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>cn.qihangerp.module</groupId>
|
<!-- <groupId>cn.qihangerp.module</groupId>-->
|
||||||
<artifactId>order</artifactId>
|
<!-- <artifactId>order</artifactId>-->
|
||||||
<version>1.0</version>
|
<!-- <version>1.0</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.qihangerp.module</groupId>
|
<groupId>cn.qihangerp.module</groupId>
|
||||||
<artifactId>stock</artifactId>
|
<artifactId>stock</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qihangerp.services</groupId>
|
||||||
|
<artifactId>goods-api</artifactId>
|
||||||
|
<version>1.0.6</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qihangerp.services</groupId>
|
||||||
|
<artifactId>order-api</artifactId>
|
||||||
|
<version>1.0.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerIntercept
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@MapperScan({"cn.qihangerp.oms.mapper","cn.qihangerp.module.*.mapper","cn.qihangerp.module.mapper"})
|
@MapperScan({"cn.qihangerp.oms.mapper","cn.qihangerp.module.*.mapper","cn.qihangerp.module.mapper"})
|
||||||
public class MybatisPlusConfig {
|
public class MybatisPlusConfig {
|
||||||
|
@Primary
|
||||||
@Bean
|
@Bean
|
||||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
|
|
||||||
|
|
@ -1,101 +1,101 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.PageQuery;
|
|
||||||
import cn.qihangerp.common.PageResult;
|
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
|
||||||
import cn.qihangerp.module.order.domain.OAfterSale;
|
|
||||||
import cn.qihangerp.module.order.service.OAfterSaleService;
|
|
||||||
import cn.qihangerp.security.common.BaseController;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/afterSale")
|
|
||||||
public class AfterSaleProcessingController extends BaseController {
|
|
||||||
private final OAfterSaleService afterSaleService;
|
|
||||||
/**
|
|
||||||
* 查询列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo ship_again_list(OAfterSale bo, PageQuery pageQuery)
|
|
||||||
{
|
|
||||||
//private final OAfterSaleMapper mapper;
|
|
||||||
// @Override
|
|
||||||
// public PageResult<OAfterSale> queryPageList(OAfterSale bo, PageQuery pageQuery) {
|
|
||||||
// LambdaQueryWrapper<OAfterSale> queryWrapper = new LambdaQueryWrapper<OAfterSale>().
|
|
||||||
// eq( OAfterSale::getType, bo.getType())
|
|
||||||
// .eq(bo.getShopId() != null, OAfterSale::getShopId, bo.getShopId());
|
|
||||||
//
|
|
||||||
// Page<OAfterSale> pages = mapper.selectPage(pageQuery.build(), queryWrapper);
|
|
||||||
// return PageResult.build(pages);
|
|
||||||
// }
|
|
||||||
// bo.setType(80);
|
|
||||||
PageResult<OAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
|
||||||
return getDataTable(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @PostMapping("/shipAgain")
|
|
||||||
// public AjaxResult shipAgainAdd(@RequestBody ErpAfterSale addBo)
|
|
||||||
// {
|
|
||||||
// addBo.setType(80);
|
|
||||||
// addBo.setCreateTime(new Date());
|
|
||||||
// addBo.setCreateBy("手动添加");
|
|
||||||
// addBo.setStatus(1);
|
|
||||||
// var result = afterSaleService.save(addBo);
|
|
||||||
// return toAjax(result);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @PutMapping("/shipAgain/complete/{id}")
|
|
||||||
// public AjaxResult completeShipAgain(@PathVariable Long id)
|
|
||||||
// {
|
|
||||||
// ErpAfterSale complete = new ErpAfterSale();
|
|
||||||
// complete.setId(id.toString());
|
|
||||||
// complete.setStatus(2);
|
|
||||||
// complete.setUpdateTime(new Date());
|
|
||||||
// complete.setUpdateBy("手动完成");
|
|
||||||
// afterSaleService.updateById(complete);
|
|
||||||
// return toAjax(1);
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// @GetMapping("/returned_list")
|
//import cn.qihangerp.common.PageQuery;
|
||||||
// public TableDataInfo returned_list(ErpAfterSale bo, PageQuery pageQuery)
|
//import cn.qihangerp.common.PageResult;
|
||||||
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
|
//import cn.qihangerp.module.order.domain.OAfterSale;
|
||||||
|
//import cn.qihangerp.module.order.service.OAfterSaleService;
|
||||||
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
|
//import lombok.AllArgsConstructor;
|
||||||
|
//import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
|
//
|
||||||
|
//@AllArgsConstructor
|
||||||
|
//@RestController
|
||||||
|
//@RequestMapping("/afterSale")
|
||||||
|
//public class AfterSaleProcessingController extends BaseController {
|
||||||
|
// private final OAfterSaleService afterSaleService;
|
||||||
|
// /**
|
||||||
|
// * 查询列表
|
||||||
|
// */
|
||||||
|
// @GetMapping("/list")
|
||||||
|
// public TableDataInfo ship_again_list(OAfterSale bo, PageQuery pageQuery)
|
||||||
// {
|
// {
|
||||||
// bo.setType(10);
|
// //private final OAfterSaleMapper mapper;
|
||||||
// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
// // @Override
|
||||||
|
// // public PageResult<OAfterSale> queryPageList(OAfterSale bo, PageQuery pageQuery) {
|
||||||
|
// // LambdaQueryWrapper<OAfterSale> queryWrapper = new LambdaQueryWrapper<OAfterSale>().
|
||||||
|
// // eq( OAfterSale::getType, bo.getType())
|
||||||
|
// // .eq(bo.getShopId() != null, OAfterSale::getShopId, bo.getShopId());
|
||||||
|
// //
|
||||||
|
// // Page<OAfterSale> pages = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||||
|
// // return PageResult.build(pages);
|
||||||
|
// // }
|
||||||
|
//// bo.setType(80);
|
||||||
|
// PageResult<OAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
// return getDataTable(result);
|
// return getDataTable(result);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @GetMapping("/exchange_list")
|
//// @PostMapping("/shipAgain")
|
||||||
// public TableDataInfo exchange_list(ErpAfterSale bo, PageQuery pageQuery)
|
//// public AjaxResult shipAgainAdd(@RequestBody ErpAfterSale addBo)
|
||||||
// {
|
//// {
|
||||||
// bo.setType(20);
|
//// addBo.setType(80);
|
||||||
// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
//// addBo.setCreateTime(new Date());
|
||||||
// return getDataTable(result);
|
//// addBo.setCreateBy("手动添加");
|
||||||
// }
|
//// addBo.setStatus(1);
|
||||||
|
//// var result = afterSaleService.save(addBo);
|
||||||
|
//// return toAjax(result);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// @PutMapping("/shipAgain/complete/{id}")
|
||||||
|
//// public AjaxResult completeShipAgain(@PathVariable Long id)
|
||||||
|
//// {
|
||||||
|
//// ErpAfterSale complete = new ErpAfterSale();
|
||||||
|
//// complete.setId(id.toString());
|
||||||
|
//// complete.setStatus(2);
|
||||||
|
//// complete.setUpdateTime(new Date());
|
||||||
|
//// complete.setUpdateBy("手动完成");
|
||||||
|
//// afterSaleService.updateById(complete);
|
||||||
|
//// return toAjax(1);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
////
|
||||||
|
//// @GetMapping("/returned_list")
|
||||||
|
//// public TableDataInfo returned_list(ErpAfterSale bo, PageQuery pageQuery)
|
||||||
|
//// {
|
||||||
|
//// bo.setType(10);
|
||||||
|
//// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
|
//// return getDataTable(result);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// @GetMapping("/exchange_list")
|
||||||
|
//// public TableDataInfo exchange_list(ErpAfterSale bo, PageQuery pageQuery)
|
||||||
|
//// {
|
||||||
|
//// bo.setType(20);
|
||||||
|
//// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
|
//// return getDataTable(result);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// @PostMapping("/exchange")
|
||||||
|
//// public AjaxResult exchangeAdd(@RequestBody ErpAfterSale addBo)
|
||||||
|
//// {
|
||||||
|
//// addBo.setType(20);
|
||||||
|
//// addBo.setCreateTime(new Date());
|
||||||
|
//// addBo.setCreateBy("手动添加");
|
||||||
|
//// addBo.setStatus(1);
|
||||||
|
//// var result = afterSaleService.save(addBo);
|
||||||
|
//// return toAjax(result);
|
||||||
|
//// }
|
||||||
|
////
|
||||||
|
//// @GetMapping("/intercept_list")
|
||||||
|
//// public TableDataInfo intercept_list(ErpAfterSale bo, PageQuery pageQuery)
|
||||||
|
//// {
|
||||||
|
//// bo.setType(99);
|
||||||
|
//// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
|
//// return getDataTable(result);
|
||||||
|
//// }
|
||||||
//
|
//
|
||||||
// @PostMapping("/exchange")
|
|
||||||
// public AjaxResult exchangeAdd(@RequestBody ErpAfterSale addBo)
|
|
||||||
// {
|
|
||||||
// addBo.setType(20);
|
|
||||||
// addBo.setCreateTime(new Date());
|
|
||||||
// addBo.setCreateBy("手动添加");
|
|
||||||
// addBo.setStatus(1);
|
|
||||||
// var result = afterSaleService.save(addBo);
|
|
||||||
// return toAjax(result);
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
// @GetMapping("/intercept_list")
|
//}
|
||||||
// public TableDataInfo intercept_list(ErpAfterSale bo, PageQuery pageQuery)
|
|
||||||
// {
|
|
||||||
// bo.setType(99);
|
|
||||||
// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
|
||||||
// return getDataTable(result);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,72 +1,72 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.AjaxResult;
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
import cn.qihangerp.common.PageQuery;
|
//import cn.qihangerp.common.PageQuery;
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsBrand;
|
//import cn.qihangerp.module.goods.domain.OGoodsBrand;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsBrandService;
|
//import cn.qihangerp.module.goods.service.OGoodsBrandService;
|
||||||
|
//
|
||||||
import cn.qihangerp.security.common.BaseController;
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
//import org.springframework.web.bind.annotation.*;
|
||||||
|
//
|
||||||
import java.util.Arrays;
|
//import java.util.Arrays;
|
||||||
import java.util.Date;
|
//import java.util.Date;
|
||||||
|
//
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/goods_brand")
|
//@RequestMapping("/goods_brand")
|
||||||
public class GoodsBrandController extends BaseController {
|
//public class GoodsBrandController extends BaseController {
|
||||||
private final OGoodsBrandService brandService;
|
// private final OGoodsBrandService brandService;
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public TableDataInfo skuList(OGoodsBrand bo, PageQuery pageQuery)
|
// public TableDataInfo skuList(OGoodsBrand bo, PageQuery pageQuery)
|
||||||
{
|
// {
|
||||||
var pageList = brandService.queryPageList(bo,pageQuery);
|
// var pageList = brandService.queryPageList(bo,pageQuery);
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取商品品牌详细信息
|
// * 获取商品品牌详细信息
|
||||||
*/
|
// */
|
||||||
@GetMapping(value = "/{id}")
|
// @GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
return success(brandService.getById(id));
|
// return success(brandService.getById(id));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 新增商品品牌
|
// * 新增商品品牌
|
||||||
*/
|
// */
|
||||||
@PostMapping
|
// @PostMapping
|
||||||
public AjaxResult add(@RequestBody OGoodsBrand erpGoodsBrand)
|
// public AjaxResult add(@RequestBody OGoodsBrand erpGoodsBrand)
|
||||||
{
|
// {
|
||||||
erpGoodsBrand.setStatus(1);
|
// erpGoodsBrand.setStatus(1);
|
||||||
erpGoodsBrand.setCreateBy(getUsername());
|
// erpGoodsBrand.setCreateBy(getUsername());
|
||||||
erpGoodsBrand.setCreateTime(new Date());
|
// erpGoodsBrand.setCreateTime(new Date());
|
||||||
return toAjax(brandService.save(erpGoodsBrand));
|
// return toAjax(brandService.save(erpGoodsBrand));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改商品品牌
|
// * 修改商品品牌
|
||||||
*/
|
// */
|
||||||
@PutMapping
|
// @PutMapping
|
||||||
public AjaxResult edit(@RequestBody OGoodsBrand erpGoodsBrand)
|
// public AjaxResult edit(@RequestBody OGoodsBrand erpGoodsBrand)
|
||||||
{
|
// {
|
||||||
erpGoodsBrand.setUpdateBy(getUsername());
|
// erpGoodsBrand.setUpdateBy(getUsername());
|
||||||
erpGoodsBrand.setUpdateTime(new Date());
|
// erpGoodsBrand.setUpdateTime(new Date());
|
||||||
return toAjax(brandService.updateById(erpGoodsBrand));
|
// return toAjax(brandService.updateById(erpGoodsBrand));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 删除商品品牌
|
// * 删除商品品牌
|
||||||
*/
|
// */
|
||||||
@DeleteMapping("/{ids}")
|
// @DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
// {
|
||||||
return toAjax(brandService.removeByIds(Arrays.stream(ids).toList()));
|
// return toAjax(brandService.removeByIds(Arrays.stream(ids).toList()));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,142 +1,142 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.AjaxResult;
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsCategory;
|
//import cn.qihangerp.module.goods.domain.OGoodsCategory;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsCategoryAttribute;
|
//import cn.qihangerp.module.goods.domain.OGoodsCategoryAttribute;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsCategoryAttributeValue;
|
//import cn.qihangerp.module.goods.domain.OGoodsCategoryAttributeValue;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeService;
|
//import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeService;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeValueService;
|
//import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeValueService;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsCategoryService;
|
//import cn.qihangerp.module.goods.service.OGoodsCategoryService;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
//import org.springframework.web.bind.annotation.*;
|
||||||
|
//
|
||||||
import java.util.Arrays;
|
//import java.util.Arrays;
|
||||||
import java.util.Date;
|
//import java.util.Date;
|
||||||
|
//
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/goods_category")
|
//@RequestMapping("/goods_category")
|
||||||
public class GoodsCategoryController extends BaseController {
|
//public class GoodsCategoryController extends BaseController {
|
||||||
private final OGoodsCategoryService categoryService;
|
// private final OGoodsCategoryService categoryService;
|
||||||
private final OGoodsCategoryAttributeService categoryAttributeService;
|
// private final OGoodsCategoryAttributeService categoryAttributeService;
|
||||||
private final OGoodsCategoryAttributeValueService categoryAttributeValueService;
|
// private final OGoodsCategoryAttributeValueService categoryAttributeValueService;
|
||||||
|
//
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public TableDataInfo categoryList()
|
// public TableDataInfo categoryList()
|
||||||
{
|
// {
|
||||||
var pageList = categoryService.list();
|
// var pageList = categoryService.list();
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping(value = "/{id}")
|
// @GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
return success(categoryService.getById(id));
|
// return success(categoryService.getById(id));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PostMapping
|
// @PostMapping
|
||||||
public AjaxResult add(@RequestBody OGoodsCategory category)
|
// public AjaxResult add(@RequestBody OGoodsCategory category)
|
||||||
{
|
// {
|
||||||
category.setCreateBy(getUsername());
|
// category.setCreateBy(getUsername());
|
||||||
categoryService.addCategory(category);
|
// categoryService.addCategory(category);
|
||||||
return toAjax(1);
|
// return toAjax(1);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PutMapping
|
// @PutMapping
|
||||||
public AjaxResult edit(@RequestBody OGoodsCategory category)
|
// public AjaxResult edit(@RequestBody OGoodsCategory category)
|
||||||
{
|
// {
|
||||||
category.setUpdateBy(getUsername());
|
// category.setUpdateBy(getUsername());
|
||||||
category.setUpdateTime(new Date());
|
// category.setUpdateTime(new Date());
|
||||||
return toAjax(categoryService.updateById(category));
|
// return toAjax(categoryService.updateById(category));
|
||||||
}
|
// }
|
||||||
/**
|
// /**
|
||||||
* 删除分类
|
// * 删除分类
|
||||||
* @param ids
|
// * @param ids
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@DeleteMapping("/del/{ids}")
|
// @DeleteMapping("/del/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
// {
|
||||||
return toAjax(categoryService.removeByIds(Arrays.stream(ids).toList()));
|
// return toAjax(categoryService.removeByIds(Arrays.stream(ids).toList()));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 分类属性列表
|
// * 分类属性列表
|
||||||
* @param categoryId
|
// * @param categoryId
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@GetMapping("/attribute_list")
|
// @GetMapping("/attribute_list")
|
||||||
public TableDataInfo attributeList(Integer categoryId)
|
// public TableDataInfo attributeList(Integer categoryId)
|
||||||
{
|
// {
|
||||||
var pageList = categoryAttributeService.list(new LambdaQueryWrapper<OGoodsCategoryAttribute>().eq(OGoodsCategoryAttribute::getCategoryId,categoryId));
|
// var pageList = categoryAttributeService.list(new LambdaQueryWrapper<OGoodsCategoryAttribute>().eq(OGoodsCategoryAttribute::getCategoryId,categoryId));
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 分类属性添加
|
// * 分类属性添加
|
||||||
* @param attribute
|
// * @param attribute
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@PostMapping("/attribute_add")
|
// @PostMapping("/attribute_add")
|
||||||
public AjaxResult attributeAdd(@RequestBody OGoodsCategoryAttribute attribute)
|
// public AjaxResult attributeAdd(@RequestBody OGoodsCategoryAttribute attribute)
|
||||||
{
|
// {
|
||||||
return toAjax(categoryAttributeService.save(attribute));
|
// return toAjax(categoryAttributeService.save(attribute));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping(value = "/attribute/{id}")
|
// @GetMapping(value = "/attribute/{id}")
|
||||||
public AjaxResult getAttributeInfo(@PathVariable("id") Long id)
|
// public AjaxResult getAttributeInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
return success(categoryAttributeService.getById(id));
|
// return success(categoryAttributeService.getById(id));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PutMapping("/attribute")
|
// @PutMapping("/attribute")
|
||||||
public AjaxResult attributeEdit(@RequestBody OGoodsCategoryAttribute attribute)
|
// public AjaxResult attributeEdit(@RequestBody OGoodsCategoryAttribute attribute)
|
||||||
{
|
// {
|
||||||
return toAjax(categoryAttributeService.updateById(attribute));
|
// return toAjax(categoryAttributeService.updateById(attribute));
|
||||||
}
|
// }
|
||||||
@DeleteMapping("/attribute/{ids}")
|
// @DeleteMapping("/attribute/{ids}")
|
||||||
public AjaxResult attributeRemove(@PathVariable Long[] ids)
|
// public AjaxResult attributeRemove(@PathVariable Long[] ids)
|
||||||
{
|
// {
|
||||||
return toAjax(categoryAttributeService.removeByIds(Arrays.stream(ids).toList()));
|
// return toAjax(categoryAttributeService.removeByIds(Arrays.stream(ids).toList()));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping("/attribute_value_list")
|
// @GetMapping("/attribute_value_list")
|
||||||
public TableDataInfo attributeValueList(Integer categoryAttributeId)
|
// public TableDataInfo attributeValueList(Integer categoryAttributeId)
|
||||||
{
|
// {
|
||||||
var pageList = categoryAttributeValueService.list(
|
// var pageList = categoryAttributeValueService.list(
|
||||||
new LambdaQueryWrapper<OGoodsCategoryAttributeValue>().eq(OGoodsCategoryAttributeValue::getCategoryAttributeId,categoryAttributeId));
|
// new LambdaQueryWrapper<OGoodsCategoryAttributeValue>().eq(OGoodsCategoryAttributeValue::getCategoryAttributeId,categoryAttributeId));
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PostMapping("/attribute_value")
|
// @PostMapping("/attribute_value")
|
||||||
public AjaxResult add(@RequestBody OGoodsCategoryAttributeValue attributeValue)
|
// public AjaxResult add(@RequestBody OGoodsCategoryAttributeValue attributeValue)
|
||||||
{
|
// {
|
||||||
return toAjax(categoryAttributeValueService.save(attributeValue));
|
// return toAjax(categoryAttributeValueService.save(attributeValue));
|
||||||
}
|
// }
|
||||||
@GetMapping(value = "/attribute_value/{id}")
|
// @GetMapping(value = "/attribute_value/{id}")
|
||||||
public AjaxResult getAttributeValueInfo(@PathVariable("id") Long id)
|
// public AjaxResult getAttributeValueInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
return success(categoryAttributeValueService.getById(id));
|
// return success(categoryAttributeValueService.getById(id));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PutMapping("/attribute_value")
|
// @PutMapping("/attribute_value")
|
||||||
public AjaxResult attributeValueEdit(@RequestBody OGoodsCategoryAttributeValue attributeValue)
|
// public AjaxResult attributeValueEdit(@RequestBody OGoodsCategoryAttributeValue attributeValue)
|
||||||
{
|
// {
|
||||||
return toAjax(categoryAttributeValueService.updateById(attributeValue));
|
// return toAjax(categoryAttributeValueService.updateById(attributeValue));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 删除商品分类属性值
|
// * 删除商品分类属性值
|
||||||
*/
|
// */
|
||||||
@DeleteMapping("/attribute_value/{ids}")
|
// @DeleteMapping("/attribute_value/{ids}")
|
||||||
public AjaxResult removeAttributeValue(@PathVariable Long[] ids)
|
// public AjaxResult removeAttributeValue(@PathVariable Long[] ids)
|
||||||
{
|
// {
|
||||||
return toAjax(categoryAttributeValueService.removeByIds(Arrays.stream(ids).toList()));
|
// return toAjax(categoryAttributeValueService.removeByIds(Arrays.stream(ids).toList()));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,247 +1,247 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.PageQuery;
|
//import cn.qihangerp.common.PageQuery;
|
||||||
import cn.qihangerp.common.PageResult;
|
//import cn.qihangerp.common.PageResult;
|
||||||
import cn.qihangerp.common.ResultVo;
|
//import cn.qihangerp.common.ResultVo;
|
||||||
import cn.qihangerp.common.AjaxResult;
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.module.goods.domain.OGoods;
|
//import cn.qihangerp.module.goods.domain.OGoods;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsSku;
|
//import cn.qihangerp.module.goods.domain.OGoodsSku;
|
||||||
import cn.qihangerp.module.goods.domain.bo.GoodsAddBo;
|
//import cn.qihangerp.module.goods.domain.bo.GoodsAddBo;
|
||||||
import cn.qihangerp.module.goods.domain.vo.GoodsSpecListVo;
|
//import cn.qihangerp.module.goods.domain.vo.GoodsSpecListVo;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsService;
|
//import cn.qihangerp.module.goods.service.OGoodsService;
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.module.goods.service.OGoodsSkuService;
|
//import cn.qihangerp.module.goods.service.OGoodsSkuService;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
//import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
//import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
//import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.ss.util.NumberToTextConverter;
|
//import org.apache.poi.ss.util.NumberToTextConverter;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
//import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.util.StringUtils;
|
//import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
//import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
//import org.springframework.web.multipart.MultipartFile;
|
||||||
|
//
|
||||||
import java.io.File;
|
//import java.io.File;
|
||||||
import java.io.FileInputStream;
|
//import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
//import java.io.IOException;
|
||||||
import java.io.InputStream;
|
//import java.io.InputStream;
|
||||||
import java.util.HashMap;
|
//import java.util.HashMap;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
import java.util.Map;
|
//import java.util.Map;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* 商品管理Controller
|
// * 商品管理Controller
|
||||||
*
|
// *
|
||||||
* @author qihang
|
// * @author qihang
|
||||||
* @date 2023-12-29
|
// * @date 2023-12-29
|
||||||
*/
|
// */
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/goods")
|
//@RequestMapping("/goods")
|
||||||
public class GoodsController extends BaseController
|
//public class GoodsController extends BaseController
|
||||||
{
|
//{
|
||||||
private final OGoodsService goodsService;
|
// private final OGoodsService goodsService;
|
||||||
private final OGoodsSkuService skuService;
|
// private final OGoodsSkuService skuService;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 搜索商品SKU
|
// * 搜索商品SKU
|
||||||
* 条件:商品编码、SKU、商品名称
|
// * 条件:商品编码、SKU、商品名称
|
||||||
*/
|
// */
|
||||||
@GetMapping("/searchSku")
|
// @GetMapping("/searchSku")
|
||||||
public TableDataInfo searchSkuBy(String keyword)
|
// public TableDataInfo searchSkuBy(String keyword)
|
||||||
{
|
// {
|
||||||
List<GoodsSpecListVo> list = goodsService.searchGoodsSpec(keyword);
|
// List<GoodsSpecListVo> list = goodsService.searchGoodsSpec(keyword);
|
||||||
return getDataTable(list);
|
// return getDataTable(list);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping("/sku_list")
|
// @GetMapping("/sku_list")
|
||||||
public TableDataInfo skuList(OGoodsSku bo, PageQuery pageQuery)
|
// public TableDataInfo skuList(OGoodsSku bo, PageQuery pageQuery)
|
||||||
{
|
// {
|
||||||
var pageList = goodsService.querySkuPageList(bo,pageQuery);
|
// var pageList = goodsService.querySkuPageList(bo,pageQuery);
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 查询商品管理列表
|
// * 查询商品管理列表
|
||||||
*/
|
// */
|
||||||
@PreAuthorize("@ss.hasPermi('goods:goods:list')")
|
// @PreAuthorize("@ss.hasPermi('goods:goods:list')")
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public TableDataInfo list(OGoods goods, PageQuery pageQuery)
|
// public TableDataInfo list(OGoods goods, PageQuery pageQuery)
|
||||||
{
|
// {
|
||||||
PageResult<OGoods> pageList = goodsService.queryPageList(goods, pageQuery);
|
// PageResult<OGoods> pageList = goodsService.queryPageList(goods, pageQuery);
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取商品管理详细信息
|
// * 获取商品管理详细信息
|
||||||
*/
|
// */
|
||||||
@PreAuthorize("@ss.hasPermi('goods:goods:query')")
|
// @PreAuthorize("@ss.hasPermi('goods:goods:query')")
|
||||||
@GetMapping(value = "/{id}")
|
// @GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
return success(goodsService.selectGoodsById(id));
|
// return success(goodsService.selectGoodsById(id));
|
||||||
}
|
// }
|
||||||
/**
|
// /**
|
||||||
* 获取商品管理详细信息
|
// * 获取商品管理详细信息
|
||||||
*/
|
// */
|
||||||
@PreAuthorize("@ss.hasPermi('goods:goods:query')")
|
// @PreAuthorize("@ss.hasPermi('goods:goods:query')")
|
||||||
@GetMapping(value = "/sku/{id}")
|
// @GetMapping(value = "/sku/{id}")
|
||||||
public AjaxResult getSkuInfo(@PathVariable("id") Long id)
|
// public AjaxResult getSkuInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
return success(skuService.getById(id));
|
// return success(skuService.getById(id));
|
||||||
}
|
// }
|
||||||
/**
|
// /**
|
||||||
* 新增商品管理
|
// * 新增商品管理
|
||||||
*/
|
// */
|
||||||
@PreAuthorize("@ss.hasPermi('goods:goods:add')")
|
// @PreAuthorize("@ss.hasPermi('goods:goods:add')")
|
||||||
@PostMapping("/add")
|
// @PostMapping("/add")
|
||||||
public AjaxResult add(@RequestBody GoodsAddBo goods)
|
// public AjaxResult add(@RequestBody GoodsAddBo goods)
|
||||||
{
|
// {
|
||||||
ResultVo<Long> resultVo = goodsService.insertGoods(getUsername(), goods);
|
// ResultVo<Long> resultVo = goodsService.insertGoods(getUsername(), goods);
|
||||||
if(resultVo.getCode()!=0) return AjaxResult.error(resultVo.getMsg());
|
// if(resultVo.getCode()!=0) return AjaxResult.error(resultVo.getMsg());
|
||||||
else return AjaxResult.success(resultVo.getData());
|
// else return AjaxResult.success(resultVo.getData());
|
||||||
// goods.setCreateBy(getUsername());
|
//// goods.setCreateBy(getUsername());
|
||||||
// int result = goodsService.insertGoods(goods);
|
//// int result = goodsService.insertGoods(goods);
|
||||||
|
//// if(result == -1) new AjaxResult(501,"商品编码已存在");
|
||||||
|
//// return toAjax(1);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @PreAuthorize("@ss.hasPermi('goods:goods:add')")
|
||||||
|
// @PostMapping("/goodsSku")
|
||||||
|
// public AjaxResult addSku(@RequestBody OGoodsSku goodsSku)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// int result = goodsService.insertGoodsSku(goodsSku);
|
||||||
// if(result == -1) new AjaxResult(501,"商品编码已存在");
|
// if(result == -1) new AjaxResult(501,"商品编码已存在");
|
||||||
// return toAjax(1);
|
// return toAjax(1);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PreAuthorize("@ss.hasPermi('goods:goods:add')")
|
// /**
|
||||||
@PostMapping("/goodsSku")
|
// * 修改商品管理
|
||||||
public AjaxResult addSku(@RequestBody OGoodsSku goodsSku)
|
// */
|
||||||
{
|
// @PreAuthorize("@ss.hasPermi('goods:goods:edit')")
|
||||||
|
// @PutMapping
|
||||||
int result = goodsService.insertGoodsSku(goodsSku);
|
// public AjaxResult edit(@RequestBody OGoods goods)
|
||||||
if(result == -1) new AjaxResult(501,"商品编码已存在");
|
// {
|
||||||
return toAjax(1);
|
// return toAjax(goodsService.updateGoods(goods));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改商品管理
|
// * 修改商品基本资料
|
||||||
*/
|
// * @param sku
|
||||||
@PreAuthorize("@ss.hasPermi('goods:goods:edit')")
|
// * @return
|
||||||
@PutMapping
|
// */
|
||||||
public AjaxResult edit(@RequestBody OGoods goods)
|
// @PutMapping("/sku")
|
||||||
{
|
// public AjaxResult editSku(@RequestBody OGoodsSku sku)
|
||||||
return toAjax(goodsService.updateGoods(goods));
|
// {
|
||||||
}
|
// return toAjax(skuService.updateById(sku));
|
||||||
|
// }
|
||||||
/**
|
//
|
||||||
* 修改商品基本资料
|
// /**
|
||||||
* @param sku
|
// * 删除商品管理
|
||||||
* @return
|
// */
|
||||||
*/
|
// @PreAuthorize("@ss.hasPermi('goods:goods:remove')")
|
||||||
@PutMapping("/sku")
|
// @DeleteMapping("/del/{ids}")
|
||||||
public AjaxResult editSku(@RequestBody OGoodsSku sku)
|
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
// {
|
||||||
return toAjax(skuService.updateById(sku));
|
// int result = goodsService.deleteGoodsByIds(ids);
|
||||||
}
|
// if(result==0) return AjaxResult.success();
|
||||||
|
// else if (result==-100) return AjaxResult.error("有关联的订单,不能删除!");
|
||||||
/**
|
// else return AjaxResult.error();
|
||||||
* 删除商品管理
|
// }
|
||||||
*/
|
//
|
||||||
@PreAuthorize("@ss.hasPermi('goods:goods:remove')")
|
// @RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
|
||||||
@DeleteMapping("/del/{ids}")
|
// public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
//
|
||||||
{
|
// String fileName = file.getOriginalFilename();
|
||||||
int result = goodsService.deleteGoodsByIds(ids);
|
// String dir = System.getProperty("user.dir");
|
||||||
if(result==0) return AjaxResult.success();
|
// String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
|
||||||
else if (result==-100) return AjaxResult.error("有关联的订单,不能删除!");
|
// System.out.println(destFileName);
|
||||||
else return AjaxResult.error();
|
// File destFile = new File(destFileName);
|
||||||
}
|
// file.transferTo(destFile);
|
||||||
|
// InputStream fis = null;
|
||||||
@RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
|
// fis = new FileInputStream(destFileName);
|
||||||
public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
|
// if (fis == null) return AjaxResult.error("没有文件");
|
||||||
|
//
|
||||||
String fileName = file.getOriginalFilename();
|
// Workbook workbook = null;
|
||||||
String dir = System.getProperty("user.dir");
|
//
|
||||||
String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
|
// try {
|
||||||
System.out.println(destFileName);
|
// if (fileName.toLowerCase().endsWith("xlsx")) {
|
||||||
File destFile = new File(destFileName);
|
// workbook = new XSSFWorkbook(fis);
|
||||||
file.transferTo(destFile);
|
// } else if (fileName.toLowerCase().endsWith("xls")) {
|
||||||
InputStream fis = null;
|
// workbook = new HSSFWorkbook(fis);
|
||||||
fis = new FileInputStream(destFileName);
|
// }
|
||||||
if (fis == null) return AjaxResult.error("没有文件");
|
// // workbook = new HSSFWorkbook(fis);
|
||||||
|
// } catch (Exception ex) {
|
||||||
Workbook workbook = null;
|
// return AjaxResult.error(ex.getMessage());
|
||||||
|
// }
|
||||||
try {
|
//
|
||||||
if (fileName.toLowerCase().endsWith("xlsx")) {
|
// if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
|
||||||
workbook = new XSSFWorkbook(fis);
|
//
|
||||||
} else if (fileName.toLowerCase().endsWith("xls")) {
|
// /****************开始处理excel****************/
|
||||||
workbook = new HSSFWorkbook(fis);
|
// int success = 0;
|
||||||
}
|
// int fail = 0;
|
||||||
// workbook = new HSSFWorkbook(fis);
|
// Sheet sheet = null;
|
||||||
} catch (Exception ex) {
|
// try {
|
||||||
return AjaxResult.error(ex.getMessage());
|
// sheet = workbook.getSheetAt(0);
|
||||||
}
|
// int lastRowNum = sheet.getLastRowNum();//最后一行索引
|
||||||
|
// Row row = null;
|
||||||
if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
|
//
|
||||||
|
// for (int i = 1; i <= lastRowNum; i++) {
|
||||||
/****************开始处理excel****************/
|
// row = sheet.getRow(i);
|
||||||
int success = 0;
|
// //数据
|
||||||
int fail = 0;
|
// OGoodsSku sku = new OGoodsSku();
|
||||||
Sheet sheet = null;
|
// for(int c=0;c<6;c++){
|
||||||
try {
|
// Cell cell = row.getCell(c);
|
||||||
sheet = workbook.getSheetAt(0);
|
// String cellValue = "";
|
||||||
int lastRowNum = sheet.getLastRowNum();//最后一行索引
|
// if (cell != null) {
|
||||||
Row row = null;
|
// if (cell.getCellType() == CellType.STRING) {
|
||||||
|
// cellValue = cell.getStringCellValue().replace("\t", "");
|
||||||
for (int i = 1; i <= lastRowNum; i++) {
|
// } else if (cell.getCellType() == CellType.NUMERIC) {
|
||||||
row = sheet.getRow(i);
|
// cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
|
||||||
//数据
|
// }
|
||||||
OGoodsSku sku = new OGoodsSku();
|
// }
|
||||||
for(int c=0;c<6;c++){
|
// if(c == 1) {
|
||||||
Cell cell = row.getCell(c);
|
// if(StringUtils.hasText(cellValue) ){
|
||||||
String cellValue = "";
|
// sku.setOuterErpGoodsId(cellValue);
|
||||||
if (cell != null) {
|
// }else {
|
||||||
if (cell.getCellType() == CellType.STRING) {
|
// sku.setOuterErpGoodsId("0");
|
||||||
cellValue = cell.getStringCellValue().replace("\t", "");
|
// }
|
||||||
} else if (cell.getCellType() == CellType.NUMERIC) {
|
// }
|
||||||
cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
|
// if(StringUtils.hasText(cellValue)) {
|
||||||
}
|
// if (c == 0) {
|
||||||
}
|
// sku.setOuterErpSkuId(cellValue);
|
||||||
if(c == 1) {
|
// } else if (c == 2) {
|
||||||
if(StringUtils.hasText(cellValue) ){
|
// sku.setSkuCode(cellValue);
|
||||||
sku.setOuterErpGoodsId(cellValue);
|
// } else if (c == 3) {
|
||||||
}else {
|
// sku.setSkuName(cellValue);
|
||||||
sku.setOuterErpGoodsId("0");
|
// } else if (c == 4) {
|
||||||
}
|
// sku.setColorImage(cellValue);
|
||||||
}
|
// } else if (c == 5) {
|
||||||
if(StringUtils.hasText(cellValue)) {
|
// sku.setRemark(cellValue);
|
||||||
if (c == 0) {
|
// }
|
||||||
sku.setOuterErpSkuId(cellValue);
|
// }
|
||||||
} else if (c == 2) {
|
// }
|
||||||
sku.setSkuCode(cellValue);
|
// goodsService.insertGoodsSku(sku);
|
||||||
} else if (c == 3) {
|
// success++;
|
||||||
sku.setSkuName(cellValue);
|
// }
|
||||||
} else if (c == 4) {
|
//
|
||||||
sku.setColorImage(cellValue);
|
//
|
||||||
} else if (c == 5) {
|
// } catch (Exception ex) {
|
||||||
sku.setRemark(cellValue);
|
// fail++;
|
||||||
}
|
// ex.printStackTrace();
|
||||||
}
|
// }
|
||||||
}
|
// Map<String, Integer> result = new HashMap<>();
|
||||||
goodsService.insertGoodsSku(sku);
|
// result.put("success",success);
|
||||||
success++;
|
// result.put("fail",fail);
|
||||||
}
|
// return AjaxResult.success(result);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
} catch (Exception ex) {
|
|
||||||
fail++;
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
Map<String, Integer> result = new HashMap<>();
|
|
||||||
result.put("success",success);
|
|
||||||
result.put("fail",fail);
|
|
||||||
return AjaxResult.success(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,47 +1,47 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.PageQuery;
|
//import cn.qihangerp.common.PageQuery;
|
||||||
import cn.qihangerp.common.PageResult;
|
//import cn.qihangerp.common.PageResult;
|
||||||
|
//
|
||||||
import cn.qihangerp.common.AjaxResult;
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsInventory;
|
//import cn.qihangerp.module.goods.domain.OGoodsInventory;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsInventoryBatch;
|
//import cn.qihangerp.module.goods.domain.OGoodsInventoryBatch;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsInventoryBatchService;
|
//import cn.qihangerp.module.goods.service.OGoodsInventoryBatchService;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsInventoryService;
|
//import cn.qihangerp.module.goods.service.OGoodsInventoryService;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
//import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
//import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/goodsInventory")
|
//@RequestMapping("/goodsInventory")
|
||||||
public class GoodsInventoryController extends BaseController {
|
//public class GoodsInventoryController extends BaseController {
|
||||||
private final OGoodsInventoryService goodsInventoryService;
|
// private final OGoodsInventoryService goodsInventoryService;
|
||||||
private final OGoodsInventoryBatchService inventoryBatchService;
|
// private final OGoodsInventoryBatchService inventoryBatchService;
|
||||||
|
//
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public TableDataInfo list(OGoodsInventory bo, PageQuery pageQuery)
|
// public TableDataInfo list(OGoodsInventory bo, PageQuery pageQuery)
|
||||||
{
|
// {
|
||||||
PageResult<OGoodsInventory> pageResult = goodsInventoryService.queryPageList(bo, pageQuery);
|
// PageResult<OGoodsInventory> pageResult = goodsInventoryService.queryPageList(bo, pageQuery);
|
||||||
return getDataTable(pageResult);
|
// return getDataTable(pageResult);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping(value = "/{id}")
|
// @GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
OGoodsInventory goodsInventory = goodsInventoryService.getById(id);
|
// OGoodsInventory goodsInventory = goodsInventoryService.getById(id);
|
||||||
if(goodsInventory!=null) {
|
// if(goodsInventory!=null) {
|
||||||
List<OGoodsInventoryBatch> list = inventoryBatchService.list(new LambdaQueryWrapper<OGoodsInventoryBatch>().eq(OGoodsInventoryBatch::getSkuId, goodsInventory.getSkuId()));
|
// List<OGoodsInventoryBatch> list = inventoryBatchService.list(new LambdaQueryWrapper<OGoodsInventoryBatch>().eq(OGoodsInventoryBatch::getSkuId, goodsInventory.getSkuId()));
|
||||||
return AjaxResult.success(list);
|
// return AjaxResult.success(list);
|
||||||
}
|
// }
|
||||||
return success();
|
// return success();
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,67 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.PageQuery;
|
//import cn.qihangerp.common.PageQuery;
|
||||||
|
//
|
||||||
import cn.qihangerp.common.AjaxResult;
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsSupplier;
|
//import cn.qihangerp.module.goods.domain.OGoodsSupplier;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsSupplierService;
|
//import cn.qihangerp.module.goods.service.OGoodsSupplierService;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
//import org.springframework.web.bind.annotation.*;
|
||||||
|
//
|
||||||
import java.util.Arrays;
|
//import java.util.Arrays;
|
||||||
import java.util.Date;
|
//import java.util.Date;
|
||||||
|
//
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/supplier")
|
//@RequestMapping("/supplier")
|
||||||
public class GoodsSupplierController extends BaseController {
|
//public class GoodsSupplierController extends BaseController {
|
||||||
private final OGoodsSupplierService supplierService;
|
// private final OGoodsSupplierService supplierService;
|
||||||
|
//
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public TableDataInfo list(OGoodsSupplier bo, PageQuery pageQuery)
|
// public TableDataInfo list(OGoodsSupplier bo, PageQuery pageQuery)
|
||||||
{
|
// {
|
||||||
var pageList = supplierService.queryPageList(bo,pageQuery);
|
// var pageList = supplierService.queryPageList(bo,pageQuery);
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取【请填写功能名称】详细信息
|
// * 获取【请填写功能名称】详细信息
|
||||||
*/
|
// */
|
||||||
@GetMapping(value = "/{id}")
|
// @GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
// {
|
||||||
return success(supplierService.getById(id));
|
// return success(supplierService.getById(id));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 新增【请填写功能名称】
|
// * 新增【请填写功能名称】
|
||||||
*/
|
// */
|
||||||
@PostMapping
|
// @PostMapping
|
||||||
public AjaxResult add(@RequestBody OGoodsSupplier scmSupplier)
|
// public AjaxResult add(@RequestBody OGoodsSupplier scmSupplier)
|
||||||
{
|
// {
|
||||||
scmSupplier.setCreatetime(new Date());
|
// scmSupplier.setCreatetime(new Date());
|
||||||
scmSupplier.setIsdelete(0);
|
// scmSupplier.setIsdelete(0);
|
||||||
return toAjax(supplierService.save(scmSupplier));
|
// return toAjax(supplierService.save(scmSupplier));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改【请填写功能名称】
|
// * 修改【请填写功能名称】
|
||||||
*/
|
// */
|
||||||
@PutMapping
|
// @PutMapping
|
||||||
public AjaxResult edit(@RequestBody OGoodsSupplier scmSupplier)
|
// public AjaxResult edit(@RequestBody OGoodsSupplier scmSupplier)
|
||||||
{
|
// {
|
||||||
return toAjax(supplierService.updateById(scmSupplier));
|
// return toAjax(supplierService.updateById(scmSupplier));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 删除【请填写功能名称】
|
// * 删除【请填写功能名称】
|
||||||
*/
|
// */
|
||||||
@DeleteMapping("/{ids}")
|
// @DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
// {
|
||||||
return toAjax(supplierService.removeByIds(Arrays.stream(ids).toList()));
|
// return toAjax(supplierService.removeByIds(Arrays.stream(ids).toList()));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,113 +1,113 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.AjaxResult;
|
|
||||||
import cn.qihangerp.common.PageQuery;
|
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
|
||||||
|
|
||||||
import cn.qihangerp.module.order.service.OOrderItemService;
|
|
||||||
import cn.qihangerp.module.order.service.OOrderService;
|
|
||||||
import cn.qihangerp.request.OrderSearchRequest;
|
|
||||||
import cn.qihangerp.security.common.BaseController;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺订单Controller
|
|
||||||
*
|
|
||||||
* @author qihang
|
|
||||||
* @date 2023-12-31
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/order")
|
|
||||||
public class OrderController extends BaseController
|
|
||||||
{
|
|
||||||
|
|
||||||
private final OOrderService orderService;
|
|
||||||
private final OOrderItemService orderItemService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询店铺订单列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('shop:order:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(OrderSearchRequest bo, PageQuery pageQuery)
|
|
||||||
{
|
|
||||||
var pageList = orderService.queryPageList(bo,pageQuery);
|
|
||||||
return getDataTable(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺订单详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('shop:order:query')")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
||||||
{
|
|
||||||
return success(orderService.queryDetailById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 推送订单到ERP
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/pushErp/{ids}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
|
||||||
// for (Long id : ids) {
|
|
||||||
// OOrder oOrder = orderService.getById(id);
|
|
||||||
// if (oOrder != null) {
|
|
||||||
// oOrder.setItemList(orderItemService.getOrderItemListByOrderId(id));
|
|
||||||
// ResultVo resultVo = erpPushHelper.pushOrderSingle(oOrder);
|
|
||||||
// OOrder pushUpdate = new OOrder();
|
|
||||||
// if (oOrder.getOrderStatus() == 1 || oOrder.getOrderStatus() == 2 || oOrder.getOrderStatus() == 3) {
|
|
||||||
// // 待发货、已发货、已完成 订单推送
|
|
||||||
// pushUpdate.setErpPushStatus(resultVo.getCode() == 0 ? 200 : resultVo.getCode());
|
|
||||||
//
|
//
|
||||||
// } else if (oOrder.getOrderStatus() == 11) {
|
|
||||||
// pushUpdate.setErpPushStatus(resultVo.getCode() == 0 ? 100 : resultVo.getCode());//推送状态200 订单推送成功 100 取消订单推送成功
|
|
||||||
// }
|
|
||||||
// pushUpdate.setErpPushResult(resultVo.getMsg());
|
|
||||||
// pushUpdate.setErpPushTime(new Date());
|
|
||||||
// pushUpdate.setUpdateBy("手动推送到ERP");
|
|
||||||
// pushUpdate.setUpdateTime(new Date());
|
|
||||||
// pushUpdate.setId(id.toString());
|
|
||||||
// orderService.updateById(pushUpdate);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
// @PostMapping
|
|
||||||
// public AjaxResult add(@RequestBody OrderCreateBo order)
|
|
||||||
// {
|
|
||||||
// if(order.getGoodsAmount()==null)return new AjaxResult(1503,"请填写商品价格!");
|
|
||||||
//
|
//
|
||||||
// int result = orderService.insertErpOrder(order,getUsername());
|
//
|
||||||
// if(result == -1) return new AjaxResult(501,"订单号已存在!");
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
// if(result == -2) return new AjaxResult(502,"请添加订单商品!");
|
//import cn.qihangerp.common.PageQuery;
|
||||||
// if(result == -3) return new AjaxResult(503,"请完善订单商品明细!");
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
// if(result == -4) return new AjaxResult(504,"请选择店铺!");
|
//
|
||||||
// return toAjax(result);
|
//import cn.qihangerp.module.order.service.OOrderItemService;
|
||||||
// }
|
//import cn.qihangerp.module.order.service.OOrderService;
|
||||||
|
//import cn.qihangerp.request.OrderSearchRequest;
|
||||||
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
|
//import lombok.AllArgsConstructor;
|
||||||
|
//import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
//import org.springframework.web.bind.annotation.*;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 店铺订单Controller
|
||||||
|
// *
|
||||||
|
// * @author qihang
|
||||||
|
// * @date 2023-12-31
|
||||||
|
// */
|
||||||
|
//@AllArgsConstructor
|
||||||
|
//@RestController
|
||||||
|
//@RequestMapping("/order")
|
||||||
|
//public class OrderController extends BaseController
|
||||||
|
//{
|
||||||
|
//
|
||||||
|
// private final OOrderService orderService;
|
||||||
|
// private final OOrderItemService orderItemService;
|
||||||
|
//
|
||||||
// /**
|
// /**
|
||||||
// * 订单发货
|
// * 查询店铺订单列表
|
||||||
// * @param order
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('shop:order:list')")
|
||||||
|
// @GetMapping("/list")
|
||||||
|
// public TableDataInfo list(OrderSearchRequest bo, PageQuery pageQuery)
|
||||||
|
// {
|
||||||
|
// var pageList = orderService.queryPageList(bo,pageQuery);
|
||||||
|
// return getDataTable(pageList);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取店铺订单详细信息
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('shop:order:query')")
|
||||||
|
// @GetMapping(value = "/{id}")
|
||||||
|
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
// {
|
||||||
|
// return success(orderService.queryDetailById(id));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 推送订单到ERP
|
||||||
|
// * @param ids
|
||||||
// * @return
|
// * @return
|
||||||
// */
|
// */
|
||||||
// @Log(title = "店铺订单", businessType = BusinessType.UPDATE)
|
// @PostMapping("/pushErp/{ids}")
|
||||||
// @PostMapping("/ship")
|
// public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
// public AjaxResult ship(@RequestBody ErpOrder order)
|
//// for (Long id : ids) {
|
||||||
// {
|
//// OOrder oOrder = orderService.getById(id);
|
||||||
// order.setUpdateBy(getUsername());
|
//// if (oOrder != null) {
|
||||||
// int result = orderService.shipErpOrder(order);
|
//// oOrder.setItemList(orderItemService.getOrderItemListByOrderId(id));
|
||||||
// if(result == -1) return new AjaxResult(501,"订单不存在!");
|
//// ResultVo resultVo = erpPushHelper.pushOrderSingle(oOrder);
|
||||||
// else if(result == -2) return new AjaxResult(502,"订单号已存在!");
|
//// OOrder pushUpdate = new OOrder();
|
||||||
// return toAjax(result);
|
//// if (oOrder.getOrderStatus() == 1 || oOrder.getOrderStatus() == 2 || oOrder.getOrderStatus() == 3) {
|
||||||
|
//// // 待发货、已发货、已完成 订单推送
|
||||||
|
//// pushUpdate.setErpPushStatus(resultVo.getCode() == 0 ? 200 : resultVo.getCode());
|
||||||
|
////
|
||||||
|
//// } else if (oOrder.getOrderStatus() == 11) {
|
||||||
|
//// pushUpdate.setErpPushStatus(resultVo.getCode() == 0 ? 100 : resultVo.getCode());//推送状态200 订单推送成功 100 取消订单推送成功
|
||||||
|
//// }
|
||||||
|
//// pushUpdate.setErpPushResult(resultVo.getMsg());
|
||||||
|
//// pushUpdate.setErpPushTime(new Date());
|
||||||
|
//// pushUpdate.setUpdateBy("手动推送到ERP");
|
||||||
|
//// pushUpdate.setUpdateTime(new Date());
|
||||||
|
//// pushUpdate.setId(id.toString());
|
||||||
|
//// orderService.updateById(pushUpdate);
|
||||||
|
//// }
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
// return success();
|
||||||
// }
|
// }
|
||||||
|
//// @PostMapping
|
||||||
}
|
//// public AjaxResult add(@RequestBody OrderCreateBo order)
|
||||||
|
//// {
|
||||||
|
//// if(order.getGoodsAmount()==null)return new AjaxResult(1503,"请填写商品价格!");
|
||||||
|
////
|
||||||
|
//// int result = orderService.insertErpOrder(order,getUsername());
|
||||||
|
//// if(result == -1) return new AjaxResult(501,"订单号已存在!");
|
||||||
|
//// if(result == -2) return new AjaxResult(502,"请添加订单商品!");
|
||||||
|
//// if(result == -3) return new AjaxResult(503,"请完善订单商品明细!");
|
||||||
|
//// if(result == -4) return new AjaxResult(504,"请选择店铺!");
|
||||||
|
//// return toAjax(result);
|
||||||
|
//// }
|
||||||
|
//// /**
|
||||||
|
//// * 订单发货
|
||||||
|
//// * @param order
|
||||||
|
//// * @return
|
||||||
|
//// */
|
||||||
|
//// @Log(title = "店铺订单", businessType = BusinessType.UPDATE)
|
||||||
|
//// @PostMapping("/ship")
|
||||||
|
//// public AjaxResult ship(@RequestBody ErpOrder order)
|
||||||
|
//// {
|
||||||
|
//// order.setUpdateBy(getUsername());
|
||||||
|
//// int result = orderService.shipErpOrder(order);
|
||||||
|
//// if(result == -1) return new AjaxResult(501,"订单不存在!");
|
||||||
|
//// else if(result == -2) return new AjaxResult(502,"订单号已存在!");
|
||||||
|
//// return toAjax(result);
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,54 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.PageQuery;
|
//import cn.qihangerp.common.PageQuery;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.order.domain.bo.OrderItemListBo;
|
//import cn.qihangerp.module.order.domain.bo.OrderItemListBo;
|
||||||
import cn.qihangerp.module.order.service.OOrderItemService;
|
//import cn.qihangerp.module.order.service.OOrderItemService;
|
||||||
import cn.qihangerp.module.order.service.OOrderService;
|
//import cn.qihangerp.module.order.service.OOrderService;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
//import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* 店铺订单Controller
|
// * 店铺订单Controller
|
||||||
*
|
// *
|
||||||
* @author qihang
|
// * @author qihang
|
||||||
* @date 2023-12-31
|
// * @date 2023-12-31
|
||||||
*/
|
// */
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/order")
|
//@RequestMapping("/order")
|
||||||
public class OrderItemController extends BaseController
|
//public class OrderItemController extends BaseController
|
||||||
{
|
//{
|
||||||
private final OOrderItemService itemService;
|
// private final OOrderItemService itemService;
|
||||||
private final OOrderService orderService;
|
// private final OOrderService orderService;
|
||||||
|
//
|
||||||
/**
|
|
||||||
* 查询店铺订单列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/item_list")
|
|
||||||
public TableDataInfo list(OrderItemListBo bo, PageQuery pageQuery)
|
|
||||||
{
|
|
||||||
var pageList = itemService.selectPageVo(pageQuery,bo);
|
|
||||||
return getDataTable(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 更新erp sku id
|
// * 查询店铺订单列表
|
||||||
// * @param orderItem
|
|
||||||
// * @return
|
|
||||||
// */
|
// */
|
||||||
// @PostMapping("/updateErpSkuId")
|
// @GetMapping("/item_list")
|
||||||
// public AjaxResult ship(@RequestBody OOrderItem orderItem)
|
// public TableDataInfo list(OrderItemListBo bo, PageQuery pageQuery)
|
||||||
// {
|
// {
|
||||||
// if(StringUtils.isEmpty(orderItem.getId()) || orderItem.getGoodsSkuId()==null){
|
// var pageList = itemService.selectPageVo(pageQuery,bo);
|
||||||
// return AjaxResult.error("确少必要参数");
|
// return getDataTable(pageList);
|
||||||
// }
|
|
||||||
// itemService.updateErpSkuId(orderItem.getId(), orderItem.getGoodsSkuId());
|
|
||||||
// return AjaxResult.success();
|
|
||||||
// }
|
// }
|
||||||
}
|
//
|
||||||
|
//// /**
|
||||||
|
//// * 更新erp sku id
|
||||||
|
//// * @param orderItem
|
||||||
|
//// * @return
|
||||||
|
//// */
|
||||||
|
//// @PostMapping("/updateErpSkuId")
|
||||||
|
//// public AjaxResult ship(@RequestBody OOrderItem orderItem)
|
||||||
|
//// {
|
||||||
|
//// if(StringUtils.isEmpty(orderItem.getId()) || orderItem.getGoodsSkuId()==null){
|
||||||
|
//// return AjaxResult.error("确少必要参数");
|
||||||
|
//// }
|
||||||
|
//// itemService.updateErpSkuId(orderItem.getId(), orderItem.getGoodsSkuId());
|
||||||
|
//// return AjaxResult.success();
|
||||||
|
//// }
|
||||||
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,90 +1,90 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.AjaxResult;
|
|
||||||
import cn.qihangerp.common.PageQuery;
|
|
||||||
import cn.qihangerp.common.ResultVo;
|
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
|
||||||
import cn.qihangerp.module.order.domain.bo.RefundProcessingBo;
|
|
||||||
import cn.qihangerp.module.order.domain.bo.RefundSearchBo;
|
|
||||||
import cn.qihangerp.module.order.service.ORefundService;
|
|
||||||
import cn.qihangerp.security.common.BaseController;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 退换货Controller
|
|
||||||
*
|
|
||||||
* @author qihang
|
|
||||||
* @date 2024-01-13
|
|
||||||
*/
|
|
||||||
@AllArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/refund")
|
|
||||||
public class RefundController extends BaseController
|
|
||||||
{
|
|
||||||
|
|
||||||
private final ORefundService refundService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询退换货列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('api:returned:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(RefundSearchBo bo, PageQuery pageQuery)
|
|
||||||
{
|
|
||||||
var pageList = refundService.queryPageList(bo,pageQuery);
|
|
||||||
return getDataTable(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取退换货详细信息
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('api:returned:query')")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
||||||
{
|
|
||||||
return success(refundService.selectById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 推送退款到ERP
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/pushErp/{ids}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
|
||||||
{
|
|
||||||
// for (Long id:ids) {
|
|
||||||
// ORefund ORefund = refundService.selectById(id);
|
|
||||||
// if(ORefund!=null) {
|
|
||||||
//
|
//
|
||||||
// ResultVo resultVo = erpPushHelper.pushRefundSingle(ORefund);
|
//
|
||||||
// ORefund pushUpdate = new ORefund();
|
//
|
||||||
// pushUpdate.setErpPushStatus(resultVo.getCode()== 0 ? 200:resultVo.getCode());
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
// pushUpdate.setErpPushResult(resultVo.getMsg());
|
//import cn.qihangerp.common.PageQuery;
|
||||||
// pushUpdate.setErpPushTime(new Date());
|
//import cn.qihangerp.common.ResultVo;
|
||||||
// pushUpdate.setUpdateBy("手动推送到ERP");
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
// pushUpdate.setUpdateTime(new Date());
|
//import cn.qihangerp.module.order.domain.bo.RefundProcessingBo;
|
||||||
// pushUpdate.setId(id.toString());
|
//import cn.qihangerp.module.order.domain.bo.RefundSearchBo;
|
||||||
// refundService.updateById(pushUpdate);
|
//import cn.qihangerp.module.order.service.ORefundService;
|
||||||
// }
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
// }
|
//import lombok.AllArgsConstructor;
|
||||||
|
//import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
return success();
|
//import org.springframework.web.bind.annotation.*;
|
||||||
}
|
//
|
||||||
|
///**
|
||||||
|
// * 退换货Controller
|
||||||
@PostMapping("/processing")
|
// *
|
||||||
public AjaxResult refundProcessing(@RequestBody RefundProcessingBo bo ) {
|
// * @author qihang
|
||||||
if (bo.getRefundId() == null) return AjaxResult.error(500, "缺少参数refundId");
|
// * @date 2024-01-13
|
||||||
ResultVo<Long> resultVo = refundService.refundProcessing(bo,getUsername());
|
// */
|
||||||
if(resultVo.getCode() == 0) return success();
|
//@AllArgsConstructor
|
||||||
else return AjaxResult.error(resultVo.getMsg());
|
//@RestController
|
||||||
}
|
//@RequestMapping("/refund")
|
||||||
}
|
//public class RefundController extends BaseController
|
||||||
|
//{
|
||||||
|
//
|
||||||
|
// private final ORefundService refundService;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 查询退换货列表
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('api:returned:list')")
|
||||||
|
// @GetMapping("/list")
|
||||||
|
// public TableDataInfo list(RefundSearchBo bo, PageQuery pageQuery)
|
||||||
|
// {
|
||||||
|
// var pageList = refundService.queryPageList(bo,pageQuery);
|
||||||
|
// return getDataTable(pageList);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取退换货详细信息
|
||||||
|
// */
|
||||||
|
// @PreAuthorize("@ss.hasPermi('api:returned:query')")
|
||||||
|
// @GetMapping(value = "/{id}")
|
||||||
|
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
// {
|
||||||
|
// return success(refundService.selectById(id));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 推送退款到ERP
|
||||||
|
// * @param ids
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/pushErp/{ids}")
|
||||||
|
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
// {
|
||||||
|
//// for (Long id:ids) {
|
||||||
|
//// ORefund ORefund = refundService.selectById(id);
|
||||||
|
//// if(ORefund!=null) {
|
||||||
|
////
|
||||||
|
//// ResultVo resultVo = erpPushHelper.pushRefundSingle(ORefund);
|
||||||
|
//// ORefund pushUpdate = new ORefund();
|
||||||
|
//// pushUpdate.setErpPushStatus(resultVo.getCode()== 0 ? 200:resultVo.getCode());
|
||||||
|
//// pushUpdate.setErpPushResult(resultVo.getMsg());
|
||||||
|
//// pushUpdate.setErpPushTime(new Date());
|
||||||
|
//// pushUpdate.setUpdateBy("手动推送到ERP");
|
||||||
|
//// pushUpdate.setUpdateTime(new Date());
|
||||||
|
//// pushUpdate.setId(id.toString());
|
||||||
|
//// refundService.updateById(pushUpdate);
|
||||||
|
//// }
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
// return success();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @PostMapping("/processing")
|
||||||
|
// public AjaxResult refundProcessing(@RequestBody RefundProcessingBo bo ) {
|
||||||
|
// if (bo.getRefundId() == null) return AjaxResult.error(500, "缺少参数refundId");
|
||||||
|
// ResultVo<Long> resultVo = refundService.refundProcessing(bo,getUsername());
|
||||||
|
// if(resultVo.getCode() == 0) return success();
|
||||||
|
// else return AjaxResult.error(resultVo.getMsg());
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,58 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
//
|
||||||
|
//
|
||||||
import cn.qihangerp.common.AjaxResult;
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
import cn.qihangerp.common.PageQuery;
|
//import cn.qihangerp.common.PageQuery;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.order.domain.bo.ShipStockUpBo;
|
//import cn.qihangerp.module.order.domain.bo.ShipStockUpBo;
|
||||||
import cn.qihangerp.module.order.domain.bo.ShipStockUpCompleteBo;
|
//import cn.qihangerp.module.order.domain.bo.ShipStockUpCompleteBo;
|
||||||
import cn.qihangerp.module.order.service.OShipStockUpService;
|
//import cn.qihangerp.module.order.service.OShipStockUpService;
|
||||||
import cn.qihangerp.module.order.service.OShipWaybillService;
|
//import cn.qihangerp.module.order.service.OShipWaybillService;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
import lombok.AllArgsConstructor;
|
//import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
//import org.springframework.web.bind.annotation.*;
|
||||||
|
//
|
||||||
@AllArgsConstructor
|
//@AllArgsConstructor
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/ship")
|
//@RequestMapping("/ship")
|
||||||
public class ShipStockupController extends BaseController {
|
//public class ShipStockupController extends BaseController {
|
||||||
private final OShipStockUpService shipStockUpService;
|
// private final OShipStockUpService shipStockUpService;
|
||||||
private final OShipWaybillService shipWaybillService;
|
// private final OShipWaybillService shipWaybillService;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 备货列表
|
// * 备货列表
|
||||||
* @param bo
|
// * @param bo
|
||||||
* @param pageQuery
|
// * @param pageQuery
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@GetMapping("/stock_up_list")
|
// @GetMapping("/stock_up_list")
|
||||||
public TableDataInfo stock_up_list(ShipStockUpBo bo, PageQuery pageQuery)
|
// public TableDataInfo stock_up_list(ShipStockUpBo bo, PageQuery pageQuery)
|
||||||
{
|
// {
|
||||||
var pageList = shipStockUpService.queryPageList(bo,pageQuery);
|
// var pageList = shipStockUpService.queryPageList(bo,pageQuery);
|
||||||
return getDataTable(pageList);
|
// return getDataTable(pageList);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PostMapping("/stock_up_complete")
|
// @PostMapping("/stock_up_complete")
|
||||||
public AjaxResult stock_up_complete(@RequestBody ShipStockUpCompleteBo bo)
|
// public AjaxResult stock_up_complete(@RequestBody ShipStockUpCompleteBo bo)
|
||||||
{
|
// {
|
||||||
int result = shipStockUpService.stockUpComplete(bo);
|
// int result = shipStockUpService.stockUpComplete(bo);
|
||||||
if(result == -1) return AjaxResult.error("参数错误:orderItemIds为空");
|
// if(result == -1) return AjaxResult.error("参数错误:orderItemIds为空");
|
||||||
if(result == -2) return AjaxResult.error("参数错误:没有要添加的");
|
// if(result == -2) return AjaxResult.error("参数错误:没有要添加的");
|
||||||
else if(result == -1001) return AjaxResult.error("存在错误的orderItemId:状态不对不能生成出库单");
|
// else if(result == -1001) return AjaxResult.error("存在错误的orderItemId:状态不对不能生成出库单");
|
||||||
else if(result == -1002) return AjaxResult.error("存在错误的订单数据:名单明细中没有skuId请修改!");
|
// else if(result == -1002) return AjaxResult.error("存在错误的订单数据:名单明细中没有skuId请修改!");
|
||||||
//wmsStockOutEntryService.insertWmsStockOutEntry(wmsStockOutEntry)
|
// //wmsStockOutEntryService.insertWmsStockOutEntry(wmsStockOutEntry)
|
||||||
return toAjax(1);
|
// return toAjax(1);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@PostMapping("/stock_up_complete_by_order")
|
// @PostMapping("/stock_up_complete_by_order")
|
||||||
public AjaxResult stock_up_completeByOrder(@RequestBody ShipStockUpCompleteBo bo)
|
// public AjaxResult stock_up_completeByOrder(@RequestBody ShipStockUpCompleteBo bo)
|
||||||
{
|
// {
|
||||||
int result = shipStockUpService.stockUpCompleteByOrder(bo);
|
// int result = shipStockUpService.stockUpCompleteByOrder(bo);
|
||||||
if(result == -1) return AjaxResult.error("参数错误:orderItemIds为空");
|
// if(result == -1) return AjaxResult.error("参数错误:orderItemIds为空");
|
||||||
if(result == -2) return AjaxResult.error("参数错误:没有要添加的");
|
// if(result == -2) return AjaxResult.error("参数错误:没有要添加的");
|
||||||
else if(result == -1001) return AjaxResult.error("存在错误的orderItemId:状态不对不能生成出库单");
|
// else if(result == -1001) return AjaxResult.error("存在错误的orderItemId:状态不对不能生成出库单");
|
||||||
else if(result == -1002) return AjaxResult.error("存在错误的订单数据:名单明细中没有skuId请修改!");
|
// else if(result == -1002) return AjaxResult.error("存在错误的订单数据:名单明细中没有skuId请修改!");
|
||||||
//wmsStockOutEntryService.insertWmsStockOutEntry(wmsStockOutEntry)
|
// //wmsStockOutEntryService.insertWmsStockOutEntry(wmsStockOutEntry)
|
||||||
return toAjax(1);
|
// return toAjax(1);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,67 @@
|
||||||
package cn.qihangerp.oms.controller;
|
//package cn.qihangerp.oms.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.AjaxResult;
|
|
||||||
import cn.qihangerp.common.PageQuery;
|
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
|
||||||
import cn.qihangerp.module.order.domain.OShipment;
|
|
||||||
import cn.qihangerp.module.order.domain.bo.OrderShipBo;
|
|
||||||
import cn.qihangerp.module.order.service.OOrderService;
|
|
||||||
import cn.qihangerp.module.order.service.OShipmentService;
|
|
||||||
import cn.qihangerp.security.common.BaseController;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/shipping")
|
|
||||||
public class ShipmentController extends BaseController {
|
|
||||||
private final OShipmentService shippingService;
|
|
||||||
|
|
||||||
private final OOrderService orderService;
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(OShipment shipping, PageQuery pageQuery)
|
|
||||||
{
|
|
||||||
return getDataTable(shippingService.queryPageList(shipping,pageQuery));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/searchOrderConsignee")
|
|
||||||
public TableDataInfo searchOrderConsignee(String consignee)
|
|
||||||
{
|
|
||||||
return getDataTable(orderService.searchOrderConsignee(consignee));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/searchOrderItemByReceiverMobile")
|
|
||||||
public TableDataInfo searchOrderItemByReceiverMobile(String receiverMobile)
|
|
||||||
{
|
|
||||||
return getDataTable(orderService.searchOrderItemByReceiverMobile(receiverMobile));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单发货
|
|
||||||
* @param shipping
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/handShip")
|
|
||||||
public AjaxResult orderHandShip(@RequestHeader("Authorization") String authorization,@RequestBody OrderShipBo shipping)
|
|
||||||
{
|
|
||||||
|
|
||||||
var result = shippingService.handOrderShip(shipping);
|
|
||||||
// if(result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
|
||||||
// // 发货
|
|
||||||
// TaoOrderShipBo bo = new TaoOrderShipBo();
|
|
||||||
// bo.setShopId(shipping.getShopId());
|
|
||||||
//// bo.setTid(shipping.getOrderId());
|
|
||||||
// bo.setWaybillCode(shipping.getShipCode());
|
|
||||||
// bo.setWaybillCompany(shipping.getShipCompany());
|
|
||||||
//
|
//
|
||||||
// JSONObject jsonObject = taoApiService.orderShip(authorization, bo);
|
//
|
||||||
// return AjaxResult.success();
|
//import cn.qihangerp.common.AjaxResult;
|
||||||
// }else{
|
//import cn.qihangerp.common.PageQuery;
|
||||||
// return AjaxResult.error(result.getCode(),result.getMsg());
|
//import cn.qihangerp.common.TableDataInfo;
|
||||||
// }
|
//import cn.qihangerp.module.order.domain.OShipment;
|
||||||
|
//import cn.qihangerp.module.order.domain.bo.OrderShipBo;
|
||||||
return AjaxResult.success();
|
//import cn.qihangerp.module.order.service.OOrderService;
|
||||||
}
|
//import cn.qihangerp.module.order.service.OShipmentService;
|
||||||
}
|
//import cn.qihangerp.security.common.BaseController;
|
||||||
|
//import lombok.AllArgsConstructor;
|
||||||
|
//import org.springframework.web.bind.annotation.*;
|
||||||
|
//
|
||||||
|
//@AllArgsConstructor
|
||||||
|
//@RestController
|
||||||
|
//@RequestMapping("/shipping")
|
||||||
|
//public class ShipmentController extends BaseController {
|
||||||
|
// private final OShipmentService shippingService;
|
||||||
|
//
|
||||||
|
// private final OOrderService orderService;
|
||||||
|
// @GetMapping("/list")
|
||||||
|
// public TableDataInfo list(OShipment shipping, PageQuery pageQuery)
|
||||||
|
// {
|
||||||
|
// return getDataTable(shippingService.queryPageList(shipping,pageQuery));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @GetMapping("/searchOrderConsignee")
|
||||||
|
// public TableDataInfo searchOrderConsignee(String consignee)
|
||||||
|
// {
|
||||||
|
// return getDataTable(orderService.searchOrderConsignee(consignee));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @GetMapping("/searchOrderItemByReceiverMobile")
|
||||||
|
// public TableDataInfo searchOrderItemByReceiverMobile(String receiverMobile)
|
||||||
|
// {
|
||||||
|
// return getDataTable(orderService.searchOrderItemByReceiverMobile(receiverMobile));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 订单发货
|
||||||
|
// * @param shipping
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/handShip")
|
||||||
|
// public AjaxResult orderHandShip(@RequestHeader("Authorization") String authorization,@RequestBody OrderShipBo shipping)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// var result = shippingService.handOrderShip(shipping);
|
||||||
|
//// if(result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||||
|
//// // 发货
|
||||||
|
//// TaoOrderShipBo bo = new TaoOrderShipBo();
|
||||||
|
//// bo.setShopId(shipping.getShopId());
|
||||||
|
////// bo.setTid(shipping.getOrderId());
|
||||||
|
//// bo.setWaybillCode(shipping.getShipCode());
|
||||||
|
//// bo.setWaybillCompany(shipping.getShipCompany());
|
||||||
|
////
|
||||||
|
//// JSONObject jsonObject = taoApiService.orderShip(authorization, bo);
|
||||||
|
//// return AjaxResult.success();
|
||||||
|
//// }else{
|
||||||
|
//// return AjaxResult.error(result.getCode(),result.getMsg());
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
// return AjaxResult.success();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1813,7 +1813,7 @@ INSERT INTO `o_shop` VALUES (1, '天猫旗舰店测试', 100, NULL, 9, 0, 172638
|
||||||
INSERT INTO `o_shop` VALUES (2, '京东旗舰店测试', 200, NULL, 9, 0, 1726389632, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 102, NULL, 0);
|
INSERT INTO `o_shop` VALUES (2, '京东旗舰店测试', 200, NULL, 9, 0, 1726389632, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 102, NULL, 0);
|
||||||
INSERT INTO `o_shop` VALUES (3, '抖音旗舰店测试', 400, 'http://openapi.jinritemai.com', 87, 0, 1726389870, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2', 103, NULL, 0);
|
INSERT INTO `o_shop` VALUES (3, '抖音旗舰店测试', 400, 'http://openapi.jinritemai.com', 87, 0, 1726389870, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2', 103, NULL, 0);
|
||||||
INSERT INTO `o_shop` VALUES (4, '启航电商ERP拼多多店', 300, NULL, 9, 0, 1726389225, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
INSERT INTO `o_shop` VALUES (4, '启航电商ERP拼多多店', 300, NULL, 9, 0, 1726389225, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
||||||
INSERT INTO `o_shop` VALUES (5, '京东自营测试店铺', 280, NULL, 10, 0, 1726389888, NULL, 0, NULL, NULL, NULL, 31535999, NULL, 'af8befdefa064283a6b62189419d8cebzgvm', NULL, NULL, NULL, NULL, 0);
|
INSERT INTO `o_shop` VALUES (5, '京东自营测试店铺', 280, NULL, 10, 0, 1726389888, NULL, 0, NULL, NULL, NULL, 31535999, NULL, '', NULL, NULL, NULL, NULL, 0);
|
||||||
INSERT INTO `o_shop` VALUES (6, '微信小店测试', 500, NULL, 9, 0, 1730899509, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://api.weixin.qq.com/', NULL, NULL, 0);
|
INSERT INTO `o_shop` VALUES (6, '微信小店测试', 500, NULL, 9, 0, 1730899509, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://api.weixin.qq.com/', NULL, NULL, 0);
|
||||||
INSERT INTO `o_shop` VALUES (999, '线下渠道测试店铺AA', 999, NULL, 9, 1, 1730899519, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
INSERT INTO `o_shop` VALUES (999, '线下渠道测试店铺AA', 999, NULL, 9, 1, 1730899519, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
||||||
INSERT INTO `o_shop` VALUES (1001, 'aa', 100, NULL, 9, 1, 1730899353, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
INSERT INTO `o_shop` VALUES (1001, 'aa', 100, NULL, 9, 1, 1730899353, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,14 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<goods-api.version>1.1.1</goods-api.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>cn.qihangerp.module</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>goods</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>1.0</version>
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,8 @@
|
||||||
package com.zhijian;
|
package cn.qihangerp.api.goods;
|
||||||
|
|
||||||
//import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
|
//import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
|
||||||
import org.springframework.boot.SpringBootConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
||||||
import org.springframework.context.annotation.FilterType;
|
import org.springframework.context.annotation.FilterType;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -17,7 +12,7 @@ import org.springframework.context.annotation.FilterType;
|
||||||
//@EnableAutoConfiguration
|
//@EnableAutoConfiguration
|
||||||
@Configuration
|
@Configuration
|
||||||
//@EnableAutoConfiguration(exclude = MybatisAutoConfiguration.class)
|
//@EnableAutoConfiguration(exclude = MybatisAutoConfiguration.class)
|
||||||
@ComponentScan(basePackages = "com.zhijian",
|
@ComponentScan(basePackages = "cn.qihangerp.api.goods",
|
||||||
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = FrameworkAutoConfiguration.class))
|
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = GoodsApiAutoConfiguration.class))
|
||||||
public class FrameworkAutoConfiguration {
|
public class GoodsApiAutoConfiguration {
|
||||||
}
|
}
|
||||||
|
|
@ -9,11 +9,12 @@ import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@MapperScan({"cn.qihangerp.module.*.mapper"})
|
@MapperScan({"cn.qihangerp.module.*.mapper"})
|
||||||
public class MybatisPlusConfig {
|
public class GoodsApiMybatisPlusConfig {
|
||||||
@Bean
|
|
||||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
// @Bean(name = "mybatisPlusInterceptorGoodsApi")
|
||||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
// public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); //注意使用哪种数据库
|
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
return interceptor;
|
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); //注意使用哪种数据库
|
||||||
}
|
// return interceptor;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
package cn.qihangerp.oms.controller;
|
package cn.qihangerp.api.goods.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.AjaxResult;
|
import cn.qihangerp.common.AjaxResult;
|
||||||
import cn.qihangerp.common.PageQuery;
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsBrand;
|
import cn.qihangerp.module.goods.domain.OGoodsBrand;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsBrandService;
|
import cn.qihangerp.module.goods.service.OGoodsBrandService;
|
||||||
|
|
||||||
import cn.qihangerp.security.common.BaseController;
|
import cn.qihangerp.security.common.BaseController;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package cn.qihangerp.oms.controller;
|
package cn.qihangerp.api.goods.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,19 @@
|
||||||
package cn.qihangerp.oms.controller;
|
package cn.qihangerp.api.goods.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.PageQuery;
|
|
||||||
import cn.qihangerp.common.PageResult;
|
|
||||||
import cn.qihangerp.common.ResultVo;
|
|
||||||
import cn.qihangerp.common.AjaxResult;
|
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.common.*;
|
||||||
import cn.qihangerp.module.goods.domain.OGoods;
|
import cn.qihangerp.module.goods.domain.OGoods;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsSku;
|
import cn.qihangerp.module.goods.domain.OGoodsSku;
|
||||||
import cn.qihangerp.module.goods.domain.bo.GoodsAddBo;
|
import cn.qihangerp.module.goods.domain.bo.GoodsAddBo;
|
||||||
import cn.qihangerp.module.goods.domain.vo.GoodsSpecListVo;
|
import cn.qihangerp.module.goods.domain.vo.GoodsSpecListVo;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsService;
|
import cn.qihangerp.module.goods.service.OGoodsService;
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.module.goods.service.OGoodsSkuService;
|
import cn.qihangerp.module.goods.service.OGoodsSkuService;
|
||||||
import cn.qihangerp.security.common.BaseController;
|
import cn.qihangerp.security.common.BaseController;
|
||||||
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
||||||
import org.apache.poi.ss.usermodel.*;
|
|
||||||
import org.apache.poi.ss.util.NumberToTextConverter;
|
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -158,90 +143,90 @@ public class GoodsController extends BaseController
|
||||||
else return AjaxResult.error();
|
else return AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
|
// @RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
|
||||||
public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
|
// public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
|
||||||
|
//
|
||||||
String fileName = file.getOriginalFilename();
|
// String fileName = file.getOriginalFilename();
|
||||||
String dir = System.getProperty("user.dir");
|
// String dir = System.getProperty("user.dir");
|
||||||
String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
|
// String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
|
||||||
System.out.println(destFileName);
|
// System.out.println(destFileName);
|
||||||
File destFile = new File(destFileName);
|
// File destFile = new File(destFileName);
|
||||||
file.transferTo(destFile);
|
// file.transferTo(destFile);
|
||||||
InputStream fis = null;
|
// InputStream fis = null;
|
||||||
fis = new FileInputStream(destFileName);
|
// fis = new FileInputStream(destFileName);
|
||||||
if (fis == null) return AjaxResult.error("没有文件");
|
// if (fis == null) return AjaxResult.error("没有文件");
|
||||||
|
//
|
||||||
Workbook workbook = null;
|
// Workbook workbook = null;
|
||||||
|
//
|
||||||
try {
|
// try {
|
||||||
if (fileName.toLowerCase().endsWith("xlsx")) {
|
// if (fileName.toLowerCase().endsWith("xlsx")) {
|
||||||
workbook = new XSSFWorkbook(fis);
|
// workbook = new XSSFWorkbook(fis);
|
||||||
} else if (fileName.toLowerCase().endsWith("xls")) {
|
// } else if (fileName.toLowerCase().endsWith("xls")) {
|
||||||
workbook = new HSSFWorkbook(fis);
|
// workbook = new HSSFWorkbook(fis);
|
||||||
}
|
// }
|
||||||
// workbook = new HSSFWorkbook(fis);
|
// // workbook = new HSSFWorkbook(fis);
|
||||||
} catch (Exception ex) {
|
// } catch (Exception ex) {
|
||||||
return AjaxResult.error(ex.getMessage());
|
// return AjaxResult.error(ex.getMessage());
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
|
// if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
|
||||||
|
//
|
||||||
/****************开始处理excel****************/
|
// /****************开始处理excel****************/
|
||||||
int success = 0;
|
// int success = 0;
|
||||||
int fail = 0;
|
// int fail = 0;
|
||||||
Sheet sheet = null;
|
// Sheet sheet = null;
|
||||||
try {
|
// try {
|
||||||
sheet = workbook.getSheetAt(0);
|
// sheet = workbook.getSheetAt(0);
|
||||||
int lastRowNum = sheet.getLastRowNum();//最后一行索引
|
// int lastRowNum = sheet.getLastRowNum();//最后一行索引
|
||||||
Row row = null;
|
// Row row = null;
|
||||||
|
//
|
||||||
for (int i = 1; i <= lastRowNum; i++) {
|
// for (int i = 1; i <= lastRowNum; i++) {
|
||||||
row = sheet.getRow(i);
|
// row = sheet.getRow(i);
|
||||||
//数据
|
// //数据
|
||||||
OGoodsSku sku = new OGoodsSku();
|
// OGoodsSku sku = new OGoodsSku();
|
||||||
for(int c=0;c<6;c++){
|
// for(int c=0;c<6;c++){
|
||||||
Cell cell = row.getCell(c);
|
// Cell cell = row.getCell(c);
|
||||||
String cellValue = "";
|
// String cellValue = "";
|
||||||
if (cell != null) {
|
// if (cell != null) {
|
||||||
if (cell.getCellType() == CellType.STRING) {
|
// if (cell.getCellType() == CellType.STRING) {
|
||||||
cellValue = cell.getStringCellValue().replace("\t", "");
|
// cellValue = cell.getStringCellValue().replace("\t", "");
|
||||||
} else if (cell.getCellType() == CellType.NUMERIC) {
|
// } else if (cell.getCellType() == CellType.NUMERIC) {
|
||||||
cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
|
// cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if(c == 1) {
|
// if(c == 1) {
|
||||||
if(StringUtils.hasText(cellValue) ){
|
// if(StringUtils.hasText(cellValue) ){
|
||||||
sku.setOuterErpGoodsId(cellValue);
|
// sku.setOuterErpGoodsId(cellValue);
|
||||||
}else {
|
// }else {
|
||||||
sku.setOuterErpGoodsId("0");
|
// sku.setOuterErpGoodsId("0");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if(StringUtils.hasText(cellValue)) {
|
// if(StringUtils.hasText(cellValue)) {
|
||||||
if (c == 0) {
|
// if (c == 0) {
|
||||||
sku.setOuterErpSkuId(cellValue);
|
// sku.setOuterErpSkuId(cellValue);
|
||||||
} else if (c == 2) {
|
// } else if (c == 2) {
|
||||||
sku.setSkuCode(cellValue);
|
// sku.setSkuCode(cellValue);
|
||||||
} else if (c == 3) {
|
// } else if (c == 3) {
|
||||||
sku.setSkuName(cellValue);
|
// sku.setSkuName(cellValue);
|
||||||
} else if (c == 4) {
|
// } else if (c == 4) {
|
||||||
sku.setColorImage(cellValue);
|
// sku.setColorImage(cellValue);
|
||||||
} else if (c == 5) {
|
// } else if (c == 5) {
|
||||||
sku.setRemark(cellValue);
|
// sku.setRemark(cellValue);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
goodsService.insertGoodsSku(sku);
|
// goodsService.insertGoodsSku(sku);
|
||||||
success++;
|
// success++;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
} catch (Exception ex) {
|
// } catch (Exception ex) {
|
||||||
fail++;
|
// fail++;
|
||||||
ex.printStackTrace();
|
// ex.printStackTrace();
|
||||||
}
|
// }
|
||||||
Map<String, Integer> result = new HashMap<>();
|
// Map<String, Integer> result = new HashMap<>();
|
||||||
result.put("success",success);
|
// result.put("success",success);
|
||||||
result.put("fail",fail);
|
// result.put("fail",fail);
|
||||||
return AjaxResult.success(result);
|
// return AjaxResult.success(result);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package cn.qihangerp.oms.controller;
|
package cn.qihangerp.api.goods.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.PageQuery;
|
|
||||||
import cn.qihangerp.common.PageResult;
|
|
||||||
|
|
||||||
import cn.qihangerp.common.AjaxResult;
|
import cn.qihangerp.common.AjaxResult;
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
import cn.qihangerp.common.PageResult;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsInventory;
|
import cn.qihangerp.module.goods.domain.OGoodsInventory;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsInventoryBatch;
|
import cn.qihangerp.module.goods.domain.OGoodsInventoryBatch;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
package cn.qihangerp.oms.controller;
|
package cn.qihangerp.api.goods.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.qihangerp.common.PageQuery;
|
|
||||||
|
|
||||||
import cn.qihangerp.common.AjaxResult;
|
import cn.qihangerp.common.AjaxResult;
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
import cn.qihangerp.common.TableDataInfo;
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
import cn.qihangerp.module.goods.domain.OGoodsSupplier;
|
import cn.qihangerp.module.goods.domain.OGoodsSupplier;
|
||||||
import cn.qihangerp.module.goods.service.OGoodsSupplierService;
|
import cn.qihangerp.module.goods.service.OGoodsSupplierService;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.zhijian.FrameworkAutoConfiguration
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.qihangerp.api.goods.GoodsApiAutoConfiguration
|
||||||
|
|
@ -1,89 +1,4 @@
|
||||||
server:
|
qihangerp:
|
||||||
port: 8083
|
name: 启航电商ERP
|
||||||
spring:
|
goods:
|
||||||
application:
|
version: 2.4.21
|
||||||
name: oms-api
|
|
||||||
cloud:
|
|
||||||
loadbalancer:
|
|
||||||
nacos:
|
|
||||||
enabled: true
|
|
||||||
nacos:
|
|
||||||
# serverAddr: 127.0.0.1:8848
|
|
||||||
discovery:
|
|
||||||
server-addr: 127.0.0.1:8848
|
|
||||||
# username: nacos
|
|
||||||
# password: nacos
|
|
||||||
|
|
||||||
data:
|
|
||||||
# redis 配置
|
|
||||||
redis:
|
|
||||||
# 地址
|
|
||||||
# host: 8.130.98.215
|
|
||||||
host: 127.0.0.1
|
|
||||||
# 端口,默认为6379
|
|
||||||
port: 6379
|
|
||||||
# 数据库索引
|
|
||||||
database: 0
|
|
||||||
# 密码
|
|
||||||
# password: 123321
|
|
||||||
# 连接超时时间
|
|
||||||
timeout: 10s
|
|
||||||
lettuce:
|
|
||||||
pool:
|
|
||||||
# 连接池中的最小空闲连接
|
|
||||||
min-idle: 0
|
|
||||||
# 连接池中的最大空闲连接
|
|
||||||
max-idle: 8
|
|
||||||
# 连接池的最大数据库连接数
|
|
||||||
max-active: 8
|
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
|
||||||
max-wait: -1ms
|
|
||||||
datasource:
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
url: jdbc:mysql://127.0.0.1:3306/qihang-oms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
|
||||||
username: root
|
|
||||||
password: Andy_123
|
|
||||||
# kafka:
|
|
||||||
# bootstrap-servers: localhost:9092
|
|
||||||
# producer:
|
|
||||||
# batch-size: 16384 #批量大小
|
|
||||||
# acks: -1 #应答级别:多少个分区副本备份完成时向生产者发送ack确认(可选0、1、all/-1)
|
|
||||||
# retries: 10 # 消息发送重试次数
|
|
||||||
# # transaction-id-prefix: tx_1 #事务id前缀
|
|
||||||
# buffer-memory: 33554432
|
|
||||||
# key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
|
||||||
# value-serializer: org.apache.kafka.common.serialization.StringSerializer
|
|
||||||
# properties:
|
|
||||||
# linger:
|
|
||||||
# ms: 2000 #提交延迟
|
|
||||||
# # partitioner: #指定分区器
|
|
||||||
# # class: com.example.kafkademo.config.CustomizePartitioner
|
|
||||||
# consumer:
|
|
||||||
# group-id: testGroup #默认的消费组ID
|
|
||||||
# enable-auto-commit: true #是否自动提交offset
|
|
||||||
# auto-commit-interval: 2000 #提交offset延时
|
|
||||||
# # 当kafka中没有初始offset或offset超出范围时将自动重置offset
|
|
||||||
# # earliest:重置为分区中最小的offset;
|
|
||||||
# # latest:重置为分区中最新的offset(消费分区中新产生的数据);
|
|
||||||
# # none:只要有一个分区不存在已提交的offset,就抛出异常;
|
|
||||||
# auto-offset-reset: latest
|
|
||||||
# max-poll-records: 500 #单次拉取消息的最大条数
|
|
||||||
# key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
|
||||||
# value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
|
||||||
# properties:
|
|
||||||
# session:
|
|
||||||
# timeout:
|
|
||||||
# ms: 120000 # 消费会话超时时间(超过这个时间 consumer 没有发送心跳,就会触发 rebalance 操作)
|
|
||||||
# request:
|
|
||||||
# timeout:
|
|
||||||
# ms: 18000 # 消费请求的超时时间
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mybatis-plus:
|
|
||||||
mapper-locations: classpath*:mapper/**/*Mapper.xml
|
|
||||||
type-aliases-package: cn.qihangerp.oms.domain;cn.qihangerp.module.domain;cn.qihangerp.security.entity;
|
|
||||||
configuration:
|
|
||||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 开启sql日志
|
|
||||||
|
|
@ -1,24 +1,10 @@
|
||||||
Application Version: ${zhijian.version}
|
Application Version: 2.4.21
|
||||||
Spring Boot Version: ${spring-boot.version}
|
Spring Boot Version: ${spring-boot.version}
|
||||||
////////////////////////////////////////////////////////////////////
|
_______ _________ _______ _ _______ _______ _______ _______
|
||||||
// _ooOoo_ //
|
( ___ )\__ __/|\ /|( ___ )( ( /|( ____ \( ____ \( ____ )( ____ )
|
||||||
// o8888888o //
|
| ( ) | ) ( | ) ( || ( ) || \ ( || ( \/| ( \/| ( )|| ( )|
|
||||||
// 88" . "88 //
|
| | | | | | | (___) || (___) || \ | || | | (__ | (____)|| (____)|
|
||||||
// (| ^_^ |) //
|
| | | | | | | ___ || ___ || (\ \) || | ____ | __) | __)| _____)
|
||||||
// O\ = /O //
|
| | /\| | | | | ( ) || ( ) || | \ || | \_ )| ( | (\ ( | (
|
||||||
// ____/`---'\____ //
|
| (_\ \ |___) (___| ) ( || ) ( || ) \ || (___) || (____/\| ) \ \__| )
|
||||||
// .' \\| |// `. //
|
(____\/_)\_______/|/ \||/ \||/ )_)(_______)(_______/|/ \__/|/
|
||||||
// / \\||| : |||// \ //
|
|
||||||
// / _||||| -:- |||||- \ //
|
|
||||||
// | | \\\ - /// | | //
|
|
||||||
// | \_| ''\---/'' | | //
|
|
||||||
// \ .-\__ `-` ___/-. / //
|
|
||||||
// ___`. .' /--.--\ `. . ___ //
|
|
||||||
// ."" '< `.___\_<|>_/___.' >'"". //
|
|
||||||
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
|
|
||||||
// \ \ `-. \_ __\ /__ _/ .-` / / //
|
|
||||||
// ========`-.____`-.___\_____/___.-`____.-'======== //
|
|
||||||
// `=---=' //
|
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
|
|
||||||
// 佛祖保佑 永不宕机 永无BUG //
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.qihangerp.services</groupId>
|
||||||
|
<artifactId>microservices</artifactId>
|
||||||
|
<version>1.0.6</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>order-api</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>order-api</name>
|
||||||
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qihangerp.module</groupId>
|
||||||
|
<artifactId>order</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package cn.qihangerp.api.order;
|
||||||
|
|
||||||
|
//import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
|
||||||
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.FilterType;
|
||||||
|
|
||||||
|
|
||||||
|
//@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class ,MybatisAutoConfiguration.class})
|
||||||
|
//@ComponentScan
|
||||||
|
//@Configuration
|
||||||
|
//@EnableAutoConfiguration
|
||||||
|
@Configuration
|
||||||
|
//@EnableAutoConfiguration(exclude = MybatisAutoConfiguration.class)
|
||||||
|
@ComponentScan(basePackages = "cn.qihangerp.api.order",
|
||||||
|
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = OrderApiAutoConfiguration.class))
|
||||||
|
public class OrderApiAutoConfiguration {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package cn.qihangerp.api.order.config;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@MapperScan({"cn.qihangerp.module.*.mapper"})
|
||||||
|
public class OrderApiMybatisPlusConfig {
|
||||||
|
|
||||||
|
// @Bean(name = "mybatisPlusInterceptorGoodsApi")
|
||||||
|
// public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); //注意使用哪种数据库
|
||||||
|
// return interceptor;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
package cn.qihangerp.api.order.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
import cn.qihangerp.common.PageResult;
|
||||||
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
|
import cn.qihangerp.module.order.domain.OAfterSale;
|
||||||
|
import cn.qihangerp.module.order.service.OAfterSaleService;
|
||||||
|
import cn.qihangerp.security.common.BaseController;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/afterSale")
|
||||||
|
public class AfterSaleProcessingController extends BaseController {
|
||||||
|
private final OAfterSaleService afterSaleService;
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo ship_again_list(OAfterSale bo, PageQuery pageQuery)
|
||||||
|
{
|
||||||
|
//private final OAfterSaleMapper mapper;
|
||||||
|
// @Override
|
||||||
|
// public PageResult<OAfterSale> queryPageList(OAfterSale bo, PageQuery pageQuery) {
|
||||||
|
// LambdaQueryWrapper<OAfterSale> queryWrapper = new LambdaQueryWrapper<OAfterSale>().
|
||||||
|
// eq( OAfterSale::getType, bo.getType())
|
||||||
|
// .eq(bo.getShopId() != null, OAfterSale::getShopId, bo.getShopId());
|
||||||
|
//
|
||||||
|
// Page<OAfterSale> pages = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||||
|
// return PageResult.build(pages);
|
||||||
|
// }
|
||||||
|
// bo.setType(80);
|
||||||
|
PageResult<OAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
|
return getDataTable(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @PostMapping("/shipAgain")
|
||||||
|
// public AjaxResult shipAgainAdd(@RequestBody ErpAfterSale addBo)
|
||||||
|
// {
|
||||||
|
// addBo.setType(80);
|
||||||
|
// addBo.setCreateTime(new Date());
|
||||||
|
// addBo.setCreateBy("手动添加");
|
||||||
|
// addBo.setStatus(1);
|
||||||
|
// var result = afterSaleService.save(addBo);
|
||||||
|
// return toAjax(result);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @PutMapping("/shipAgain/complete/{id}")
|
||||||
|
// public AjaxResult completeShipAgain(@PathVariable Long id)
|
||||||
|
// {
|
||||||
|
// ErpAfterSale complete = new ErpAfterSale();
|
||||||
|
// complete.setId(id.toString());
|
||||||
|
// complete.setStatus(2);
|
||||||
|
// complete.setUpdateTime(new Date());
|
||||||
|
// complete.setUpdateBy("手动完成");
|
||||||
|
// afterSaleService.updateById(complete);
|
||||||
|
// return toAjax(1);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @GetMapping("/returned_list")
|
||||||
|
// public TableDataInfo returned_list(ErpAfterSale bo, PageQuery pageQuery)
|
||||||
|
// {
|
||||||
|
// bo.setType(10);
|
||||||
|
// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
|
// return getDataTable(result);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @GetMapping("/exchange_list")
|
||||||
|
// public TableDataInfo exchange_list(ErpAfterSale bo, PageQuery pageQuery)
|
||||||
|
// {
|
||||||
|
// bo.setType(20);
|
||||||
|
// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
|
// return getDataTable(result);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @PostMapping("/exchange")
|
||||||
|
// public AjaxResult exchangeAdd(@RequestBody ErpAfterSale addBo)
|
||||||
|
// {
|
||||||
|
// addBo.setType(20);
|
||||||
|
// addBo.setCreateTime(new Date());
|
||||||
|
// addBo.setCreateBy("手动添加");
|
||||||
|
// addBo.setStatus(1);
|
||||||
|
// var result = afterSaleService.save(addBo);
|
||||||
|
// return toAjax(result);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @GetMapping("/intercept_list")
|
||||||
|
// public TableDataInfo intercept_list(ErpAfterSale bo, PageQuery pageQuery)
|
||||||
|
// {
|
||||||
|
// bo.setType(99);
|
||||||
|
// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, pageQuery);
|
||||||
|
// return getDataTable(result);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
package cn.qihangerp.api.order.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.common.AjaxResult;
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
|
import cn.qihangerp.module.order.service.OOrderItemService;
|
||||||
|
import cn.qihangerp.module.order.service.OOrderService;
|
||||||
|
import cn.qihangerp.request.OrderSearchRequest;
|
||||||
|
import cn.qihangerp.security.common.BaseController;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺订单Controller
|
||||||
|
*
|
||||||
|
* @author qihang
|
||||||
|
* @date 2023-12-31
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/order")
|
||||||
|
public class OrderController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
private final OOrderService orderService;
|
||||||
|
private final OOrderItemService orderItemService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店铺订单列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('shop:order:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(OrderSearchRequest bo, PageQuery pageQuery)
|
||||||
|
{
|
||||||
|
var pageList = orderService.queryPageList(bo,pageQuery);
|
||||||
|
return getDataTable(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取店铺订单详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('shop:order:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(orderService.queryDetailById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送订单到ERP
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/pushErp/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
// for (Long id : ids) {
|
||||||
|
// OOrder oOrder = orderService.getById(id);
|
||||||
|
// if (oOrder != null) {
|
||||||
|
// oOrder.setItemList(orderItemService.getOrderItemListByOrderId(id));
|
||||||
|
// ResultVo resultVo = erpPushHelper.pushOrderSingle(oOrder);
|
||||||
|
// OOrder pushUpdate = new OOrder();
|
||||||
|
// if (oOrder.getOrderStatus() == 1 || oOrder.getOrderStatus() == 2 || oOrder.getOrderStatus() == 3) {
|
||||||
|
// // 待发货、已发货、已完成 订单推送
|
||||||
|
// pushUpdate.setErpPushStatus(resultVo.getCode() == 0 ? 200 : resultVo.getCode());
|
||||||
|
//
|
||||||
|
// } else if (oOrder.getOrderStatus() == 11) {
|
||||||
|
// pushUpdate.setErpPushStatus(resultVo.getCode() == 0 ? 100 : resultVo.getCode());//推送状态200 订单推送成功 100 取消订单推送成功
|
||||||
|
// }
|
||||||
|
// pushUpdate.setErpPushResult(resultVo.getMsg());
|
||||||
|
// pushUpdate.setErpPushTime(new Date());
|
||||||
|
// pushUpdate.setUpdateBy("手动推送到ERP");
|
||||||
|
// pushUpdate.setUpdateTime(new Date());
|
||||||
|
// pushUpdate.setId(id.toString());
|
||||||
|
// orderService.updateById(pushUpdate);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
// @PostMapping
|
||||||
|
// public AjaxResult add(@RequestBody OrderCreateBo order)
|
||||||
|
// {
|
||||||
|
// if(order.getGoodsAmount()==null)return new AjaxResult(1503,"请填写商品价格!");
|
||||||
|
//
|
||||||
|
// int result = orderService.insertErpOrder(order,getUsername());
|
||||||
|
// if(result == -1) return new AjaxResult(501,"订单号已存在!");
|
||||||
|
// if(result == -2) return new AjaxResult(502,"请添加订单商品!");
|
||||||
|
// if(result == -3) return new AjaxResult(503,"请完善订单商品明细!");
|
||||||
|
// if(result == -4) return new AjaxResult(504,"请选择店铺!");
|
||||||
|
// return toAjax(result);
|
||||||
|
// }
|
||||||
|
// /**
|
||||||
|
// * 订单发货
|
||||||
|
// * @param order
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @Log(title = "店铺订单", businessType = BusinessType.UPDATE)
|
||||||
|
// @PostMapping("/ship")
|
||||||
|
// public AjaxResult ship(@RequestBody ErpOrder order)
|
||||||
|
// {
|
||||||
|
// order.setUpdateBy(getUsername());
|
||||||
|
// int result = orderService.shipErpOrder(order);
|
||||||
|
// if(result == -1) return new AjaxResult(501,"订单不存在!");
|
||||||
|
// else if(result == -2) return new AjaxResult(502,"订单号已存在!");
|
||||||
|
// return toAjax(result);
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package cn.qihangerp.api.order.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
|
import cn.qihangerp.module.order.domain.bo.OrderItemListBo;
|
||||||
|
import cn.qihangerp.module.order.service.OOrderItemService;
|
||||||
|
import cn.qihangerp.module.order.service.OOrderService;
|
||||||
|
import cn.qihangerp.security.common.BaseController;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺订单Controller
|
||||||
|
*
|
||||||
|
* @author qihang
|
||||||
|
* @date 2023-12-31
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/order")
|
||||||
|
public class OrderItemController extends BaseController
|
||||||
|
{
|
||||||
|
private final OOrderItemService itemService;
|
||||||
|
private final OOrderService orderService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询店铺订单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/item_list")
|
||||||
|
public TableDataInfo list(OrderItemListBo bo, PageQuery pageQuery)
|
||||||
|
{
|
||||||
|
var pageList = itemService.selectPageVo(pageQuery,bo);
|
||||||
|
return getDataTable(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 更新erp sku id
|
||||||
|
// * @param orderItem
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// @PostMapping("/updateErpSkuId")
|
||||||
|
// public AjaxResult ship(@RequestBody OOrderItem orderItem)
|
||||||
|
// {
|
||||||
|
// if(StringUtils.isEmpty(orderItem.getId()) || orderItem.getGoodsSkuId()==null){
|
||||||
|
// return AjaxResult.error("确少必要参数");
|
||||||
|
// }
|
||||||
|
// itemService.updateErpSkuId(orderItem.getId(), orderItem.getGoodsSkuId());
|
||||||
|
// return AjaxResult.success();
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
package cn.qihangerp.api.order.controller;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.common.AjaxResult;
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
import cn.qihangerp.common.ResultVo;
|
||||||
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
|
import cn.qihangerp.module.order.domain.bo.RefundProcessingBo;
|
||||||
|
import cn.qihangerp.module.order.domain.bo.RefundSearchBo;
|
||||||
|
import cn.qihangerp.module.order.service.ORefundService;
|
||||||
|
import cn.qihangerp.security.common.BaseController;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退换货Controller
|
||||||
|
*
|
||||||
|
* @author qihang
|
||||||
|
* @date 2024-01-13
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/refund")
|
||||||
|
public class RefundController extends BaseController
|
||||||
|
{
|
||||||
|
|
||||||
|
private final ORefundService refundService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询退换货列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('api:returned:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(RefundSearchBo bo, PageQuery pageQuery)
|
||||||
|
{
|
||||||
|
var pageList = refundService.queryPageList(bo,pageQuery);
|
||||||
|
return getDataTable(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取退换货详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('api:returned:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(refundService.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送退款到ERP
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/pushErp/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
// for (Long id:ids) {
|
||||||
|
// ORefund ORefund = refundService.selectById(id);
|
||||||
|
// if(ORefund!=null) {
|
||||||
|
//
|
||||||
|
// ResultVo resultVo = erpPushHelper.pushRefundSingle(ORefund);
|
||||||
|
// ORefund pushUpdate = new ORefund();
|
||||||
|
// pushUpdate.setErpPushStatus(resultVo.getCode()== 0 ? 200:resultVo.getCode());
|
||||||
|
// pushUpdate.setErpPushResult(resultVo.getMsg());
|
||||||
|
// pushUpdate.setErpPushTime(new Date());
|
||||||
|
// pushUpdate.setUpdateBy("手动推送到ERP");
|
||||||
|
// pushUpdate.setUpdateTime(new Date());
|
||||||
|
// pushUpdate.setId(id.toString());
|
||||||
|
// refundService.updateById(pushUpdate);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/processing")
|
||||||
|
public AjaxResult refundProcessing(@RequestBody RefundProcessingBo bo ) {
|
||||||
|
if (bo.getRefundId() == null) return AjaxResult.error(500, "缺少参数refundId");
|
||||||
|
ResultVo<Long> resultVo = refundService.refundProcessing(bo,getUsername());
|
||||||
|
if(resultVo.getCode() == 0) return success();
|
||||||
|
else return AjaxResult.error(resultVo.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package cn.qihangerp.api.order.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.common.AjaxResult;
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
|
import cn.qihangerp.module.order.domain.bo.ShipStockUpBo;
|
||||||
|
import cn.qihangerp.module.order.domain.bo.ShipStockUpCompleteBo;
|
||||||
|
import cn.qihangerp.module.order.service.OShipStockUpService;
|
||||||
|
import cn.qihangerp.module.order.service.OShipWaybillService;
|
||||||
|
import cn.qihangerp.security.common.BaseController;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/ship")
|
||||||
|
public class ShipStockupController extends BaseController {
|
||||||
|
private final OShipStockUpService shipStockUpService;
|
||||||
|
private final OShipWaybillService shipWaybillService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备货列表
|
||||||
|
* @param bo
|
||||||
|
* @param pageQuery
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/stock_up_list")
|
||||||
|
public TableDataInfo stock_up_list(ShipStockUpBo bo, PageQuery pageQuery)
|
||||||
|
{
|
||||||
|
var pageList = shipStockUpService.queryPageList(bo,pageQuery);
|
||||||
|
return getDataTable(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/stock_up_complete")
|
||||||
|
public AjaxResult stock_up_complete(@RequestBody ShipStockUpCompleteBo bo)
|
||||||
|
{
|
||||||
|
int result = shipStockUpService.stockUpComplete(bo);
|
||||||
|
if(result == -1) return AjaxResult.error("参数错误:orderItemIds为空");
|
||||||
|
if(result == -2) return AjaxResult.error("参数错误:没有要添加的");
|
||||||
|
else if(result == -1001) return AjaxResult.error("存在错误的orderItemId:状态不对不能生成出库单");
|
||||||
|
else if(result == -1002) return AjaxResult.error("存在错误的订单数据:名单明细中没有skuId请修改!");
|
||||||
|
//wmsStockOutEntryService.insertWmsStockOutEntry(wmsStockOutEntry)
|
||||||
|
return toAjax(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/stock_up_complete_by_order")
|
||||||
|
public AjaxResult stock_up_completeByOrder(@RequestBody ShipStockUpCompleteBo bo)
|
||||||
|
{
|
||||||
|
int result = shipStockUpService.stockUpCompleteByOrder(bo);
|
||||||
|
if(result == -1) return AjaxResult.error("参数错误:orderItemIds为空");
|
||||||
|
if(result == -2) return AjaxResult.error("参数错误:没有要添加的");
|
||||||
|
else if(result == -1001) return AjaxResult.error("存在错误的orderItemId:状态不对不能生成出库单");
|
||||||
|
else if(result == -1002) return AjaxResult.error("存在错误的订单数据:名单明细中没有skuId请修改!");
|
||||||
|
//wmsStockOutEntryService.insertWmsStockOutEntry(wmsStockOutEntry)
|
||||||
|
return toAjax(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package cn.qihangerp.api.order.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.qihangerp.common.AjaxResult;
|
||||||
|
import cn.qihangerp.common.PageQuery;
|
||||||
|
import cn.qihangerp.common.TableDataInfo;
|
||||||
|
import cn.qihangerp.module.order.domain.OShipment;
|
||||||
|
import cn.qihangerp.module.order.domain.bo.OrderShipBo;
|
||||||
|
import cn.qihangerp.module.order.service.OOrderService;
|
||||||
|
import cn.qihangerp.module.order.service.OShipmentService;
|
||||||
|
import cn.qihangerp.security.common.BaseController;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/shipping")
|
||||||
|
public class ShipmentController extends BaseController {
|
||||||
|
private final OShipmentService shippingService;
|
||||||
|
|
||||||
|
private final OOrderService orderService;
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(OShipment shipping, PageQuery pageQuery)
|
||||||
|
{
|
||||||
|
return getDataTable(shippingService.queryPageList(shipping,pageQuery));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/searchOrderConsignee")
|
||||||
|
public TableDataInfo searchOrderConsignee(String consignee)
|
||||||
|
{
|
||||||
|
return getDataTable(orderService.searchOrderConsignee(consignee));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/searchOrderItemByReceiverMobile")
|
||||||
|
public TableDataInfo searchOrderItemByReceiverMobile(String receiverMobile)
|
||||||
|
{
|
||||||
|
return getDataTable(orderService.searchOrderItemByReceiverMobile(receiverMobile));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单发货
|
||||||
|
* @param shipping
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/handShip")
|
||||||
|
public AjaxResult orderHandShip(@RequestHeader("Authorization") String authorization,@RequestBody OrderShipBo shipping)
|
||||||
|
{
|
||||||
|
|
||||||
|
var result = shippingService.handOrderShip(shipping);
|
||||||
|
// if(result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||||
|
// // 发货
|
||||||
|
// TaoOrderShipBo bo = new TaoOrderShipBo();
|
||||||
|
// bo.setShopId(shipping.getShopId());
|
||||||
|
//// bo.setTid(shipping.getOrderId());
|
||||||
|
// bo.setWaybillCode(shipping.getShipCode());
|
||||||
|
// bo.setWaybillCompany(shipping.getShipCompany());
|
||||||
|
//
|
||||||
|
// JSONObject jsonObject = taoApiService.orderShip(authorization, bo);
|
||||||
|
// return AjaxResult.success();
|
||||||
|
// }else{
|
||||||
|
// return AjaxResult.error(result.getCode(),result.getMsg());
|
||||||
|
// }
|
||||||
|
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.qihangerp.api.order.OrderApiAutoConfiguration
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
qihangerp:
|
||||||
|
name: 启航电商ERP
|
||||||
|
order:
|
||||||
|
version: 2.4.21
|
||||||
|
|
||||||
|
#mybatis-plus:
|
||||||
|
# mapper-locations: classpath*:mapper/**/*Mapper.xml
|
||||||
|
# type-aliases-package: cn.qihangerp.oms.domain;cn.qihangerp.module.domain;
|
||||||
|
# configuration:
|
||||||
|
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 开启sql日志
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
Application Version: 2.4.21
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
_______ _________ _______ _ _______ _______ _______ _______
|
||||||
|
( ___ )\__ __/|\ /|( ___ )( ( /|( ____ \( ____ \( ____ )( ____ )
|
||||||
|
| ( ) | ) ( | ) ( || ( ) || \ ( || ( \/| ( \/| ( )|| ( )|
|
||||||
|
| | | | | | | (___) || (___) || \ | || | | (__ | (____)|| (____)|
|
||||||
|
| | | | | | | ___ || ___ || (\ \) || | ____ | __) | __)| _____)
|
||||||
|
| | /\| | | | | ( ) || ( ) || | \ || | \_ )| ( | (\ ( | (
|
||||||
|
| (_\ \ |___) (___| ) ( || ) ( || ) \ || (___) || (____/\| ) \ \__| )
|
||||||
|
(____\/_)\_______/|/ \||/ \||/ )_)(_______)(_______/|/ \__/|/
|
||||||
|
|
@ -2,29 +2,72 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>cn.qihangerp</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>qihangerp-cloud</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.0.6</version>
|
<version>3.0.2</version>
|
||||||
|
<relativePath/>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>cn.qihangerp.services</groupId>
|
<groupId>cn.qihangerp.services</groupId>
|
||||||
<artifactId>microservices</artifactId>
|
<artifactId>microservices</artifactId>
|
||||||
<version>3.0.6</version>
|
<version>1.0.6</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>microservices</name>
|
<name>microservices</name>
|
||||||
<url>http://maven.apache.org</url>
|
<url>http://maven.apache.org</url>
|
||||||
|
<modules>
|
||||||
|
<module>goods-api</module>
|
||||||
|
<module>order-api</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
<java.version>17</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<spring-boot.version>3.0.2</spring-boot.version>
|
||||||
|
<spring-cloud-alibaba.version>2022.0.0.0</spring-cloud-alibaba.version>
|
||||||
|
<jwt.version>0.11.5</jwt.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
<version>3.8.1</version>
|
</dependency>
|
||||||
<scope>test</scope>
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>8.0.33</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.5.5</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.qihangerp.core</groupId>
|
||||||
|
<artifactId>security</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.30</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package cn.qihangerp.module;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class App
|
|
||||||
{
|
|
||||||
public static void main( String[] args )
|
|
||||||
{
|
|
||||||
System.out.println( "Hello World!" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
package cn.qihangerp.module.goods;
|
|
||||||
|
|
||||||
public class a {
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
package cn.qihangerp.module;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Hello world!
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class App
|
|
||||||
{
|
|
||||||
public static void main( String[] args )
|
|
||||||
{
|
|
||||||
System.out.println( "Hello World!" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
package cn.qihangerp.module.order;
|
|
||||||
|
|
||||||
public class a {
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue