推送新架构

This commit is contained in:
Richie 2025-04-21 11:04:23 +08:00
parent 67f329cb14
commit 99eefafe4e
43 changed files with 1802 additions and 1339 deletions

View File

@ -63,21 +63,33 @@
<artifactId>security</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>cn.qihangerp.module</groupId>
<artifactId>goods</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>cn.qihangerp.module</groupId>
<artifactId>order</artifactId>
<version>1.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>cn.qihangerp.module</groupId>-->
<!-- <artifactId>goods</artifactId>-->
<!-- <version>1.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>cn.qihangerp.module</groupId>-->
<!-- <artifactId>order</artifactId>-->
<!-- <version>1.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>cn.qihangerp.module</groupId>
<artifactId>stock</artifactId>
<version>1.0</version>
</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>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>

View File

@ -6,10 +6,12 @@ import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerIntercept
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Configuration
@MapperScan({"cn.qihangerp.oms.mapper","cn.qihangerp.module.*.mapper","cn.qihangerp.module.mapper"})
public class MybatisPlusConfig {
@Primary
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();

View File

@ -1,101 +1,101 @@
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);
// }
//package cn.qihangerp.oms.controller;
//
//
// @GetMapping("/returned_list")
// public TableDataInfo returned_list(ErpAfterSale bo, PageQuery pageQuery)
//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)
// {
// bo.setType(10);
// PageResult<ErpAfterSale> result = afterSaleService.queryPageList(bo, 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);
// }
//
// @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("/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);
//// }
//
// @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);
// }
}
//}

View File

@ -1,72 +1,72 @@
package cn.qihangerp.oms.controller;
import cn.qihangerp.common.AjaxResult;
import cn.qihangerp.common.PageQuery;
import cn.qihangerp.common.TableDataInfo;
import cn.qihangerp.module.goods.domain.OGoodsBrand;
import cn.qihangerp.module.goods.service.OGoodsBrandService;
import cn.qihangerp.security.common.BaseController;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
@AllArgsConstructor
@RestController
@RequestMapping("/goods_brand")
public class GoodsBrandController extends BaseController {
private final OGoodsBrandService brandService;
@GetMapping("/list")
public TableDataInfo skuList(OGoodsBrand bo, PageQuery pageQuery)
{
var pageList = brandService.queryPageList(bo,pageQuery);
return getDataTable(pageList);
}
/**
* 获取商品品牌详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(brandService.getById(id));
}
/**
* 新增商品品牌
*/
@PostMapping
public AjaxResult add(@RequestBody OGoodsBrand erpGoodsBrand)
{
erpGoodsBrand.setStatus(1);
erpGoodsBrand.setCreateBy(getUsername());
erpGoodsBrand.setCreateTime(new Date());
return toAjax(brandService.save(erpGoodsBrand));
}
/**
* 修改商品品牌
*/
@PutMapping
public AjaxResult edit(@RequestBody OGoodsBrand erpGoodsBrand)
{
erpGoodsBrand.setUpdateBy(getUsername());
erpGoodsBrand.setUpdateTime(new Date());
return toAjax(brandService.updateById(erpGoodsBrand));
}
/**
* 删除商品品牌
*/
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(brandService.removeByIds(Arrays.stream(ids).toList()));
}
}
//package cn.qihangerp.oms.controller;
//
//
//
//import cn.qihangerp.common.AjaxResult;
//import cn.qihangerp.common.PageQuery;
//
//
//import cn.qihangerp.common.TableDataInfo;
//import cn.qihangerp.module.goods.domain.OGoodsBrand;
//import cn.qihangerp.module.goods.service.OGoodsBrandService;
//
//import cn.qihangerp.security.common.BaseController;
//import lombok.AllArgsConstructor;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.Arrays;
//import java.util.Date;
//
//@AllArgsConstructor
//@RestController
//@RequestMapping("/goods_brand")
//public class GoodsBrandController extends BaseController {
// private final OGoodsBrandService brandService;
// @GetMapping("/list")
// public TableDataInfo skuList(OGoodsBrand bo, PageQuery pageQuery)
// {
// var pageList = brandService.queryPageList(bo,pageQuery);
// return getDataTable(pageList);
// }
//
// /**
// * 获取商品品牌详细信息
// */
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(brandService.getById(id));
// }
//
// /**
// * 新增商品品牌
// */
// @PostMapping
// public AjaxResult add(@RequestBody OGoodsBrand erpGoodsBrand)
// {
// erpGoodsBrand.setStatus(1);
// erpGoodsBrand.setCreateBy(getUsername());
// erpGoodsBrand.setCreateTime(new Date());
// return toAjax(brandService.save(erpGoodsBrand));
// }
//
// /**
// * 修改商品品牌
// */
// @PutMapping
// public AjaxResult edit(@RequestBody OGoodsBrand erpGoodsBrand)
// {
// erpGoodsBrand.setUpdateBy(getUsername());
// erpGoodsBrand.setUpdateTime(new Date());
// return toAjax(brandService.updateById(erpGoodsBrand));
// }
//
// /**
// * 删除商品品牌
// */
// @DeleteMapping("/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// return toAjax(brandService.removeByIds(Arrays.stream(ids).toList()));
// }
//}

View File

