diff --git a/api/oms-api/pom.xml b/api/oms-api/pom.xml index bc8e6d20..676fc4b8 100644 --- a/api/oms-api/pom.xml +++ b/api/oms-api/pom.xml @@ -63,21 +63,33 @@ security 1.0 - - cn.qihangerp.module - goods - 1.0 - - - cn.qihangerp.module - order - 1.0 - + + + + + + + + + + cn.qihangerp.module stock 1.0 + + + cn.qihangerp.services + goods-api + 1.0.6 + + + cn.qihangerp.services + order-api + 1.0.6 + + mysql mysql-connector-java diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/config/MybatisPlusConfig.java b/api/oms-api/src/main/java/cn/qihangerp/oms/config/MybatisPlusConfig.java index 20d374cf..95f318ef 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/config/MybatisPlusConfig.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/config/MybatisPlusConfig.java @@ -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(); diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/AfterSaleProcessingController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/AfterSaleProcessingController.java index 025f2849..7d86cf34 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/AfterSaleProcessingController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/AfterSaleProcessingController.java @@ -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 queryPageList(OAfterSale bo, PageQuery pageQuery) { - // LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(). - // eq( OAfterSale::getType, bo.getType()) - // .eq(bo.getShopId() != null, OAfterSale::getShopId, bo.getShopId()); - // - // Page pages = mapper.selectPage(pageQuery.build(), queryWrapper); - // return PageResult.build(pages); - // } -// bo.setType(80); - PageResult 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 result = afterSaleService.queryPageList(bo, pageQuery); +// //private final OAfterSaleMapper mapper; +// // @Override +// // public PageResult queryPageList(OAfterSale bo, PageQuery pageQuery) { +// // LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(). +// // eq( OAfterSale::getType, bo.getType()) +// // .eq(bo.getShopId() != null, OAfterSale::getShopId, bo.getShopId()); +// // +// // Page pages = mapper.selectPage(pageQuery.build(), queryWrapper); +// // return PageResult.build(pages); +// // } +//// bo.setType(80); +// PageResult result = afterSaleService.queryPageList(bo, pageQuery); // return getDataTable(result); // } // -// @GetMapping("/exchange_list") -// public TableDataInfo exchange_list(ErpAfterSale bo, PageQuery pageQuery) -// { -// bo.setType(20); -// PageResult 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 result = afterSaleService.queryPageList(bo, pageQuery); +//// return getDataTable(result); +//// } +//// +//// @GetMapping("/exchange_list") +//// public TableDataInfo exchange_list(ErpAfterSale bo, PageQuery pageQuery) +//// { +//// bo.setType(20); +//// PageResult 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 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 result = afterSaleService.queryPageList(bo, pageQuery); -// return getDataTable(result); -// } - - -} +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsBrandController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsBrandController.java index c6ef9e15..32a669a1 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsBrandController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsBrandController.java @@ -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())); +// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsCategoryController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsCategoryController.java index 7166a198..16e9fff8 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsCategoryController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsCategoryController.java @@ -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().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().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().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().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())); +// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsController.java index 793522cd..e5c5c146 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsController.java @@ -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 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 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 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 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 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 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 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 result = new HashMap<>(); +// result.put("success",success); +// result.put("fail",fail); +// return AjaxResult.success(result); +// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsInventoryController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsInventoryController.java index ca8b98eb..2a2bb204 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsInventoryController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsInventoryController.java @@ -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 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 list = inventoryBatchService.list(new LambdaQueryWrapper().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 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 list = inventoryBatchService.list(new LambdaQueryWrapper().eq(OGoodsInventoryBatch::getSkuId, goodsInventory.getSkuId())); +// return AjaxResult.success(list); +// } +// return success(); +// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsSupplierController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsSupplierController.java index 71451fda..3aa60cb5 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsSupplierController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/GoodsSupplierController.java @@ -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())); +// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderController.java index 4141ca63..2f15eea6 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderController.java @@ -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); +//// } +// +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderItemController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderItemController.java index e5574502..2a06393a 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderItemController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/OrderItemController.java @@ -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); - } - +//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; +// // /** -// * 更新erp sku id -// * @param orderItem -// * @return +// * 查询店铺订单列表 // */ -// @PostMapping("/updateErpSkuId") -// public AjaxResult ship(@RequestBody OOrderItem orderItem) +// @GetMapping("/item_list") +// public TableDataInfo list(OrderItemListBo bo, PageQuery pageQuery) // { -// if(StringUtils.isEmpty(orderItem.getId()) || orderItem.getGoodsSkuId()==null){ -// return AjaxResult.error("确少必要参数"); -// } -// itemService.updateErpSkuId(orderItem.getId(), orderItem.getGoodsSkuId()); -// return AjaxResult.success(); +// 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(); +//// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/RefundController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/RefundController.java index 41147877..44d711e0 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/RefundController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/RefundController.java @@ -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); -// } -// } - - return success(); - } - - - @PostMapping("/processing") - public AjaxResult refundProcessing(@RequestBody RefundProcessingBo bo ) { - if (bo.getRefundId() == null) return AjaxResult.error(500, "缺少参数refundId"); - ResultVo resultVo = refundService.refundProcessing(bo,getUsername()); - if(resultVo.getCode() == 0) return success(); - else return AjaxResult.error(resultVo.getMsg()); - } -} +// +// +//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 resultVo = refundService.refundProcessing(bo,getUsername()); +// if(resultVo.getCode() == 0) return success(); +// else return AjaxResult.error(resultVo.getMsg()); +// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipStockupController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipStockupController.java index 74979105..193285af 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipStockupController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipStockupController.java @@ -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); +// } +//} diff --git a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipmentController.java b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipmentController.java index e1afadca..1310c91f 100644 --- a/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipmentController.java +++ b/api/oms-api/src/main/java/cn/qihangerp/oms/controller/ShipmentController.java @@ -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()); -// } - - return AjaxResult.success(); - } -} +// +//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(); +// } +//} diff --git a/docs/qihang-oms.sql b/docs/qihang-oms.sql index e2f059d3..41d313c3 100644 --- a/docs/qihang-oms.sql +++ b/docs/qihang-oms.sql @@ -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); diff --git a/microservices/goods-api/pom.xml b/microservices/goods-api/pom.xml index fb4b7d04..ac68c290 100644 --- a/microservices/goods-api/pom.xml +++ b/microservices/goods-api/pom.xml @@ -15,14 +15,14 @@ UTF-8 + 1.1.1 - junit - junit - 3.8.1 - test + cn.qihangerp.module + goods + 1.0 diff --git a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/AutoConfiguration.java b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/GoodsApiAutoConfiguration.java similarity index 52% rename from microservices/goods-api/src/main/java/cn/qihangerp/api/goods/AutoConfiguration.java rename to microservices/goods-api/src/main/java/cn/qihangerp/api/goods/GoodsApiAutoConfiguration.java index 6d286ad1..f90d3354 100644 --- a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/AutoConfiguration.java +++ b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/GoodsApiAutoConfiguration.java @@ -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 { } diff --git a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/config/GoodsApiMybatisPlusConfig.java b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/config/GoodsApiMybatisPlusConfig.java index af6a2d83..32588539 100644 --- a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/config/GoodsApiMybatisPlusConfig.java +++ b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/config/GoodsApiMybatisPlusConfig.java @@ -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; +// } } diff --git a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsBrandController.java b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsBrandController.java index c6ef9e15..ac029854 100644 --- a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsBrandController.java +++ b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsBrandController.java @@ -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.*; diff --git a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsCategoryController.java b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsCategoryController.java index 7166a198..d8b56822 100644 --- a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsCategoryController.java +++ b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsCategoryController.java @@ -1,4 +1,4 @@ -package cn.qihangerp.oms.controller; +package cn.qihangerp.api.goods.controller; diff --git a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsController.java b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsController.java index 793522cd..4a0ac326 100644 --- a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsController.java +++ b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsController.java @@ -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 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 result = new HashMap<>(); +// result.put("success",success); +// result.put("fail",fail); +// return AjaxResult.success(result); +// } } diff --git a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsInventoryController.java b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsInventoryController.java index ca8b98eb..82ef903f 100644 --- a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsInventoryController.java +++ b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsInventoryController.java @@ -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; diff --git a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsSupplierController.java b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsSupplierController.java index 71451fda..1ff5d86f 100644 --- a/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsSupplierController.java +++ b/microservices/goods-api/src/main/java/cn/qihangerp/api/goods/controller/GoodsSupplierController.java @@ -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; diff --git a/microservices/goods-api/src/main/resources/META-INF/spring.factories b/microservices/goods-api/src/main/resources/META-INF/spring.factories index c52354d8..ad191ba7 100644 --- a/microservices/goods-api/src/main/resources/META-INF/spring.factories +++ b/microservices/goods-api/src/main/resources/META-INF/spring.factories @@ -1 +1 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.zhijian.FrameworkAutoConfiguration \ No newline at end of file +org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.qihangerp.api.goods.GoodsApiAutoConfiguration \ No newline at end of file diff --git a/microservices/goods-api/src/main/resources/application.yml b/microservices/goods-api/src/main/resources/application.yml index 5f368c1d..35bc8f62 100644 --- a/microservices/goods-api/src/main/resources/application.yml +++ b/microservices/goods-api/src/main/resources/application.yml @@ -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日志 \ No newline at end of file +qihangerp: + name: 启航电商ERP + goods: + version: 2.4.21 \ No newline at end of file diff --git a/microservices/goods-api/src/main/resources/banner.txt b/microservices/goods-api/src/main/resources/banner.txt index bda2abc7..b2d3f138 100644 --- a/microservices/goods-api/src/main/resources/banner.txt +++ b/microservices/goods-api/src/main/resources/banner.txt @@ -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 // -//////////////////////////////////////////////////////////////////// \ No newline at end of file + _______ _________ _______ _ _______ _______ _______ _______ +( ___ )\__ __/|\ /|( ___ )( ( /|( ____ \( ____ \( ____ )( ____ ) +| ( ) | ) ( | ) ( || ( ) || \ ( || ( \/| ( \/| ( )|| ( )| +| | | | | | | (___) || (___) || \ | || | | (__ | (____)|| (____)| +| | | | | | | ___ || ___ || (\ \) || | ____ | __) | __)| _____) +| | /\| | | | | ( ) || ( ) || | \ || | \_ )| ( | (\ ( | ( +| (_\ \ |___) (___| ) ( || ) ( || ) \ || (___) || (____/\| ) \ \__| ) +(____\/_)\_______/|/ \||/ \||/ )_)(_______)(_______/|/ \__/|/ diff --git a/microservices/order-api/pom.xml b/microservices/order-api/pom.xml new file mode 100644 index 00000000..08153e9b --- /dev/null +++ b/microservices/order-api/pom.xml @@ -0,0 +1,27 @@ + + 4.0.0 + + cn.qihangerp.services + microservices + 1.0.6 + + + order-api + jar + + order-api + http://maven.apache.org + + + UTF-8 + + + + + cn.qihangerp.module + order + 1.0 + + + diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/OrderApiAutoConfiguration.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/OrderApiAutoConfiguration.java new file mode 100644 index 00000000..04ed9da0 --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/OrderApiAutoConfiguration.java @@ -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 { +} diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/config/OrderApiMybatisPlusConfig.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/config/OrderApiMybatisPlusConfig.java new file mode 100644 index 00000000..8124bcd7 --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/config/OrderApiMybatisPlusConfig.java @@ -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; +// } +} diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/AfterSaleProcessingController.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/AfterSaleProcessingController.java new file mode 100644 index 00000000..c37cec9c --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/AfterSaleProcessingController.java @@ -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 queryPageList(OAfterSale bo, PageQuery pageQuery) { + // LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(). + // eq( OAfterSale::getType, bo.getType()) + // .eq(bo.getShopId() != null, OAfterSale::getShopId, bo.getShopId()); + // + // Page pages = mapper.selectPage(pageQuery.build(), queryWrapper); + // return PageResult.build(pages); + // } +// bo.setType(80); + PageResult 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 result = afterSaleService.queryPageList(bo, pageQuery); +// return getDataTable(result); +// } +// +// @GetMapping("/exchange_list") +// public TableDataInfo exchange_list(ErpAfterSale bo, PageQuery pageQuery) +// { +// bo.setType(20); +// PageResult 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 result = afterSaleService.queryPageList(bo, pageQuery); +// return getDataTable(result); +// } + + +} diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/OrderController.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/OrderController.java new file mode 100644 index 00000000..814a99ee --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/OrderController.java @@ -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); +// } + +} diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/OrderItemController.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/OrderItemController.java new file mode 100644 index 00000000..847780ea --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/OrderItemController.java @@ -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(); +// } +} diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/RefundController.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/RefundController.java new file mode 100644 index 00000000..af1a39f7 --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/RefundController.java @@ -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 resultVo = refundService.refundProcessing(bo,getUsername()); + if(resultVo.getCode() == 0) return success(); + else return AjaxResult.error(resultVo.getMsg()); + } +} diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/ShipStockupController.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/ShipStockupController.java new file mode 100644 index 00000000..34cf488e --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/ShipStockupController.java @@ -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); + } +} diff --git a/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/ShipmentController.java b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/ShipmentController.java new file mode 100644 index 00000000..4993d9ea --- /dev/null +++ b/microservices/order-api/src/main/java/cn/qihangerp/api/order/controller/ShipmentController.java @@ -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(); + } +} diff --git a/microservices/order-api/src/main/resources/META-INF/spring.factories b/microservices/order-api/src/main/resources/META-INF/spring.factories new file mode 100644 index 00000000..592be92e --- /dev/null +++ b/microservices/order-api/src/main/resources/META-INF/spring.factories @@ -0,0 +1 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.qihangerp.api.order.OrderApiAutoConfiguration \ No newline at end of file diff --git a/microservices/order-api/src/main/resources/application.yml b/microservices/order-api/src/main/resources/application.yml new file mode 100644 index 00000000..d66feddd --- /dev/null +++ b/microservices/order-api/src/main/resources/application.yml @@ -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日志 \ No newline at end of file diff --git a/microservices/order-api/src/main/resources/banner.txt b/microservices/order-api/src/main/resources/banner.txt new file mode 100644 index 00000000..b2d3f138 --- /dev/null +++ b/microservices/order-api/src/main/resources/banner.txt @@ -0,0 +1,10 @@ +Application Version: 2.4.21 +Spring Boot Version: ${spring-boot.version} + _______ _________ _______ _ _______ _______ _______ _______ +( ___ )\__ __/|\ /|( ___ )( ( /|( ____ \( ____ \( ____ )( ____ ) +| ( ) | ) ( | ) ( || ( ) || \ ( || ( \/| ( \/| ( )|| ( )| +| | | | | | | (___) || (___) || \ | || | | (__ | (____)|| (____)| +| | | | | | | ___ || ___ || (\ \) || | ____ | __) | __)| _____) +| | /\| | | | | ( ) || ( ) || | \ || | \_ )| ( | (\ ( | ( +| (_\ \ |___) (___| ) ( || ) ( || ) \ || (___) || (____/\| ) \ \__| ) +(____\/_)\_______/|/ \||/ \||/ )_)(_______)(_______/|/ \__/|/ diff --git a/microservices/pom.xml b/microservices/pom.xml index 420c597e..fcea2859 100644 --- a/microservices/pom.xml +++ b/microservices/pom.xml @@ -2,29 +2,72 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - cn.qihangerp - qihangerp-cloud - 2.0.6 + org.springframework.boot + spring-boot-starter-parent + 3.0.2 + cn.qihangerp.services microservices - 3.0.6 - jar + 1.0.6 + pom microservices http://maven.apache.org + + goods-api + order-api + + 17 UTF-8 + UTF-8 + 3.0.2 + 2022.0.0.0 + 0.11.5 - junit - junit - 3.8.1 - test + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-undertow + + + mysql + mysql-connector-java + 8.0.33 + + + com.baomidou + mybatis-plus-boot-starter + 3.5.5 + + + cn.qihangerp.core + security + 1.0 + + + org.projectlombok + lombok + 1.18.30 + provided diff --git a/module/goods/src/main/java/cn/qihangerp/module/App.java b/module/goods/src/main/java/cn/qihangerp/module/App.java deleted file mode 100644 index 06eca50c..00000000 --- a/module/goods/src/main/java/cn/qihangerp/module/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package cn.qihangerp.module; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/module/goods/src/main/java/cn/qihangerp/module/goods/a.java b/module/goods/src/main/java/cn/qihangerp/module/goods/a.java deleted file mode 100644 index c6ea7b9a..00000000 --- a/module/goods/src/main/java/cn/qihangerp/module/goods/a.java +++ /dev/null @@ -1,4 +0,0 @@ -package cn.qihangerp.module.goods; - -public class a { -} diff --git a/module/order/src/main/java/cn/qihangerp/module/App.java b/module/order/src/main/java/cn/qihangerp/module/App.java deleted file mode 100644 index 06eca50c..00000000 --- a/module/order/src/main/java/cn/qihangerp/module/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package cn.qihangerp.module; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/module/order/src/main/java/cn/qihangerp/module/order/a.java b/module/order/src/main/java/cn/qihangerp/module/order/a.java deleted file mode 100644 index 79a1d369..00000000 --- a/module/order/src/main/java/cn/qihangerp/module/order/a.java +++ /dev/null @@ -1,4 +0,0 @@ -package cn.qihangerp.module.order; - -public class a { -} diff --git a/pom.xml b/pom.xml index 332a0104..3d32bd4e 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ api core module + microservices