@ -1,142 +1,142 @@
package cn.qihangerp.oms.controller;
import cn.qihangerp.common.AjaxResult;
import cn.qihangerp.common.TableDataInfo;
import cn.qihangerp.module.goods.domain.OGoodsCategory;
import cn.qihangerp.module.goods.domain.OGoodsCategoryAttribute;
import cn.qihangerp.module.goods.domain.OGoodsCategoryAttributeValue;
import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeService;
import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeValueService;
import cn.qihangerp.module.goods.service.OGoodsCategoryService;
import cn.qihangerp.security.common.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
@AllArgsConstructor
@RestController
@RequestMapping("/goods_category")
public class GoodsCategoryController extends BaseController {
private final OGoodsCategoryService categoryService;
private final OGoodsCategoryAttributeService categoryAttributeService;
private final OGoodsCategoryAttributeValueService categoryAttributeValueService;
@GetMapping("/list")
public TableDataInfo categoryList()
{
var pageList = categoryService.list();
return getDataTable(pageList);
}
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(categoryService.getById(id));
}
@PostMapping
public AjaxResult add(@RequestBody OGoodsCategory category)
{
category.setCreateBy(getUsername());
categoryService.addCategory(category);
return toAjax(1);
}
@PutMapping
public AjaxResult edit(@RequestBody OGoodsCategory category)
{
category.setUpdateBy(getUsername());
category.setUpdateTime(new Date());
return toAjax(categoryService.updateById(category));
}
/**
* 删除分类
* @param ids
* @return
*/
@DeleteMapping("/del/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(categoryService.removeByIds(Arrays.stream(ids).toList()));
}
/**
* 分类属性列表
* @param categoryId
* @return
*/
@GetMapping("/attribute_list")
public TableDataInfo attributeList(Integer categoryId)
{
var pageList = categoryAttributeService.list(new LambdaQueryWrapper<OGoodsCategoryAttribute>().eq(OGoodsCategoryAttribute::getCategoryId,categoryId));
return getDataTable(pageList);
}
/**
* 分类属性添加
* @param attribute
* @return
*/
@PostMapping("/attribute_add")
public AjaxResult attributeAdd(@RequestBody OGoodsCategoryAttribute attribute)
{
return toAjax(categoryAttributeService.save(attribute));
}
@GetMapping(value = "/attribute/{id}")
public AjaxResult getAttributeInfo(@PathVariable("id") Long id)
{
return success(categoryAttributeService.getById(id));
}
@PutMapping("/attribute")
public AjaxResult attributeEdit(@RequestBody OGoodsCategoryAttribute attribute)
{
return toAjax(categoryAttributeService.updateById(attribute));
}
@DeleteMapping("/attribute/{ids}")
public AjaxResult attributeRemove(@PathVariable Long[] ids)
{
return toAjax(categoryAttributeService.removeByIds(Arrays.stream(ids).toList()));
}
@GetMapping("/attribute_value_list")
public TableDataInfo attributeValueList(Integer categoryAttributeId)
{
var pageList = categoryAttributeValueService.list(
new LambdaQueryWrapper<OGoodsCategoryAttributeValue>().eq(OGoodsCategoryAttributeValue::getCategoryAttributeId,categoryAttributeId));
return getDataTable(pageList);
}
@PostMapping("/attribute_value")
public AjaxResult add(@RequestBody OGoodsCategoryAttributeValue attributeValue)
{
return toAjax(categoryAttributeValueService.save(attributeValue));
}
@GetMapping(value = "/attribute_value/{id}")
public AjaxResult getAttributeValueInfo(@PathVariable("id") Long id)
{
return success(categoryAttributeValueService.getById(id));
}
@PutMapping("/attribute_value")
public AjaxResult attributeValueEdit(@RequestBody OGoodsCategoryAttributeValue attributeValue)
{
return toAjax(categoryAttributeValueService.updateById(attributeValue));
}
/**
* 删除商品分类属性值
*/
@DeleteMapping("/attribute_value/{ids}")
public AjaxResult removeAttributeValue(@PathVariable Long[] ids)
{
return toAjax(categoryAttributeValueService.removeByIds(Arrays.stream(ids).toList()));
}
}
//package cn.qihangerp.oms.controller;
//
//
//
//import cn.qihangerp.common.AjaxResult;
//import cn.qihangerp.common.TableDataInfo;
//import cn.qihangerp.module.goods.domain.OGoodsCategory;
//import cn.qihangerp.module.goods.domain.OGoodsCategoryAttribute;
//import cn.qihangerp.module.goods.domain.OGoodsCategoryAttributeValue;
//import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeService;
//import cn.qihangerp.module.goods.service.OGoodsCategoryAttributeValueService;
//import cn.qihangerp.module.goods.service.OGoodsCategoryService;
//import cn.qihangerp.security.common.BaseController;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import lombok.AllArgsConstructor;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.Arrays;
//import java.util.Date;
//
//@AllArgsConstructor
//@RestController
//@RequestMapping("/goods_category")
//public class GoodsCategoryController extends BaseController {
// private final OGoodsCategoryService categoryService;
// private final OGoodsCategoryAttributeService categoryAttributeService;
// private final OGoodsCategoryAttributeValueService categoryAttributeValueService;
//
// @GetMapping("/list")
// public TableDataInfo categoryList()
// {
// var pageList = categoryService.list();
// return getDataTable(pageList);
// }
//
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(categoryService.getById(id));
// }
//
// @PostMapping
// public AjaxResult add(@RequestBody OGoodsCategory category)
// {
// category.setCreateBy(getUsername());
// categoryService.addCategory(category);
// return toAjax(1);
// }
//
// @PutMapping
// public AjaxResult edit(@RequestBody OGoodsCategory category)
// {
// category.setUpdateBy(getUsername());
// category.setUpdateTime(new Date());
// return toAjax(categoryService.updateById(category));
// }
// /**
// * 删除分类
// * @param ids
// * @return
// */
// @DeleteMapping("/del/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// return toAjax(categoryService.removeByIds(Arrays.stream(ids).toList()));
// }
//
// /**
// * 分类属性列表
// * @param categoryId
// * @return
// */
// @GetMapping("/attribute_list")
// public TableDataInfo attributeList(Integer categoryId)
// {
// var pageList = categoryAttributeService.list(new LambdaQueryWrapper<OGoodsCategoryAttribute>().eq(OGoodsCategoryAttribute::getCategoryId,categoryId));
// return getDataTable(pageList);
// }
//
// /**
// * 分类属性添加
// * @param attribute
// * @return
// */
// @PostMapping("/attribute_add")
// public AjaxResult attributeAdd(@RequestBody OGoodsCategoryAttribute attribute)
// {
// return toAjax(categoryAttributeService.save(attribute));
// }
//
// @GetMapping(value = "/attribute/{id}")
// public AjaxResult getAttributeInfo(@PathVariable("id") Long id)
// {
// return success(categoryAttributeService.getById(id));
// }
//
// @PutMapping("/attribute")
// public AjaxResult attributeEdit(@RequestBody OGoodsCategoryAttribute attribute)
// {
// return toAjax(categoryAttributeService.updateById(attribute));
// }
// @DeleteMapping("/attribute/{ids}")
// public AjaxResult attributeRemove(@PathVariable Long[] ids)
// {
// return toAjax(categoryAttributeService.removeByIds(Arrays.stream(ids).toList()));
// }
//
// @GetMapping("/attribute_value_list")
// public TableDataInfo attributeValueList(Integer categoryAttributeId)
// {
// var pageList = categoryAttributeValueService.list(
// new LambdaQueryWrapper<OGoodsCategoryAttributeValue>().eq(OGoodsCategoryAttributeValue::getCategoryAttributeId,categoryAttributeId));
// return getDataTable(pageList);
//
// }
//
// @PostMapping("/attribute_value")
// public AjaxResult add(@RequestBody OGoodsCategoryAttributeValue attributeValue)
// {
// return toAjax(categoryAttributeValueService.save(attributeValue));
// }
// @GetMapping(value = "/attribute_value/{id}")
// public AjaxResult getAttributeValueInfo(@PathVariable("id") Long id)
// {
// return success(categoryAttributeValueService.getById(id));
// }
//
// @PutMapping("/attribute_value")
// public AjaxResult attributeValueEdit(@RequestBody OGoodsCategoryAttributeValue attributeValue)
// {
// return toAjax(categoryAttributeValueService.updateById(attributeValue));
// }
//
// /**
// * 删除商品分类属性值
// */
// @DeleteMapping("/attribute_value/{ids}")
// public AjaxResult removeAttributeValue(@PathVariable Long[] ids)
// {
// return toAjax(categoryAttributeValueService.removeByIds(Arrays.stream(ids).toList()));
// }
//}

View File

@ -1,247 +1,247 @@
package cn.qihangerp.oms.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.module.goods.domain.OGoods;
import cn.qihangerp.module.goods.domain.OGoodsSku;
import cn.qihangerp.module.goods.domain.bo.GoodsAddBo;
import cn.qihangerp.module.goods.domain.vo.GoodsSpecListVo;
import cn.qihangerp.module.goods.service.OGoodsService;
import cn.qihangerp.module.goods.service.OGoodsSkuService;
import cn.qihangerp.security.common.BaseController;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
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.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 商品管理Controller
*
* @author qihang
* @date 2023-12-29
*/
@AllArgsConstructor
@RestController
@RequestMapping("/goods")
public class GoodsController extends BaseController
{
private final OGoodsService goodsService;
private final OGoodsSkuService skuService;
/**
* 搜索商品SKU
* 条件商品编码SKU商品名称
*/
@GetMapping("/searchSku")
public TableDataInfo searchSkuBy(String keyword)
{
List<GoodsSpecListVo> list = goodsService.searchGoodsSpec(keyword);
return getDataTable(list);
}
@GetMapping("/sku_list")
public TableDataInfo skuList(OGoodsSku bo, PageQuery pageQuery)
{
var pageList = goodsService.querySkuPageList(bo,pageQuery);
return getDataTable(pageList);
}
/**
* 查询商品管理列表
*/
@PreAuthorize("@ss.hasPermi('goods:goods:list')")
@GetMapping("/list")
public TableDataInfo list(OGoods goods, PageQuery pageQuery)
{
PageResult<OGoods> pageList = goodsService.queryPageList(goods, pageQuery);
return getDataTable(pageList);
}
/**
* 获取商品管理详细信息
*/
@PreAuthorize("@ss.hasPermi('goods:goods:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(goodsService.selectGoodsById(id));
}
/**
* 获取商品管理详细信息
*/
@PreAuthorize("@ss.hasPermi('goods:goods:query')")
@GetMapping(value = "/sku/{id}")
public AjaxResult getSkuInfo(@PathVariable("id") Long id)
{
return success(skuService.getById(id));
}
/**
* 新增商品管理
*/
@PreAuthorize("@ss.hasPermi('goods:goods:add')")
@PostMapping("/add")
public AjaxResult add(@RequestBody GoodsAddBo goods)
{
ResultVo<Long> resultVo = goodsService.insertGoods(getUsername(), goods);
if(resultVo.getCode()!=0) return AjaxResult.error(resultVo.getMsg());
else return AjaxResult.success(resultVo.getData());
// goods.setCreateBy(getUsername());
// int result = goodsService.insertGoods(goods);
//package cn.qihangerp.oms.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.module.goods.domain.OGoods;
//import cn.qihangerp.module.goods.domain.OGoodsSku;
//import cn.qihangerp.module.goods.domain.bo.GoodsAddBo;
//import cn.qihangerp.module.goods.domain.vo.GoodsSpecListVo;
//import cn.qihangerp.module.goods.service.OGoodsService;
//
//
//import cn.qihangerp.module.goods.service.OGoodsSkuService;
//import cn.qihangerp.security.common.BaseController;
//import com.fasterxml.jackson.databind.exc.InvalidFormatException;
//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.util.StringUtils;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.multipart.MultipartFile;
//
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * 商品管理Controller
// *
// * @author qihang
// * @date 2023-12-29
// */
//@AllArgsConstructor
//@RestController
//@RequestMapping("/goods")
//public class GoodsController extends BaseController
//{
// private final OGoodsService goodsService;
// private final OGoodsSkuService skuService;
//
// /**
// * 搜索商品SKU
// * 条件商品编码SKU商品名称
// */
// @GetMapping("/searchSku")
// public TableDataInfo searchSkuBy(String keyword)
// {
// List<GoodsSpecListVo> list = goodsService.searchGoodsSpec(keyword);
// return getDataTable(list);
// }
//
// @GetMapping("/sku_list")
// public TableDataInfo skuList(OGoodsSku bo, PageQuery pageQuery)
// {
// var pageList = goodsService.querySkuPageList(bo,pageQuery);
// return getDataTable(pageList);
// }
//
// /**
// * 查询商品管理列表
// */
// @PreAuthorize("@ss.hasPermi('goods:goods:list')")
// @GetMapping("/list")
// public TableDataInfo list(OGoods goods, PageQuery pageQuery)
// {
// PageResult<OGoods> pageList = goodsService.queryPageList(goods, pageQuery);
// return getDataTable(pageList);
// }
//
// /**
// * 获取商品管理详细信息
// */
// @PreAuthorize("@ss.hasPermi('goods:goods:query')")
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(goodsService.selectGoodsById(id));
// }
// /**
// * 获取商品管理详细信息
// */
// @PreAuthorize("@ss.hasPermi('goods:goods:query')")
// @GetMapping(value = "/sku/{id}")
// public AjaxResult getSkuInfo(@PathVariable("id") Long id)
// {
// return success(skuService.getById(id));
// }
// /**
// * 新增商品管理
// */
// @PreAuthorize("@ss.hasPermi('goods:goods:add')")
// @PostMapping("/add")
// public AjaxResult add(@RequestBody GoodsAddBo goods)
// {
// ResultVo<Long> resultVo = goodsService.insertGoods(getUsername(), goods);
// if(resultVo.getCode()!=0) return AjaxResult.error(resultVo.getMsg());
// else return AjaxResult.success(resultVo.getData());
//// goods.setCreateBy(getUsername());
//// 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,"商品编码已存在");
// 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,"商品编码已存在");
return toAjax(1);
}
/**
* 修改商品管理
*/
@PreAuthorize("@ss.hasPermi('goods:goods:edit')")
@PutMapping
public AjaxResult edit(@RequestBody OGoods goods)
{
return toAjax(goodsService.updateGoods(goods));
}
/**
* 修改商品基本资料
* @param sku
* @return
*/
@PutMapping("/sku")
public AjaxResult editSku(@RequestBody OGoodsSku sku)
{
return toAjax(skuService.updateById(sku));
}
/**
* 删除商品管理
*/
@PreAuthorize("@ss.hasPermi('goods:goods:remove')")
@DeleteMapping("/del/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
int result = goodsService.deleteGoodsByIds(ids);
if(result==0) return AjaxResult.success();
else if (result==-100) return AjaxResult.error("有关联的订单,不能删除!");
else return AjaxResult.error();
}
@RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
String fileName = file.getOriginalFilename();
String dir = System.getProperty("user.dir");
String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
System.out.println(destFileName);
File destFile = new File(destFileName);
file.transferTo(destFile);
InputStream fis = null;
fis = new FileInputStream(destFileName);
if (fis == null) return AjaxResult.error("没有文件");
Workbook workbook = null;
try {
if (fileName.toLowerCase().endsWith("xlsx")) {
workbook = new XSSFWorkbook(fis);
} else if (fileName.toLowerCase().endsWith("xls")) {
workbook = new HSSFWorkbook(fis);
}
// workbook = new HSSFWorkbook(fis);
} catch (Exception ex) {
return AjaxResult.error(ex.getMessage());
}
if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
/****************开始处理excel****************/
int success = 0;
int fail = 0;
Sheet sheet = null;
try {
sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();//最后一行索引
Row row = null;
for (int i = 1; i <= lastRowNum; i++) {
row = sheet.getRow(i);
//数据
OGoodsSku sku = new OGoodsSku();
for(int c=0;c<6;c++){
Cell cell = row.getCell(c);
String cellValue = "";
if (cell != null) {
if (cell.getCellType() == CellType.STRING) {
cellValue = cell.getStringCellValue().replace("\t", "");
} else if (cell.getCellType() == CellType.NUMERIC) {
cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
}
}
if(c == 1) {
if(StringUtils.hasText(cellValue) ){
sku.setOuterErpGoodsId(cellValue);
}else {
sku.setOuterErpGoodsId("0");
}
}
if(StringUtils.hasText(cellValue)) {
if (c == 0) {
sku.setOuterErpSkuId(cellValue);
} else if (c == 2) {
sku.setSkuCode(cellValue);
} else if (c == 3) {
sku.setSkuName(cellValue);
} else if (c == 4) {
sku.setColorImage(cellValue);
} else if (c == 5) {
sku.setRemark(cellValue);
}
}
}
goodsService.insertGoodsSku(sku);
success++;
}
} catch (Exception ex) {
fail++;
ex.printStackTrace();
}
Map<String, Integer> result = new HashMap<>();
result.put("success",success);
result.put("fail",fail);
return AjaxResult.success(result);
}
}
// }
//
// /**
// * 修改商品管理
// */
// @PreAuthorize("@ss.hasPermi('goods:goods:edit')")
// @PutMapping
// public AjaxResult edit(@RequestBody OGoods goods)
// {
// return toAjax(goodsService.updateGoods(goods));
// }
//
// /**
// * 修改商品基本资料
// * @param sku
// * @return
// */
// @PutMapping("/sku")
// public AjaxResult editSku(@RequestBody OGoodsSku sku)
// {
// return toAjax(skuService.updateById(sku));
// }
//
// /**
// * 删除商品管理
// */
// @PreAuthorize("@ss.hasPermi('goods:goods:remove')")
// @DeleteMapping("/del/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// int result = goodsService.deleteGoodsByIds(ids);
// if(result==0) return AjaxResult.success();
// else if (result==-100) return AjaxResult.error("有关联的订单,不能删除!");
// else return AjaxResult.error();
// }
//
// @RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
// public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
//
// String fileName = file.getOriginalFilename();
// String dir = System.getProperty("user.dir");
// String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
// System.out.println(destFileName);
// File destFile = new File(destFileName);
// file.transferTo(destFile);
// InputStream fis = null;
// fis = new FileInputStream(destFileName);
// if (fis == null) return AjaxResult.error("没有文件");
//
// Workbook workbook = null;
//
// try {
// if (fileName.toLowerCase().endsWith("xlsx")) {
// workbook = new XSSFWorkbook(fis);
// } else if (fileName.toLowerCase().endsWith("xls")) {
// workbook = new HSSFWorkbook(fis);
// }
// // workbook = new HSSFWorkbook(fis);
// } catch (Exception ex) {
// return AjaxResult.error(ex.getMessage());
// }
//
// if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
//
// /****************开始处理excel****************/
// int success = 0;
// int fail = 0;
// Sheet sheet = null;
// try {
// sheet = workbook.getSheetAt(0);
// int lastRowNum = sheet.getLastRowNum();//最后一行索引
// Row row = null;
//
// for (int i = 1; i <= lastRowNum; i++) {
// row = sheet.getRow(i);
// //数据
// OGoodsSku sku = new OGoodsSku();
// for(int c=0;c<6;c++){
// Cell cell = row.getCell(c);
// String cellValue = "";
// if (cell != null) {
// if (cell.getCellType() == CellType.STRING) {
// cellValue = cell.getStringCellValue().replace("\t", "");
// } else if (cell.getCellType() == CellType.NUMERIC) {
// cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
// }
// }
// if(c == 1) {
// if(StringUtils.hasText(cellValue) ){
// sku.setOuterErpGoodsId(cellValue);
// }else {
// sku.setOuterErpGoodsId("0");
// }
// }
// if(StringUtils.hasText(cellValue)) {
// if (c == 0) {
// sku.setOuterErpSkuId(cellValue);
// } else if (c == 2) {
// sku.setSkuCode(cellValue);
// } else if (c == 3) {
// sku.setSkuName(cellValue);
// } else if (c == 4) {
// sku.setColorImage(cellValue);
// } else if (c == 5) {
// sku.setRemark(cellValue);
// }
// }
// }
// goodsService.insertGoodsSku(sku);
// success++;
// }
//
//
// } catch (Exception ex) {
// fail++;
// ex.printStackTrace();
// }
// Map<String, Integer> result = new HashMap<>();
// result.put("success",success);
// result.put("fail",fail);
// return AjaxResult.success(result);
// }
//}

View File

@ -1,47 +1,47 @@
package cn.qihangerp.oms.controller;
import cn.qihangerp.common.PageQuery;
import cn.qihangerp.common.PageResult;
import cn.qihangerp.common.AjaxResult;
import cn.qihangerp.common.TableDataInfo;
import cn.qihangerp.module.goods.domain.OGoodsInventory;
import cn.qihangerp.module.goods.domain.OGoodsInventoryBatch;
import cn.qihangerp.module.goods.service.OGoodsInventoryBatchService;
import cn.qihangerp.module.goods.service.OGoodsInventoryService;
import cn.qihangerp.security.common.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@AllArgsConstructor
@RestController
@RequestMapping("/goodsInventory")
public class GoodsInventoryController extends BaseController {
private final OGoodsInventoryService goodsInventoryService;
private final OGoodsInventoryBatchService inventoryBatchService;
@GetMapping("/list")
public TableDataInfo list(OGoodsInventory bo, PageQuery pageQuery)
{
PageResult<OGoodsInventory> pageResult = goodsInventoryService.queryPageList(bo, pageQuery);
return getDataTable(pageResult);
}
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
OGoodsInventory goodsInventory = goodsInventoryService.getById(id);
if(goodsInventory!=null) {
List<OGoodsInventoryBatch> list = inventoryBatchService.list(new LambdaQueryWrapper<OGoodsInventoryBatch>().eq(OGoodsInventoryBatch::getSkuId, goodsInventory.getSkuId()));
return AjaxResult.success(list);
}
return success();
}
}
//package cn.qihangerp.oms.controller;
//
//
//import cn.qihangerp.common.PageQuery;
//import cn.qihangerp.common.PageResult;
//
//import cn.qihangerp.common.AjaxResult;
//import cn.qihangerp.common.TableDataInfo;
//import cn.qihangerp.module.goods.domain.OGoodsInventory;
//import cn.qihangerp.module.goods.domain.OGoodsInventoryBatch;
//import cn.qihangerp.module.goods.service.OGoodsInventoryBatchService;
//import cn.qihangerp.module.goods.service.OGoodsInventoryService;
//import cn.qihangerp.security.common.BaseController;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import lombok.AllArgsConstructor;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
//@AllArgsConstructor
//@RestController
//@RequestMapping("/goodsInventory")
//public class GoodsInventoryController extends BaseController {
// private final OGoodsInventoryService goodsInventoryService;
// private final OGoodsInventoryBatchService inventoryBatchService;
//
// @GetMapping("/list")
// public TableDataInfo list(OGoodsInventory bo, PageQuery pageQuery)
// {
// PageResult<OGoodsInventory> pageResult = goodsInventoryService.queryPageList(bo, pageQuery);
// return getDataTable(pageResult);
// }
//
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// OGoodsInventory goodsInventory = goodsInventoryService.getById(id);
// if(goodsInventory!=null) {
// List<OGoodsInventoryBatch> list = inventoryBatchService.list(new LambdaQueryWrapper<OGoodsInventoryBatch>().eq(OGoodsInventoryBatch::getSkuId, goodsInventory.getSkuId()));
// return AjaxResult.success(list);
// }
// return success();
// }
//}

View File

@ -1,67 +1,67 @@
package cn.qihangerp.oms.controller;
import cn.qihangerp.common.PageQuery;
import cn.qihangerp.common.AjaxResult;
import cn.qihangerp.common.TableDataInfo;
import cn.qihangerp.module.goods.domain.OGoodsSupplier;
import cn.qihangerp.module.goods.service.OGoodsSupplierService;
import cn.qihangerp.security.common.BaseController;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Date;
@AllArgsConstructor
@RestController
@RequestMapping("/supplier")
public class GoodsSupplierController extends BaseController {
private final OGoodsSupplierService supplierService;
@GetMapping("/list")
public TableDataInfo list(OGoodsSupplier bo, PageQuery pageQuery)
{
var pageList = supplierService.queryPageList(bo,pageQuery);
return getDataTable(pageList);
}
/**
* 获取请填写功能名称详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(supplierService.getById(id));
}
/**
* 新增请填写功能名称
*/
@PostMapping
public AjaxResult add(@RequestBody OGoodsSupplier scmSupplier)
{
scmSupplier.setCreatetime(new Date());
scmSupplier.setIsdelete(0);
return toAjax(supplierService.save(scmSupplier));
}
/**
* 修改请填写功能名称
*/
@PutMapping
public AjaxResult edit(@RequestBody OGoodsSupplier scmSupplier)
{
return toAjax(supplierService.updateById(scmSupplier));
}
/**
* 删除请填写功能名称
*/
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(supplierService.removeByIds(Arrays.stream(ids).toList()));
}
}
//package cn.qihangerp.oms.controller;
//
//
//import cn.qihangerp.common.PageQuery;
//
//import cn.qihangerp.common.AjaxResult;
//import cn.qihangerp.common.TableDataInfo;
//import cn.qihangerp.module.goods.domain.OGoodsSupplier;
//import cn.qihangerp.module.goods.service.OGoodsSupplierService;
//import cn.qihangerp.security.common.BaseController;
//import lombok.AllArgsConstructor;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.Arrays;
//import java.util.Date;
//
//@AllArgsConstructor
//@RestController
//@RequestMapping("/supplier")
//public class GoodsSupplierController extends BaseController {
// private final OGoodsSupplierService supplierService;
//
// @GetMapping("/list")
// public TableDataInfo list(OGoodsSupplier bo, PageQuery pageQuery)
// {
// var pageList = supplierService.queryPageList(bo,pageQuery);
// return getDataTable(pageList);
// }
//
// /**
// * 获取请填写功能名称详细信息
// */
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(supplierService.getById(id));
// }
//
// /**
// * 新增请填写功能名称
// */
// @PostMapping
// public AjaxResult add(@RequestBody OGoodsSupplier scmSupplier)
// {
// scmSupplier.setCreatetime(new Date());
// scmSupplier.setIsdelete(0);
// return toAjax(supplierService.save(scmSupplier));
// }
//
// /**
// * 修改请填写功能名称
// */
// @PutMapping
// public AjaxResult edit(@RequestBody OGoodsSupplier scmSupplier)
// {
// return toAjax(supplierService.updateById(scmSupplier));
// }
//
// /**
// * 删除请填写功能名称
// */
// @DeleteMapping("/{ids}")
// public AjaxResult remove(@PathVariable Long[] ids)
// {
// return toAjax(supplierService.removeByIds(Arrays.stream(ids).toList()));
// }
//}

View File

@ -1,113 +1,113 @@
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());
//package cn.qihangerp.oms.controller;
//
// } 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);
// }
//
//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;
//
// /**
// * 订单发货
// * @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
// */
// @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);
// @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);
//// }
//
//}

View File

@ -1,54 +1,54 @@
package cn.qihangerp.oms.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
//package cn.qihangerp.oms.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
// */
// @PostMapping("/updateErpSkuId")
// public AjaxResult ship(@RequestBody OOrderItem orderItem)
//@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)
// {
// if(StringUtils.isEmpty(orderItem.getId()) || orderItem.getGoodsSkuId()==null){
// return AjaxResult.error("确少必要参数");
// var pageList = itemService.selectPageVo(pageQuery,bo);
// 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();
//// }
//}

View File

@ -1,90 +1,90 @@
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) {
//package cn.qihangerp.oms.controller;
//
// 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);
//
//
//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));
// }
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());
}
}
//
//
// /**
// * 推送退款到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());
// }
//}

View File

@ -1,58 +1,58 @@
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.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);
}
}
//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.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);
// }
//}

View File

@ -1,67 +1,67 @@
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());
//package cn.qihangerp.oms.controller;
//
// JSONObject jsonObject = taoApiService.orderShip(authorization, bo);
// return AjaxResult.success();
// }else{
// return AjaxResult.error(result.getCode(),result.getMsg());
//
//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));
// }
return AjaxResult.success();
}
}
//
//
// @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();
// }
//}

View File

@ -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 (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 (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 (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);

View File

@ -15,14 +15,14 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<goods-api.version>1.1.1</goods-api.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<groupId>cn.qihangerp.module</groupId>
<artifactId>goods</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</project>

View File

@ -1,13 +1,8 @@
package com.zhijian;
package cn.qihangerp.api.goods;
//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.Configuration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.FilterType;
@ -17,7 +12,7 @@ import org.springframework.context.annotation.FilterType;
//@EnableAutoConfiguration
@Configuration
//@EnableAutoConfiguration(exclude = MybatisAutoConfiguration.class)
@ComponentScan(basePackages = "com.zhijian",
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = FrameworkAutoConfiguration.class))
public class FrameworkAutoConfiguration {
@ComponentScan(basePackages = "cn.qihangerp.api.goods",
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = GoodsApiAutoConfiguration.class))
public class GoodsApiAutoConfiguration {
}

View File

@ -9,11 +9,12 @@ import org.springframework.context.annotation.Configuration;
@Configuration
@MapperScan({"cn.qihangerp.module.*.mapper"})
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); //注意使用哪种数据库
return interceptor;
}
public class GoodsApiMybatisPlusConfig {
// @Bean(name = "mybatisPlusInterceptorGoodsApi")
// public MybatisPlusInterceptor mybatisPlusInterceptor() {
// MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); //注意使用哪种数据库
// return interceptor;
// }
}

View File

@ -1,15 +1,11 @@
package cn.qihangerp.oms.controller;
package cn.qihangerp.api.goods.controller;
import cn.qihangerp.common.AjaxResult;
import cn.qihangerp.common.PageQuery;
import cn.qihangerp.common.TableDataInfo;
import cn.qihangerp.module.goods.domain.OGoodsBrand;
import cn.qihangerp.module.goods.service.OGoodsBrandService;
import cn.qihangerp.security.common.BaseController;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

View File

@ -1,4 +1,4 @@
package cn.qihangerp.oms.controller;
package cn.qihangerp.api.goods.controller;

View File

@ -1,34 +1,19 @@
package cn.qihangerp.oms.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;
package cn.qihangerp.api.goods.controller;
import cn.qihangerp.common.*;
import cn.qihangerp.module.goods.domain.OGoods;
import cn.qihangerp.module.goods.domain.OGoodsSku;
import cn.qihangerp.module.goods.domain.bo.GoodsAddBo;
import cn.qihangerp.module.goods.domain.vo.GoodsSpecListVo;
import cn.qihangerp.module.goods.service.OGoodsService;
import cn.qihangerp.module.goods.service.OGoodsSkuService;
import cn.qihangerp.security.common.BaseController;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
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.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@ -158,90 +143,90 @@ public class GoodsController extends BaseController
else return AjaxResult.error();
}
@RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
String fileName = file.getOriginalFilename();
String dir = System.getProperty("user.dir");
String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
System.out.println(destFileName);
File destFile = new File(destFileName);
file.transferTo(destFile);
InputStream fis = null;
fis = new FileInputStream(destFileName);
if (fis == null) return AjaxResult.error("没有文件");
Workbook workbook = null;
try {
if (fileName.toLowerCase().endsWith("xlsx")) {
workbook = new XSSFWorkbook(fis);
} else if (fileName.toLowerCase().endsWith("xls")) {
workbook = new HSSFWorkbook(fis);
}
// workbook = new HSSFWorkbook(fis);
} catch (Exception ex) {
return AjaxResult.error(ex.getMessage());
}
if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
/****************开始处理excel****************/
int success = 0;
int fail = 0;
Sheet sheet = null;
try {
sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum();//最后一行索引
Row row = null;
for (int i = 1; i <= lastRowNum; i++) {
row = sheet.getRow(i);
//数据
OGoodsSku sku = new OGoodsSku();
for(int c=0;c<6;c++){
Cell cell = row.getCell(c);
String cellValue = "";
if (cell != null) {
if (cell.getCellType() == CellType.STRING) {
cellValue = cell.getStringCellValue().replace("\t", "");
} else if (cell.getCellType() == CellType.NUMERIC) {
cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
}
}
if(c == 1) {
if(StringUtils.hasText(cellValue) ){
sku.setOuterErpGoodsId(cellValue);
}else {
sku.setOuterErpGoodsId("0");
}
}
if(StringUtils.hasText(cellValue)) {
if (c == 0) {
sku.setOuterErpSkuId(cellValue);
} else if (c == 2) {
sku.setSkuCode(cellValue);
} else if (c == 3) {
sku.setSkuName(cellValue);
} else if (c == 4) {
sku.setColorImage(cellValue);
} else if (c == 5) {
sku.setRemark(cellValue);
}
}
}
goodsService.insertGoodsSku(sku);
success++;
}
} catch (Exception ex) {
fail++;
ex.printStackTrace();
}
Map<String, Integer> result = new HashMap<>();
result.put("success",success);
result.put("fail",fail);
return AjaxResult.success(result);
}
// @RequestMapping(value = "/goods_sku_import", method = RequestMethod.POST)
// public AjaxResult orderSendExcel(@RequestPart("file") MultipartFile file) throws IOException, InvalidFormatException {
//
// String fileName = file.getOriginalFilename();
// String dir = System.getProperty("user.dir");
// String destFileName = dir + File.separator + "/import/uploadedfiles_" + fileName;
// System.out.println(destFileName);
// File destFile = new File(destFileName);
// file.transferTo(destFile);
// InputStream fis = null;
// fis = new FileInputStream(destFileName);
// if (fis == null) return AjaxResult.error("没有文件");
//
// Workbook workbook = null;
//
// try {
// if (fileName.toLowerCase().endsWith("xlsx")) {
// workbook = new XSSFWorkbook(fis);
// } else if (fileName.toLowerCase().endsWith("xls")) {
// workbook = new HSSFWorkbook(fis);
// }
// // workbook = new HSSFWorkbook(fis);
// } catch (Exception ex) {
// return AjaxResult.error(ex.getMessage());
// }
//
// if (workbook == null) return AjaxResult.error(502, "未读取到Excel文件");
//
// /****************开始处理excel****************/
// int success = 0;
// int fail = 0;
// Sheet sheet = null;
// try {
// sheet = workbook.getSheetAt(0);
// int lastRowNum = sheet.getLastRowNum();//最后一行索引
// Row row = null;
//
// for (int i = 1; i <= lastRowNum; i++) {
// row = sheet.getRow(i);
// //数据
// OGoodsSku sku = new OGoodsSku();
// for(int c=0;c<6;c++){
// Cell cell = row.getCell(c);
// String cellValue = "";
// if (cell != null) {
// if (cell.getCellType() == CellType.STRING) {
// cellValue = cell.getStringCellValue().replace("\t", "");
// } else if (cell.getCellType() == CellType.NUMERIC) {
// cellValue = NumberToTextConverter.toText(cell.getNumericCellValue()).replace("\t", "");
// }
// }
// if(c == 1) {
// if(StringUtils.hasText(cellValue) ){
// sku.setOuterErpGoodsId(cellValue);
// }else {
// sku.setOuterErpGoodsId("0");
// }
// }
// if(StringUtils.hasText(cellValue)) {
// if (c == 0) {
// sku.setOuterErpSkuId(cellValue);
// } else if (c == 2) {
// sku.setSkuCode(cellValue);
// } else if (c == 3) {
// sku.setSkuName(cellValue);
// } else if (c == 4) {
// sku.setColorImage(cellValue);
// } else if (c == 5) {
// sku.setRemark(cellValue);
// }
// }
// }
// goodsService.insertGoodsSku(sku);
// success++;
// }
//
//
// } catch (Exception ex) {
// fail++;
// ex.printStackTrace();
// }
// Map<String, Integer> result = new HashMap<>();
// result.put("success",success);
// result.put("fail",fail);
// return AjaxResult.success(result);
// }
}

View File

@ -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.PageQuery;
import cn.qihangerp.common.PageResult;
import cn.qihangerp.common.TableDataInfo;
import cn.qihangerp.module.goods.domain.OGoodsInventory;
import cn.qihangerp.module.goods.domain.OGoodsInventoryBatch;

View File

@ -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.PageQuery;
import cn.qihangerp.common.TableDataInfo;
import cn.qihangerp.module.goods.domain.OGoodsSupplier;
import cn.qihangerp.module.goods.service.OGoodsSupplierService;

View File

@ -1 +1 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.zhijian.FrameworkAutoConfiguration
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.qihangerp.api.goods.GoodsApiAutoConfiguration

View File

@ -1,89 +1,4 @@
server:
port: 8083
spring:
application:
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日志
qihangerp:
name: 启航电商ERP
goods:
version: 2.4.21

View File

@ -1,24 +1,10 @@
Application Version: ${zhijian.version}
Application Version: 2.4.21
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////
_______ _________ _______ _ _______ _______ _______ _______
( ___ )\__ __/|\ /|( ___ )( ( /|( ____ \( ____ \( ____ )( ____ )
| ( ) | ) ( | ) ( || ( ) || \ ( || ( \/| ( \/| ( )|| ( )|
| | | | | | | (___) || (___) || \ | || | | (__ | (____)|| (____)|
| | | | | | | ___ || ___ || (\ \) || | ____ | __) | __)| _____)
| | /\| | | | | ( ) || ( ) || | \ || | \_ )| ( | (\ ( | (
| (_\ \ |___) (___| ) ( || ) ( || ) \ || (___) || (____/\| ) \ \__| )
(____\/_)\_______/|/ \||/ \||/ )_)(_______)(_______/|/ \__/|/

View File

@ -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>

View File

@ -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 {
}

View File

@ -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;
// }
}

View File

@ -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);
// }
}

View File

@ -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);
// }
}

View File

@ -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();
// }
}

View File

@ -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());
}
}

View File

@ -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);
}
}

View File

@ -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();
}
}

View File

@ -0,0 +1 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.qihangerp.api.order.OrderApiAutoConfiguration

View File

@ -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日志

View File

@ -0,0 +1,10 @@
Application Version: 2.4.21
Spring Boot Version: ${spring-boot.version}
_______ _________ _______ _ _______ _______ _______ _______
( ___ )\__ __/|\ /|( ___ )( ( /|( ____ \( ____ \( ____ )( ____ )
| ( ) | ) ( | ) ( || ( ) || \ ( || ( \/| ( \/| ( )|| ( )|
| | | | | | | (___) || (___) || \ | || | | (__ | (____)|| (____)|
| | | | | | | ___ || ___ || (\ \) || | ____ | __) | __)| _____)
| | /\| | | | | ( ) || ( ) || | \ || | \_ )| ( | (\ ( | (
| (_\ \ |___) (___| ) ( || ) ( || ) \ || (___) || (____/\| ) \ \__| )
(____\/_)\_______/|/ \||/ \||/ )_)(_______)(_______/|/ \__/|/

View File

@ -2,29 +2,72 @@
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</groupId>
<artifactId>qihangerp-cloud</artifactId>
<version>2.0.6</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.2</version>
<relativePath/>
</parent>
<groupId>cn.qihangerp.services</groupId>
<artifactId>microservices</artifactId>
<version>3.0.6</version>
<packaging>jar</packaging>
<version>1.0.6</version>
<packaging>pom</packaging>
<name>microservices</name>
<url>http://maven.apache.org</url>
<modules>
<module>goods-api</module>
<module>order-api</module>
</modules>
<properties>
<java.version>17</java.version>
<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>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<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>
</dependencies>
</project>

View File

@ -1,13 +0,0 @@
package cn.qihangerp.module;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -1,4 +0,0 @@
package cn.qihangerp.module.goods;
public class a {
}

View File

@ -1,13 +0,0 @@
package cn.qihangerp.module;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

View File

@ -1,4 +0,0 @@
package cn.qihangerp.module.order;
public class a {
}

View File

@ -13,6 +13,7 @@
<module>api</module>
<module>core</module>
<module>module</module>
<module>microservices</module>
</modules>
<properties>