
199 changed files with 8865 additions and 119 deletions
@ -0,0 +1,70 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.basebrandinfo.*; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 15:49 |
|||
*/ |
|||
@Api(tags = "商品品牌") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/base/basegoodsbrand") |
|||
public class BaseGoodsBrandRest { |
|||
|
|||
@Autowired |
|||
BaseBrandInfoService baseBrandInfoService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<BaseBrandInfoVo>> listPage(@RequestBody PagerQuery<BaseBrandInfoQuery> pq) { |
|||
return baseBrandInfoService.listPage(pq); |
|||
} |
|||
|
|||
@ApiOperation("查询所有的品牌") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<BaseBrandInfo>> listAll(@RequestBody OrgPathQuery query) { |
|||
return baseBrandInfoService.listAll(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody BaseBrandInfoDto dto) { |
|||
return baseBrandInfoService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<BaseBrandInfoVo> initialization(@PathVariable("sid") String sid) { |
|||
return baseBrandInfoService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return baseBrandInfoService.delete(sid); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
baseBrandInfoService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return baseBrandInfoService.updateIsEnable(sid,isEnable); |
|||
} |
|||
} |
@ -0,0 +1,84 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.basegoodsspu.BaseGoodsSpuDto; |
|||
import com.yxt.oms.biz.func.basegoodsspu.BaseGoodsSpuQuery; |
|||
import com.yxt.oms.biz.func.basegoodsspu.BaseGoodsSpuService; |
|||
import com.yxt.oms.biz.func.basegoodsspu.BaseGoodsSpuVo; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/4/12 11:20 |
|||
*/ |
|||
@RestController() |
|||
@RequestMapping("/apiadmin/base/basegoodsspu") |
|||
public class BaseGoodsSpuRest { |
|||
|
|||
|
|||
@Autowired |
|||
BaseGoodsSpuService baseGoodsSpuService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<BaseGoodsSpuVo>> listPage(@RequestBody PagerQuery<BaseGoodsSpuQuery> pq) { |
|||
return baseGoodsSpuService.listPage(pq); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody BaseGoodsSpuDto dto) { |
|||
return baseGoodsSpuService.saveOrUpdate(dto); |
|||
} |
|||
// @ApiOperation("保存商品信息及sku")
|
|||
// @PostMapping("/save")
|
|||
// public ResultBean<String> save(@RequestBody BaseGoodsSpuDto dto) {
|
|||
// return baseGoodsSpuService.save(dto);
|
|||
// }
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<BaseGoodsSpuVo> initialization(@PathVariable("sid") String sid) { |
|||
return baseGoodsSpuService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return baseGoodsSpuService.delete(sid); |
|||
} |
|||
|
|||
@ApiOperation("批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids) { |
|||
return baseGoodsSpuService.delAll(sids); |
|||
} |
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return baseGoodsSpuService.updateIsEnable(sid,isEnable); |
|||
} |
|||
@ApiOperation("下载模版") |
|||
@PostMapping("/download") |
|||
public void download(HttpServletRequest request, HttpServletResponse response) { |
|||
baseGoodsSpuService.download(request, response); |
|||
} |
|||
@ApiOperation("导入excel") |
|||
@PostMapping("/importExcel") |
|||
public ResultBean importExcel(@RequestParam("file")MultipartFile file) throws IOException { |
|||
return baseGoodsSpuService.importExcel(file); |
|||
} |
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnablebySku/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnablebySku(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable){ |
|||
return baseGoodsSpuService.updateIsEnablebySku(sid,isEnable); |
|||
} |
|||
} |
@ -0,0 +1,73 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.basegoodstype.*; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:44 |
|||
*/ |
|||
@Api(tags = "商品类型") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/base/basegoodstype") |
|||
public class BaseGoodsTypeRest { |
|||
@Autowired |
|||
BaseGoodsTypeService baseGoodsTypeService; |
|||
|
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<BaseGoodsTypeVo>> listPage(@RequestBody PagerQuery<BaseGoodsTypeQuery> pq) { |
|||
return baseGoodsTypeService.listPage(pq); |
|||
} |
|||
@ApiOperation("查询所有的类别") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<BaseGoodsType>> listAll(@RequestBody OrgPathQuery query) { |
|||
return baseGoodsTypeService.listAll(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody BaseGoodsTypeDto dto) { |
|||
return baseGoodsTypeService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<BaseGoodsTypeVo> initialization(@PathVariable("sid") String sid) { |
|||
return baseGoodsTypeService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return baseGoodsTypeService.delete(sid); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
baseGoodsTypeService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return baseGoodsTypeService.updateIsEnable(sid,isEnable); |
|||
} |
|||
@ApiOperation("更改商品是否一品一码") |
|||
@GetMapping("/updateIsGoodsID/{sid}/{state}") |
|||
public ResultBean updateIsGoodsID(@PathVariable("sid") String sid,@PathVariable("state")String state){ |
|||
return baseGoodsTypeService.updateProductCode(sid, state); |
|||
} |
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.basegoodsunit.*; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/3/8 9:19 |
|||
*/ |
|||
@Api(tags = "商品类型") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/base/basegoodsunit") |
|||
public class BaseGoodsUnitRest { |
|||
@Autowired |
|||
BaseGoodsUnitService baseGoodsUnitService; |
|||
|
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<BaseGoodsUnitVo>> listPage(@RequestBody PagerQuery<BaseGoodsUnitQuery> pq) { |
|||
return baseGoodsUnitService.listPage(pq); |
|||
} |
|||
@ApiOperation("查询所有的类别") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<BaseGoodsUnit>> listAll(@RequestBody OrgPathQuery query) { |
|||
return baseGoodsUnitService.listAll(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody BaseGoodsUnitDto dto) { |
|||
return baseGoodsUnitService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<BaseGoodsUnitVo> initialization(@PathVariable("sid") String sid) { |
|||
return baseGoodsUnitService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return baseGoodsUnitService.delete(sid); |
|||
} |
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids) { |
|||
return baseGoodsUnitService.delAll(sids); |
|||
} |
|||
|
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return baseGoodsUnitService.updateIsEnable(sid,isEnable); |
|||
} |
|||
} |
@ -0,0 +1,76 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.basemanufacturer.*; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/27 13:56 |
|||
*/ |
|||
@Api(tags = "厂家信息") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/base/basemanufacturer") |
|||
public class BaseManufacturerRest { |
|||
|
|||
@Autowired |
|||
BaseManufacturerService baseManufacturerService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<BaseManufacturerVo>> listPage(@RequestBody PagerQuery<BaseManufacturerQuery> pq) { |
|||
return baseManufacturerService.listPage(pq); |
|||
} |
|||
|
|||
@ApiOperation("查询所有的厂家") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<BaseManufacturer>> listAll(@RequestBody OrgPathQuery query) { |
|||
return baseManufacturerService.listAll(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody BaseManufacturerDto dto) { |
|||
return baseManufacturerService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<BaseManufacturerVo> initialization(@PathVariable("sid") String sid) { |
|||
return baseManufacturerService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return baseManufacturerService.delete(sid); |
|||
} |
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
baseManufacturerService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid, @PathVariable("isEnable") String isEnable) { |
|||
return baseManufacturerService.updateIsEnable(sid, isEnable); |
|||
} |
|||
|
|||
@ApiOperation("查询分公司下所有的厂家") |
|||
@GetMapping("/getAllTypeByUseOrgSid") |
|||
public ResultBean<List<BaseManufacturerVo>> getAllTypeByUseOrgSid(@RequestParam("useOrgSid") String useOrgSid) { |
|||
return baseManufacturerService.getAllTypeByUseOrgSid(useOrgSid); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.baseproduct.*; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/3/7 16:58 |
|||
*/ |
|||
@Api(tags = "产品管理") |
|||
@RestController |
|||
@RequestMapping("/v1/product") |
|||
public class BaseProductRest { |
|||
@Autowired |
|||
private BaseProductService baseProductService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<BaseProductVo>> listPage(@RequestBody PagerQuery<BaseProductQuery> pq) { |
|||
return baseProductService.listPage(pq); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean saveOrUpdate(@RequestBody BaseProductDto dto) { |
|||
return baseProductService.saveProduct(dto); |
|||
} |
|||
|
|||
@ApiOperation("编辑回显") |
|||
@GetMapping("/fetchBySid") |
|||
public ResultBean<BaseProductDetailsVo> fetchBySid(@RequestParam("sid") String sid) { |
|||
return baseProductService.fetchDetailsBySid(sid); |
|||
} |
|||
|
|||
@ApiOperation("批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids) { |
|||
return baseProductService.deleteBySids(sids); |
|||
} |
|||
} |
@ -0,0 +1,85 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.supplierbank.*; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* Project: yxt-(供应商管理) <br/> |
|||
* File: SupplierBankFeignFallback.java <br/> |
|||
* Class: com.yxt..biz.supplierbank.SupplierBankRest <br/> |
|||
* Description: 供应商开户行信息. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-18 13:33:13 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "供应商开户行信息") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/supplierbank") |
|||
public class SupplierBankRest { |
|||
|
|||
@Autowired |
|||
private SupplierBankService supplierBankService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<SupplierBankVo>> listPage(@RequestBody PagerQuery<SupplierBankQuery> pq){ |
|||
return supplierBankService.listPageVo(pq); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody SupplierBankDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
supplierBankService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@PostMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
supplierBankService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<SupplierBankDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
return supplierBankService.fetchDetailsVoBySid(sid); |
|||
} |
|||
} |
@ -0,0 +1,85 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.supplierfile.*; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* Project: yxt-(仓储基础信息供应商) <br/> |
|||
* File: SupplierFileFeignFallback.java <br/> |
|||
* Class: com.yxt.anrui.as.biz.supplierfile.SupplierFileRest <br/> |
|||
* Description: 供应商附件. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-13 16:51:56 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "供应商附件") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/supplierfile") |
|||
public class SupplierFileRest { |
|||
|
|||
@Autowired |
|||
private SupplierFileService supplierFileService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<SupplierFileVo>> listPage(@RequestBody PagerQuery<SupplierFileQuery> pq){ |
|||
return supplierFileService.listPageVo(pq); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody SupplierFileDto dto){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
supplierFileService.saveOrUpdateDto(dto); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
supplierFileService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<SupplierFileDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
return supplierFileService.fetchDetailsVoBySid(sid); |
|||
} |
|||
} |
@ -0,0 +1,96 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.suppliertype.*; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt-(仓储基础信息供应商) <br/> |
|||
* File: SupplierTypeFeignFallback.java <br/> |
|||
* Class: com.yxt.anrui.as.biz.suppliertype.SupplierTypeRest <br/> |
|||
* Description: 供应商类型. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-13 16:51:56 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Api(tags = "供应商类型") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/suppliertype") |
|||
public class SupplierTypeRest { |
|||
|
|||
@Autowired |
|||
private SupplierTypeService supplierTypeService; |
|||
|
|||
@ApiOperation("根据条件分页查询数据的列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<SupplierTypeVo>> listPage(@RequestBody PagerQuery<SupplierTypeQuery> pq){ |
|||
return supplierTypeService.listPageVo(pq); |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody SupplierTypeDto dto){ |
|||
return supplierTypeService.saveOrUpdateDto(dto); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
supplierTypeService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/fetchDetailsBySid/{sid}") |
|||
public ResultBean<SupplierTypeDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|||
return supplierTypeService.fetchDetailsVoBySid(sid); |
|||
} |
|||
|
|||
@ApiOperation("获取供应商类型") |
|||
@PostMapping("/selSupplierType") |
|||
public ResultBean<List<SupplierTypeDown>> selSupplierType(@RequestParam("orgPath") String orgPath){ |
|||
return supplierTypeService.selSupplierType(orgPath); |
|||
} |
|||
@ApiOperation("根据SID获取一条记录") |
|||
@GetMapping("/checkSaveCode/{supplierTypeCode}/{useOrgSid}") |
|||
public ResultBean<Integer> checkSaveCode(@PathVariable("supplierTypeCode") String supplierTypeCode,@PathVariable("useOrgSid") String useOrgSid){ |
|||
return supplierTypeService.checkSaveCode(supplierTypeCode,useOrgSid); |
|||
} |
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.warehousearea.*; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/28 8:53 |
|||
*/ |
|||
@Api(tags = "库区信息") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/warehousearea") |
|||
public class WarehouseAreaRest { |
|||
|
|||
@Autowired |
|||
WarehouseAreaService omsWarehouseAreaService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<WarehouseAreaVo>> listPage(@RequestBody PagerQuery<WarehouseAreaQuery> pq) { |
|||
return omsWarehouseAreaService.listPage(pq); |
|||
} |
|||
@ApiOperation("查询所有的库区") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<WarehouseArea>> listAll(@RequestBody OrgPathQuery query) { |
|||
return omsWarehouseAreaService.getAllType(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody WarehouseAreaDto dto) { |
|||
return omsWarehouseAreaService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<WarehouseAreaVo> initialization(@PathVariable("sid") String sid) { |
|||
return omsWarehouseAreaService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return omsWarehouseAreaService.delete(sid); |
|||
} |
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
omsWarehouseAreaService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return omsWarehouseAreaService.updateIsEnable(sid,isEnable); |
|||
} |
|||
|
|||
@ApiOperation("根据仓库sid查询所有库位") |
|||
@GetMapping("/selectAll") |
|||
public ResultBean<List<WarehouseAreaAllVo>> selectAll(@RequestParam("ckSid") String ckSid){ |
|||
return omsWarehouseAreaService.selectAll(ckSid); |
|||
} |
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.warehouseareatype.*; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/3/18 14:57 |
|||
*/ |
|||
@Api(tags = "库区类型信息") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/warehouseareatype") |
|||
public class WarehouseAreaTypeRest { |
|||
|
|||
@Autowired |
|||
WarehouseAreaTypeService WarehouseAreaTypeService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<WarehouseAreaTypeVo>> listPage(@RequestBody PagerQuery<WarehouseAreaTypeQuery> pq) { |
|||
return WarehouseAreaTypeService.listPage(pq); |
|||
} |
|||
@ApiOperation("查询所有的") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<WarehouseAreaType>> listAll(@RequestBody OrgPathQuery query) { |
|||
return WarehouseAreaTypeService.listAll(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody WarehouseAreaTypeDto dto) { |
|||
return WarehouseAreaTypeService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<WarehouseAreaTypeVo> initialization(@PathVariable("sid") String sid) { |
|||
return WarehouseAreaTypeService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return WarehouseAreaTypeService.delete(sid); |
|||
} |
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
WarehouseAreaTypeService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return WarehouseAreaTypeService.updateIsEnable(sid,isEnable); |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.oms.biz.func.warehouseextend.WarehouseExtendDto; |
|||
import com.yxt.oms.biz.func.warehouseextend.WarehouseExtendService; |
|||
import com.yxt.oms.biz.func.warehouseextend.WarehouseExtendVo; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/3/18 10:52 |
|||
*/ |
|||
public class WarehouseExtendRest { |
|||
|
|||
@Autowired |
|||
WarehouseExtendService omsWarehouseExtendService; |
|||
|
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody WarehouseExtendDto dto) { |
|||
return omsWarehouseExtendService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<WarehouseExtendVo> initialization(@PathVariable("sid") String sid) { |
|||
return omsWarehouseExtendService.initialization(sid); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
package com.yxt.oms.apiadmin.aggregation; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.warehouserack.WarehouseRackDto; |
|||
import com.yxt.oms.biz.func.warehouserack.WarehouseRackQuery; |
|||
import com.yxt.oms.biz.func.warehouserack.WarehouseRackService; |
|||
import com.yxt.oms.biz.func.warehouserack.WarehouseRackVo; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/28 8:59 |
|||
*/ |
|||
@Api(tags = "货架信息") |
|||
@RestController |
|||
@RequestMapping("/apiadmin/warehouserack") |
|||
public class WarehouseRackRest { |
|||
|
|||
@Autowired |
|||
WarehouseRackService omsWarehouseRackService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<WarehouseRackVo>> listPage(@RequestBody PagerQuery<WarehouseRackQuery> pq) { |
|||
return omsWarehouseRackService.listPage(pq); |
|||
} |
|||
@ApiOperation("查询所有的库区") |
|||
@PostMapping("/listAll") |
|||
public ResultBean<List<WarehouseRackVo>> listAll(@RequestBody OrgPathQuery query) { |
|||
return omsWarehouseRackService.listAll(query); |
|||
} |
|||
|
|||
@ApiOperation("保存修改") |
|||
@PostMapping("/saveOrUpdate") |
|||
public ResultBean<String> saveOrUpdate(@RequestBody WarehouseRackDto dto) { |
|||
return omsWarehouseRackService.saveOrUpdate(dto); |
|||
} |
|||
|
|||
@ApiOperation("初始化") |
|||
@GetMapping("/initialization/{sid}") |
|||
public ResultBean<WarehouseRackVo> initialization(@PathVariable("sid") String sid) { |
|||
return omsWarehouseRackService.initialization(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete/{sid}") |
|||
public ResultBean delete(@PathVariable("sid") String sid) { |
|||
return omsWarehouseRackService.delete(sid); |
|||
} |
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids){ |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
omsWarehouseRackService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("更改可用状态") |
|||
@GetMapping("/updateIsEnable/{sid}/{isEnable}") |
|||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) { |
|||
return omsWarehouseRackService.updateIsEnable(sid,isEnable); |
|||
} |
|||
@ApiOperation("根据仓库sid查询所有库位") |
|||
@GetMapping("/selectAll") |
|||
public ResultBean<List<WarehouseRackVo>> selectAll(@RequestParam("ckSid") String ckSid){ |
|||
return omsWarehouseRackService.selectAll(ckSid); |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.oms.biz.func.basebrandinfo; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseBrandInfo extends BaseEntity { |
|||
|
|||
private String brandName;//品牌代码
|
|||
private String brandCode;//品牌名称
|
|||
private String image;//品牌图片url地址
|
|||
private String letter;//品牌的首字母大写
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
|
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.oms.biz.func.basebrandinfo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseBrandInfoDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String brandName;//品牌代码
|
|||
private String brandCode;//品牌名称
|
|||
private String image;//品牌图片url地址
|
|||
private String letter;//品牌的首字母大写
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
private String userSid; |
|||
private String orgPath; |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.yxt.oms.biz.func.basebrandinfo; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseBrandInfoMapper extends BaseMapper<BaseBrandInfo> { |
|||
|
|||
IPage<BaseBrandInfoVo> listPage(IPage<BaseBrandInfo> page, @Param(Constants.WRAPPER) QueryWrapper<BaseBrandInfo> qw); |
|||
} |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basebrandinfo.BaseBrandInfoMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basebrandinfo.BaseBrandInfoVo"> |
|||
select |
|||
* |
|||
from base_brand_info |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,22 @@ |
|||
package com.yxt.oms.biz.func.basebrandinfo; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseBrandInfoQuery implements Query { |
|||
private String name; |
|||
private String orgLevelKey;//权限等级
|
|||
@ApiModelProperty("菜单路由") |
|||
private String menuUrl; |
|||
@ApiModelProperty("组织全路径sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
private int index; |
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.yxt.oms.biz.func.basebrandinfo; |
|||
|
|||
import com.yxt.common.base.config.component.FileUploadComponent; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.commonmethod.CommonMethod; |
|||
import com.yxt.oms.biz.func.commonmethod.DataRule; |
|||
import com.yxt.oms.feign.goods.basebrandinfo.*; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseBrandInfoService extends MybatisBaseService<BaseBrandInfoMapper, BaseBrandInfo> { |
|||
@Autowired |
|||
private FileUploadComponent fileUploadComponent; |
|||
@Autowired |
|||
BaseBrandInfoFeign baseBrandInfoFeign; |
|||
@Autowired |
|||
CommonMethod commonMethod; |
|||
|
|||
public ResultBean<PagerVo<BaseBrandInfoVo>> listPage(PagerQuery<BaseBrandInfoQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseBrandInfoQuery query=pq.getParams(); |
|||
//通用组装方法 根据用户sid、菜单、组织全路径sid 获取组装参数
|
|||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|||
pq.getParams().setIndex(dataRule.getIndex()); |
|||
ResultBean<PagerVo<BaseBrandInfoVo>> w=baseBrandInfoFeign.listPage(pq); |
|||
if(!w.getCode().equals("200")){ |
|||
return w; |
|||
} |
|||
PagerVo<BaseBrandInfoVo> baseBrandInfoVos=w.getData(); |
|||
for (BaseBrandInfoVo baseBrandInfoVo : baseBrandInfoVos.getRecords()) { |
|||
baseBrandInfoVo.setImage(fileUploadComponent.getUrlPrefix() + baseBrandInfoVo.getImage()); |
|||
} |
|||
|
|||
return rb.success().success().setData(baseBrandInfoVos); |
|||
} |
|||
public ResultBean<List<BaseBrandInfo>> listAll( OrgPathQuery query) { |
|||
return baseBrandInfoFeign.listAll(query); |
|||
} |
|||
public ResultBean<String> saveOrUpdate(BaseBrandInfoDto dto) { |
|||
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|||
String path = dto.getImage().substring(urlPrefix.length()); |
|||
dto.setImage(path); |
|||
return baseBrandInfoFeign.saveOrUpdate(dto); |
|||
} |
|||
|
|||
public ResultBean<BaseBrandInfoVo> initialization(String sid) { |
|||
ResultBean<BaseBrandInfoVo> w=baseBrandInfoFeign.initialization(sid); |
|||
if(!w.getCode().equals("200")){ |
|||
return w; |
|||
} |
|||
BaseBrandInfoVo baseBrandInfoVo=w.getData(); |
|||
baseBrandInfoVo.setImage(fileUploadComponent.getUrlPrefix() + baseBrandInfoVo.getImage()); |
|||
return baseBrandInfoFeign.initialization(sid); |
|||
} |
|||
|
|||
|
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return rb.success().setMsg("成功"); |
|||
} |
|||
public ResultBean delAll(String[] sids) { |
|||
return baseBrandInfoFeign.delBySids(sids); |
|||
} |
|||
public ResultBean updateIsEnable(String sid,String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseBrandInfoFeign.updateIsEnable(sid,isEnable); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.yxt.oms.biz.func.basebrandinfo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseBrandInfoVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
private String brandName;//品牌代码
|
|||
private String brandCode;//品牌名称
|
|||
private String image;//品牌图片url地址
|
|||
private String letter;//品牌的首字母大写
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSku extends BaseEntity { |
|||
private String goodsSkuCode;//商品Sku代码
|
|||
private String title;//商品标题
|
|||
private String goodsSpuSid;//商品基础信息Sid
|
|||
private String externalCode;//外部编码
|
|||
private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。
|
|||
@TableField(value = "own_spec") |
|||
private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序
|
|||
|
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/3/19 |
|||
**/ |
|||
@Data |
|||
public class BaseGoodsSkuDetailsVo { |
|||
|
|||
@ApiModelProperty("商品代码") |
|||
private String goodsCode; |
|||
@ApiModelProperty("条形码") |
|||
private String barCode; |
|||
@ApiModelProperty("商品名称") |
|||
private String goodsName; |
|||
@ApiModelProperty("副标题") |
|||
private String subTitle; |
|||
@ApiModelProperty("拼音缩写") |
|||
private String goodsPY; |
|||
@ApiModelProperty("商品简称") |
|||
private String goodsShortName; |
|||
@ApiModelProperty("商品分类sid") |
|||
private String goodsTypeSid; |
|||
@ApiModelProperty("品牌sid") |
|||
private String brandSid; |
|||
@ApiModelProperty("厂家sid") |
|||
private String manufacturersid; |
|||
@ApiModelProperty("商品单位sid") |
|||
private String goodsUnitSid; |
|||
@ApiModelProperty("商品单位名称") |
|||
private String goodsUnitName; |
|||
|
|||
@ApiModelProperty("商品Sku代码") |
|||
private String goodsSkuCode; |
|||
@ApiModelProperty("商品标题") |
|||
private String title; |
|||
@ApiModelProperty("是否一品一码(goodID),0否,1是") |
|||
@JsonProperty("isGoodsID") |
|||
private int isGoodsID; |
|||
|
|||
//=================================
|
|||
|
|||
//商品名称
|
|||
//零件号
|
|||
//拼音
|
|||
//条形码
|
|||
//计量单位
|
|||
//商品类别
|
|||
private String goodsTypeName;//商品类别名称
|
|||
//厂家
|
|||
//规格
|
|||
//品牌
|
|||
//车型
|
|||
//原厂标志
|
|||
//产地
|
|||
//锁定售价
|
|||
//备注
|
|||
//上限数量
|
|||
//下限数量
|
|||
//积分商品
|
|||
//所需积分
|
|||
|
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import com.yxt.oms.biz.func.basegoodsskuextend.BaseGoodsSkuExtendDto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSkuDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String goodsSkuCode;//商品Sku代码
|
|||
private String title;//商品标题
|
|||
private String goodsSpuSid;//商品基础信息Sid
|
|||
private String externalCode;//外部编码
|
|||
private String indexes;//特有规格属性在spu表中special_spec字段对应每个参数值数组下标的组合,如0_0_0,1_0_0,相当于SKU这条记录的编码。
|
|||
@TableField(value = "own_spec") |
|||
private String ownSpec;//sku的特有规格参数键值对,json格式,反序列化时请使用linkedHashMap,保证有序
|
|||
private BaseGoodsSkuExtendDto baseGoodsSkuExtend;//sku扩展
|
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseGoodsSkuMapper extends BaseMapper<BaseGoodsSku> { |
|||
|
|||
IPage<BaseGoodsSkuVo> listPage(IPage<BaseGoodsSku> page, @Param(Constants.WRAPPER) QueryWrapper<BaseGoodsSku> qw); |
|||
List<BaseGoodsSkuVo> getSkusBySpuSid(@Param("spuSid")String spuSid); |
|||
BaseGoodsSkuVo getSkuBySid(@Param("sid")String sid); |
|||
|
|||
IPage<BaseGoodsSkuSelectList> getSelectList(IPage<BaseGoodsSku> page, @Param(Constants.WRAPPER)QueryWrapper<BaseGoodsSku> qw); |
|||
|
|||
IPage<BaseGoodsSkuPurSelectList> purGoodsListPage(IPage<BaseGoodsSku> page, @Param(Constants.WRAPPER) QueryWrapper<BaseGoodsSku> qw); |
|||
} |
@ -0,0 +1,64 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuVo"> |
|||
select s.*,s.own_spec as ownSpec,a.goodsName |
|||
from base_goods_sku s |
|||
left join base_goods_spu a on a.sid=s.goodsSpuSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
<select id="getSkusBySpuSid" resultType="com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuVo"> |
|||
select s.*, |
|||
s.own_spec as ownSpec |
|||
from base_goods_sku s |
|||
where s.goodsSpuSid = #{spuSid} |
|||
</select> |
|||
<select id="getSkuBySid" resultType="com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuVo"> |
|||
select *, |
|||
s.own_spec as ownSpec |
|||
from base_goods_sku s |
|||
where s.sid = #{sid} |
|||
</select> |
|||
|
|||
<select id="getSelectList" resultType="com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuSelectList"> |
|||
select sku.sid goodsSkuSid, |
|||
spu.sid as goodsSpuSid, |
|||
spu.goodsName goodsSpuName, |
|||
sku.goodsSkuCode, |
|||
sku.title as goodsSkuTitle, |
|||
spu.goodsUnitSid, |
|||
spu.goodsUnitName |
|||
from base_goods_sku sku |
|||
left join base_goods_spu spu on spu.sid = sku.goodsSpuSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="purGoodsListPage" resultType="com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuPurSelectList"> |
|||
SELECT |
|||
s.sid, |
|||
s.goodsSkuCode, |
|||
s.title, |
|||
s.own_spec AS ownSpec, |
|||
a.goodsName, |
|||
a.goodsPY, |
|||
a.goodsShortName, |
|||
a.goodsTypeSid, |
|||
a.brandSid, |
|||
a.manufacturerSid, |
|||
a.goodsUnitName |
|||
FROM |
|||
base_goods_sku s |
|||
LEFT JOIN base_goods_spu a |
|||
ON a.sid = s.goodsSpuSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,35 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/3/21 |
|||
**/ |
|||
@Data |
|||
public class BaseGoodsSkuPurSelectList { |
|||
|
|||
//sid
|
|||
private String sid; |
|||
//零件号
|
|||
private String goodsSkuCode; |
|||
//规格
|
|||
private String title; |
|||
//商品名称
|
|||
private String goodsName; |
|||
//商品拼音
|
|||
private String goodsPY; |
|||
//商品简称
|
|||
private String goodsShortName; |
|||
//商品类别sid
|
|||
private String goodsTypeSid; |
|||
//品牌sid
|
|||
private String brandSid; |
|||
//厂家sid
|
|||
private String manufacturerSid; |
|||
//商品单位名称
|
|||
private String goodsUnitName; |
|||
//sku特有规格参数键值对
|
|||
private String ownSpec; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/3/21 |
|||
**/ |
|||
@Data |
|||
public class BaseGoodsSkuPurSelectQuery implements Query { |
|||
|
|||
//组织sid
|
|||
private String orgSid; |
|||
//商品名称
|
|||
private String goodsName; |
|||
//商品类别sid
|
|||
private String goodsTypeSid; |
|||
//商品拼音
|
|||
private String goodsPY; |
|||
//品牌sid
|
|||
private String brandSid; |
|||
//零件号
|
|||
private String goodsSkuCode; |
|||
//规格
|
|||
private String title; |
|||
//其他查询条件
|
|||
private String otherQuery; |
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSkuQuery implements Query { |
|||
private String name; |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/3/21 |
|||
**/ |
|||
@Data |
|||
public class BaseGoodsSkuSelectList { |
|||
|
|||
//商品名称
|
|||
private String goodsSpuSid; |
|||
private String goodsSpuName; |
|||
//商品sid
|
|||
private String goodsSkuSid; |
|||
//商品编码
|
|||
private String goodsSkuCode; |
|||
//规格/型号
|
|||
private String goodsSkuTitle; |
|||
//计量单位
|
|||
private String goodsUnitSid; |
|||
private String goodsUnitName; |
|||
//仓库名称
|
|||
//货位
|
|||
//单位成本(进货价)
|
|||
//数量
|
|||
//税额
|
|||
//含税价
|
|||
//金额
|
|||
//销售价1
|
|||
//销售价2
|
|||
//操作时间
|
|||
//操作人
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.oms.biz.func.basegoodssku; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2024/3/21 |
|||
**/ |
|||
@Data |
|||
public class BaseGoodsSkuSelectQuery implements Query { |
|||
|
|||
private String goodsSkuCode; |
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.yxt.oms.biz.func.basegoodsskuextend; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSkuExtend extends BaseEntity { |
|||
private String goodsSkuSid;//商品Sku代码
|
|||
private String finalPurchasePrice;//最后采购价
|
|||
private String safetyStockDays;//安全库存天数
|
|||
private String isOriginalFactory;//是否原厂
|
|||
private String isInventoryAlert;//是否库存警戒
|
|||
@TableField(value = "InventoryAlertUpperLimit") |
|||
private String inventoryAlertUpperLimit;//库存警戒上线
|
|||
@TableField(value = "InventoryAlertLowerLimit") |
|||
private String inventoryAlertLowerLimit;//库存警戒下线
|
|||
private String costPrice;//成本价
|
|||
private String tagPrice;//吊牌价
|
|||
private String salesPrice;//销售单价
|
|||
private String standardPurchasePrice;//标准进价
|
|||
private String agencyPrice;//代理价
|
|||
private String discount;//折扣
|
|||
private String minimumSalesPrice;//最低零售价
|
|||
private String isLockingSalesPrice;//是否锁定销售价
|
|||
private String isIntegralExchange;//是否可以积分兑换
|
|||
private String integralAmount;//积分数量
|
|||
private String sortNo;//排序
|
|||
private String picUrl;//商品的图片,多个图片以‘,’分割
|
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.yxt.oms.biz.func.basegoodsskuextend; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSkuExtendDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String goodsSkuSid;//商品Sku代码
|
|||
private String finalPurchasePrice;//最后采购价
|
|||
private String safetyStockDays;//安全库存天数
|
|||
private String isOriginalFactory;//是否原厂
|
|||
private String isInventoryAlert;//是否库存警戒
|
|||
@TableField(value = "InventoryAlertUpperLimit") |
|||
private String inventoryAlertUpperLimit;//库存警戒上线
|
|||
@TableField(value = "InventoryAlertLowerLimit") |
|||
private String inventoryAlertLowerLimit;//库存警戒下线
|
|||
private String costPrice;//成本价
|
|||
private String tagPrice;//吊牌价
|
|||
private String salesPrice;//销售单价
|
|||
private String standardPurchasePrice;//标准进价
|
|||
private String agencyPrice;//代理价
|
|||
private String discount;//折扣
|
|||
private String minimumSalesPrice;//最低零售价
|
|||
private String isLockingSalesPrice;//是否锁定销售价
|
|||
private String isIntegralExchange;//是否可以积分兑换
|
|||
private String integralAmount;//积分数量
|
|||
private String sortNo;//排序
|
|||
private String picUrl;//商品的图片,多个图片以‘,’分割
|
|||
// private String [] Urls={};//图片数组
|
|||
private List<UrlsVo> urls;//图片数组
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.oms.biz.func.basegoodsskuextend; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseGoodsSkuExtendMapper extends BaseMapper<BaseGoodsSkuExtend> { |
|||
|
|||
IPage<BaseGoodsSkuExtendVo> listPage(IPage<BaseGoodsSkuExtend> page, @Param(Constants.WRAPPER) QueryWrapper<BaseGoodsSkuExtend> qw); |
|||
BaseGoodsSkuExtendVo getExtendBySkuSid(@Param("skuSid")String skuSid); |
|||
BaseGoodsSkuExtendVo getExtendBySid(@Param("sid")String sid); |
|||
} |
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basegoodsskuextend.BaseGoodsSkuExtendMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basegoodsskuextend.BaseGoodsSkuExtendVo"> |
|||
select |
|||
s.*,a.title |
|||
from base_goods_sku_extend s |
|||
left join base_goods_sku a on a.sid=s.goodsSkuSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
<select id="getExtendBySkuSid" resultType="com.yxt.oms.biz.func.basegoodsskuextend.BaseGoodsSkuExtendVo"> |
|||
select |
|||
s.*,s.InventoryAlertUpperLimit as inventoryAlertUpperLimit,s.InventoryAlertLowerLimit as inventoryAlertLowerLimit |
|||
from base_goods_sku_extend s |
|||
where s.goodsSkuSid=#{skuSid} |
|||
</select> |
|||
<select id="getExtendBySid" resultType="com.yxt.oms.biz.func.basegoodsskuextend.BaseGoodsSkuExtendVo"> |
|||
select |
|||
s.*,s.InventoryAlertUpperLimit as inventoryAlertUpperLimit,s.InventoryAlertLowerLimit as inventoryAlertLowerLimit |
|||
from base_goods_sku_extend s |
|||
where s.sid=#{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,13 @@ |
|||
package com.yxt.oms.biz.func.basegoodsskuextend; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSkuExtendQuery implements Query { |
|||
private String name; |
|||
} |
@ -0,0 +1,135 @@ |
|||
package com.yxt.oms.biz.func.basegoodsskuextend; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.date.DateTime; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.common.base.config.component.FileUploadComponent; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Collections; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseGoodsSkuExtendService extends MybatisBaseService<BaseGoodsSkuExtendMapper, BaseGoodsSkuExtend> { |
|||
@Autowired |
|||
private FileUploadComponent fileUploadComponent; |
|||
// @Autowired
|
|||
// private BaseBrandInfoService baseBrandInfoService;
|
|||
// @Autowired
|
|||
// private BaseGoodsTypeService baseGoodsTypeService;
|
|||
// @Autowired
|
|||
// private BaseManufacturerService baseManufacturerService;
|
|||
// @Autowired
|
|||
// BaseGoodsSpuDetailService baseGoodsSpuDetailService;
|
|||
|
|||
public ResultBean<PagerVo<BaseGoodsSkuExtendVo>> listPage(PagerQuery<BaseGoodsSkuExtendQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSkuExtendQuery query = pq.getParams(); |
|||
QueryWrapper<BaseGoodsSkuExtend> qw = new QueryWrapper<>(); |
|||
if(StringUtils.isNotBlank(query.getName())){ |
|||
qw.like("goodsName",query.getName()); |
|||
} |
|||
IPage<BaseGoodsSkuExtend> page = PagerUtil.queryToPage(pq); |
|||
IPage<BaseGoodsSkuExtendVo> pagging = baseMapper.listPage(page, qw); |
|||
PagerVo<BaseGoodsSkuExtendVo> p = PagerUtil.pageToVo(pagging, null); |
|||
List<BaseGoodsSkuExtendVo> records = pagging.getRecords(); |
|||
records.removeAll(Collections.singleton(null)); |
|||
// if (!records.isEmpty()) {
|
|||
// for (BaseGoodsSpuVo record : records) {
|
|||
// if (StringUtils.isNotBlank(record.getPicUrl())) {
|
|||
// record.setPicUrl(fileUploadComponent.getUrlPrefix() + record.getPicUrl());
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
return rb.success().setData(p); |
|||
} |
|||
@Transactional |
|||
public ResultBean<String> saveOrUpdate(BaseGoodsSkuExtendDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String sid = ""; |
|||
BaseGoodsSkuExtend extend=baseMapper.selectOne(new QueryWrapper<BaseGoodsSkuExtend>().eq("sid",dto.getSid())); |
|||
if (null!=extend) { |
|||
sid = dto.getSid(); |
|||
BaseGoodsSkuExtend omsGoods = fetchBySid(dto.getSid()); |
|||
BeanUtil.copyProperties(dto, omsGoods); |
|||
omsGoods.setModifyTime(new Date()); |
|||
for (UrlsVo url : dto.getUrls()) { |
|||
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|||
String path = url.getUrl().substring(urlPrefix.length()); |
|||
if(StringUtils.isBlank(dto.getPicUrl())){ |
|||
omsGoods.setPicUrl(path); |
|||
}else{ |
|||
omsGoods.setPicUrl(omsGoods.getPicUrl()+","+path); |
|||
} |
|||
} |
|||
if (StringUtils.isNotBlank(dto.getPicUrl())) { |
|||
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|||
String path = dto.getPicUrl().substring(urlPrefix.length()); |
|||
omsGoods.setPicUrl(path); |
|||
} |
|||
baseMapper.updateById(omsGoods); |
|||
|
|||
} else { |
|||
BaseGoodsSkuExtend omsGoods = new BaseGoodsSkuExtend(); |
|||
sid = omsGoods.getSid(); |
|||
BeanUtil.copyProperties(dto, omsGoods); |
|||
omsGoods.setCreateTime(new DateTime()); |
|||
for (UrlsVo url : dto.getUrls()) { |
|||
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|||
String path = url.getUrl().substring(urlPrefix.length()); |
|||
if(StringUtils.isBlank(dto.getPicUrl())){ |
|||
omsGoods.setPicUrl(path); |
|||
}else{ |
|||
omsGoods.setPicUrl(omsGoods.getPicUrl()+","+path); |
|||
} |
|||
} |
|||
baseMapper.insert(omsGoods); |
|||
} |
|||
return rb.success().setMsg("成功"); |
|||
} |
|||
|
|||
public ResultBean<BaseGoodsSkuExtendVo> initialization(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSkuExtendVo vo = baseMapper.getExtendBySid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
|
|||
public ResultBean<BaseGoodsSkuExtendVo> getExtendBySkuSid(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSkuExtendVo vo = baseMapper.getExtendBySkuSid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSkuExtend omsGoods = fetchBySid(sid); |
|||
if (null != omsGoods) { |
|||
baseMapper.deleteById(omsGoods.getId()); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean updateIsEnable(String sid,String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSkuExtend omsGoods = fetchBySid(sid); |
|||
if (null != omsGoods) { |
|||
omsGoods.setIsEnable(Integer.parseInt(isEnable)); |
|||
baseMapper.updateById(omsGoods); |
|||
} |
|||
return rb.success().setMsg("成功"); |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspu; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpu extends BaseEntity { |
|||
private String goodsCode;//商品代码
|
|||
private String barCode;//条形码
|
|||
private String goodsName;//商品名称
|
|||
private String subTitle;//商品名称
|
|||
private String goodsPY;//拼音缩写
|
|||
private String goodsShortName;//商品简称
|
|||
private String goodsTypeSid;//商品分类sid
|
|||
private String brandSid;//品牌sid
|
|||
private String manufacturerSid;//厂家sid
|
|||
private String goodsUnitSid;//商品单位sid
|
|||
private String goodsUnitName;//商品单位名称
|
|||
private String taxRate;//税率
|
|||
private String shelfLife;//保质期天
|
|||
private String nationalStandardCode;//国标码
|
|||
private String sortNo;//排序
|
|||
private String externalCode;//外部编码
|
|||
private String factoryCode;//厂家货号
|
|||
private String isListed;//是否上架
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
} |
@ -0,0 +1,49 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspu; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuDto; |
|||
import com.yxt.oms.biz.func.basegoodsspudetail.BaseGoodsSpuDetailDto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpuDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String goodsCode;//商品代码
|
|||
private String barCode;//条形码
|
|||
private String goodsName;//商品名称
|
|||
private String subTitle;//副标题
|
|||
private String goodsPY;//拼音缩写
|
|||
private String goodsShortName;//商品简称
|
|||
private String goodsTypeSid;//商品分类sid
|
|||
private String brandSid;//品牌sid
|
|||
private String manufacturerSid;//厂家sid
|
|||
private String goodsUnitSid;//商品单位sid
|
|||
private String goodsUnitName;//商品单位名称
|
|||
private String taxRate;//税率
|
|||
private String shelfLife;//保质期天
|
|||
private String nationalStandardCode;//国标码
|
|||
private String sortNo;//排序
|
|||
private String externalCode;//外部编码
|
|||
private String factoryCode;//厂家货号
|
|||
private String isListed;//是否上架
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
private BaseGoodsSpuDetailDto baseGoodsSpuDetail;//商品spu详情
|
|||
private List<BaseGoodsSkuDto> baseGoodsSkus;//商品sku
|
|||
private String userSid; |
|||
private String orgPath; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspu; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseGoodsSpuMapper extends BaseMapper<BaseGoodsSpu> { |
|||
|
|||
IPage<BaseGoodsSpuVo> listPage(IPage<BaseGoodsSpu> page, @Param(Constants.WRAPPER) QueryWrapper<BaseGoodsSpu> qw); |
|||
BaseGoodsSpuVo initialization(@Param("sid")String sid); |
|||
} |
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basegoodsspu.BaseGoodsSpuMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basegoodsspu.BaseGoodsSpuVo"> |
|||
select |
|||
s.*,a.goodsTypeName as typeName,b.brandName as brandName,c.manufacturerName as manufacturerName |
|||
from base_goods_spu s |
|||
left join base_goods_type a on a.sid=s.goodsTypeSid |
|||
left join base_brand_info b on b.sid=s.brandSid |
|||
left join base_manufacturer c on c.sid=s.manufacturerSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
<select id="initialization" resultType="com.yxt.oms.biz.func.basegoodsspu.BaseGoodsSpuVo"> |
|||
select |
|||
s.*,a.goodsTypeName as typeName,b.brandName as brandName,c.manufacturerName as manufacturerName |
|||
from base_goods_spu s |
|||
left join base_goods_type a on a.sid=s.goodsTypeSid |
|||
left join base_brand_info b on b.sid=s.brandSid |
|||
left join base_manufacturer c on c.sid=s.manufacturerSid |
|||
where s.sid=#{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,22 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspu; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpuQuery implements Query { |
|||
private String name; |
|||
private String orgLevelKey;//权限等级
|
|||
@ApiModelProperty("菜单路由") |
|||
private String menuUrl; |
|||
@ApiModelProperty("组织全路径sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
private int index; |
|||
} |
@ -0,0 +1,390 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspu; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.basebrandinfo.BaseBrandInfo; |
|||
import com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuDto; |
|||
import com.yxt.oms.biz.func.basegoodsskuextend.BaseGoodsSkuExtendDto; |
|||
import com.yxt.oms.biz.func.basegoodsspudetail.BaseGoodsSpuDetailDto; |
|||
import com.yxt.oms.biz.func.basegoodstype.BaseGoodsType; |
|||
import com.yxt.oms.biz.func.basegoodsunit.BaseGoodsUnit; |
|||
import com.yxt.oms.biz.func.basemanufacturer.BaseManufacturer; |
|||
import com.yxt.oms.biz.func.commonmethod.CommonMethod; |
|||
import com.yxt.oms.biz.func.commonmethod.DataRule; |
|||
import com.yxt.oms.feign.goods.basebrandinfo.BaseBrandInfoFeign; |
|||
import com.yxt.oms.feign.goods.basegoodsspu.*; |
|||
import com.yxt.oms.feign.goods.basegoodstype.BaseGoodsTypeFeign; |
|||
import com.yxt.oms.feign.goods.basegoodsunit.BaseGoodsUnitFeign; |
|||
import com.yxt.oms.feign.goods.basemanufacturer.BaseManufacturerFeign; |
|||
import com.yxt.oms.feign.goods.basegoodsspu.BaseGoodsSpuFeign; |
|||
import com.yxt.oms.utils.ExcelUtil; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.*; |
|||
import java.net.URLEncoder; |
|||
import java.util.*; |
|||
import java.util.concurrent.ConcurrentHashMap; |
|||
import java.util.function.Function; |
|||
import java.util.function.Predicate; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseGoodsSpuService extends MybatisBaseService<BaseGoodsSpuMapper, BaseGoodsSpu> { |
|||
// @Autowired
|
|||
// private FileUploadComponent fileUploadComponent;
|
|||
@Autowired |
|||
BaseGoodsTypeFeign baseGoodsTypeFeign; |
|||
@Autowired |
|||
BaseBrandInfoFeign baseBrandInfoFeign; |
|||
@Autowired |
|||
BaseManufacturerFeign baseManufacturerFeign; |
|||
@Autowired |
|||
BaseGoodsUnitFeign baseGoodsUnitFeign; |
|||
@Value("${image.upload.path:http://127.0.0.1:8080/upload/}") |
|||
String path; |
|||
@Autowired |
|||
BaseGoodsSpuFeign baseGoodsSpuFeign; |
|||
@Autowired |
|||
CommonMethod commonMethod; |
|||
|
|||
|
|||
public ResultBean<PagerVo<BaseGoodsSpuVo>> listPage(PagerQuery<BaseGoodsSpuQuery> pq) { |
|||
BaseGoodsSpuQuery query=pq.getParams(); |
|||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|||
pq.getParams().setIndex(dataRule.getIndex()); |
|||
return baseGoodsSpuFeign.listPage(pq); |
|||
} |
|||
|
|||
@Transactional |
|||
public ResultBean<String> saveOrUpdate(BaseGoodsSpuDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsSpuFeign.saveOrUpdate(dto); |
|||
} |
|||
|
|||
public ResultBean<BaseGoodsSpuVo> initialization(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsSpuFeign.initialization(sid); |
|||
} |
|||
|
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSpu omsGoods = fetchBySid(sid); |
|||
if (null != omsGoods) { |
|||
baseMapper.deleteById(omsGoods.getId()); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
public ResultBean delAll(String[] sids) { |
|||
return baseGoodsSpuFeign.delBySids(sids); |
|||
} |
|||
|
|||
public ResultBean updateIsEnable(String sid, String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsSpuFeign.updateIsEnable(sid, isEnable); |
|||
} |
|||
|
|||
public void download(HttpServletRequest request, HttpServletResponse response) { |
|||
|
|||
// 指定要下载的文件路径
|
|||
String filePath = path + "商品导入模板.xls"; |
|||
String fileName = new File(filePath).getName(); |
|||
String encodedFileName = null; |
|||
try { |
|||
encodedFileName = URLEncoder.encode(fileName, "UTF-8"); |
|||
} catch (UnsupportedEncodingException e) { |
|||
throw new RuntimeException(e); |
|||
} |
|||
// 设置响应头信息
|
|||
response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedFileName + "\""); |
|||
// 获取文件名
|
|||
response.setContentType("application/octet-stream"); |
|||
// 读取文件并将其写入响应输出流
|
|||
try (InputStream in = new FileInputStream(filePath); |
|||
OutputStream out = response.getOutputStream()) { |
|||
byte[] buffer = new byte[4096]; |
|||
int bytesRead; |
|||
while ((bytesRead = in.read(buffer)) != -1) { |
|||
out.write(buffer, 0, bytesRead); |
|||
} |
|||
} catch (FileNotFoundException e) { |
|||
throw new RuntimeException(e); |
|||
} catch (IOException e) { |
|||
throw new RuntimeException(e); |
|||
} |
|||
} |
|||
|
|||
public ResultBean importExcel(MultipartFile file) throws IOException { |
|||
// return baseGoodsSpuFeign.importExcel(file);
|
|||
ResultBean rb=new ResultBean().fail(); |
|||
//檢查excel
|
|||
ExcelUtil.checkFile(file); |
|||
//解析excel
|
|||
List<String[]> list = ExcelUtil.readExcel(file); |
|||
if (!list.isEmpty()) { |
|||
List tt = new ArrayList(); |
|||
List<BaseGoodsSpuDto> tt1 = new ArrayList(); |
|||
for (int i = 0; i < list.size(); i++) { |
|||
BaseGoodsSpuDto dto =new BaseGoodsSpuDto(); |
|||
String taxRate = StringUtils.isEmpty(list.get(i)[10]) ? null : list.get(i)[10]; |
|||
if(StringUtils.isNotBlank(taxRate)){ |
|||
if(!taxRate.contains(".")){ |
|||
return rb.setMsg("第" + (i + 1) + "行税率格式不正确!"); |
|||
} |
|||
if(taxRate.length()>4){ |
|||
return rb.setMsg("第" + (i + 1) + "行税率长度不正确!"); |
|||
} |
|||
} |
|||
|
|||
dto = this.packaging(list.get(i),dto); |
|||
if (null == dto) { |
|||
return rb.setMsg("导入失败,第" + (i + 1) + "行数据错误!"); |
|||
} else { |
|||
tt.add(dto); |
|||
} |
|||
} |
|||
tt1=a(tt); |
|||
for (BaseGoodsSpuDto baseGoodsSpuDto : tt1) { |
|||
String goodsTypeSid = StringUtils.isEmpty(baseGoodsSpuDto.getGoodsTypeSid()) ? null : baseGoodsSpuDto.getGoodsTypeSid(); |
|||
if (StringUtils.isNotBlank(goodsTypeSid)) { |
|||
BaseGoodsType baseGoodsType = baseGoodsTypeFeign.getTypeByName(goodsTypeSid).getData(); |
|||
if (null != baseGoodsType) { |
|||
baseGoodsSpuDto.setGoodsTypeSid(baseGoodsType.getSid()); |
|||
} else { |
|||
return rb.setMsg("商品分类:" + goodsTypeSid + "不存在,请先添加"); |
|||
} |
|||
} |
|||
|
|||
String brandSid = StringUtils.isEmpty(baseGoodsSpuDto.getBrandSid()) ? null : baseGoodsSpuDto.getBrandSid(); |
|||
if (StringUtils.isNotBlank(brandSid)) { |
|||
BaseBrandInfo brand = baseBrandInfoFeign.getBrandByName(brandSid).getData(); |
|||
if (null != brand) { |
|||
baseGoodsSpuDto.setBrandSid(brand.getSid()); |
|||
} else { |
|||
return rb.setMsg("商品品牌:" + brandSid + "不存在,请先添加"); |
|||
} |
|||
} |
|||
|
|||
String manufacturerSid = StringUtils.isEmpty(baseGoodsSpuDto.getManufacturerSid()) ? null : baseGoodsSpuDto.getManufacturerSid(); |
|||
if (StringUtils.isNotBlank(manufacturerSid)) { |
|||
BaseManufacturer baseManufacturer = baseManufacturerFeign.getManufacturerByName(manufacturerSid).getData(); |
|||
if (null != baseManufacturer) { |
|||
baseGoodsSpuDto.setManufacturerSid(baseManufacturer.getSid()); |
|||
} else { |
|||
return rb.setMsg("商品厂家:" + manufacturerSid + "不存在,请先添加"); |
|||
} |
|||
} |
|||
|
|||
String goodsUnitSid = StringUtils.isEmpty(baseGoodsSpuDto.getGoodsUnitName()) ? null : baseGoodsSpuDto.getGoodsUnitName(); |
|||
if (StringUtils.isNotBlank(goodsUnitSid)) { |
|||
BaseGoodsUnit baseGoodsUnit = baseGoodsUnitFeign.getUnitByName(goodsUnitSid).getData(); |
|||
if (null != baseGoodsUnit) { |
|||
baseGoodsSpuDto.setGoodsUnitSid(baseGoodsUnit.getSid()); |
|||
} else { |
|||
return rb.setMsg("商品单位:" + goodsUnitSid + "不存在,请先添加"); |
|||
} |
|||
} |
|||
} |
|||
baseGoodsSpuFeign.batchSave(tt1); |
|||
return rb.success().setMsg("导入成功"); |
|||
|
|||
} else { |
|||
return rb.setMsg("导入文件没有有效数据"); |
|||
} |
|||
} |
|||
|
|||
public List<BaseGoodsSpuDto> a(List<BaseGoodsSpuDto> dtos) { |
|||
ResultBean rb=new ResultBean().fail(); |
|||
List<BaseGoodsSpuDto> spus = new ArrayList<>();//spu list
|
|||
int goodsCode =dtos.stream().filter(b->StringUtils.isEmpty(b.getGoodsCode())).collect(Collectors.toList()).size(); |
|||
if(goodsCode==0){ |
|||
spus = dtos.stream().filter(distinctByKey(BaseGoodsSpuDto::getGoodsCode)).collect(Collectors.toList()); |
|||
}else{ |
|||
spus = dtos.stream().filter(distinctByKey(BaseGoodsSpuDto::getGoodsName)).collect(Collectors.toList()); |
|||
} |
|||
for (BaseGoodsSpuDto baseGoodsSpuDto : spus) { |
|||
BaseGoodsSpuDetailDto spuDetail = new BaseGoodsSpuDetailDto(); |
|||
List<BaseGoodsSkuDto> skus = new ArrayList<>(); |
|||
String sid = UUID.randomUUID().toString(); |
|||
baseGoodsSpuDto.setSid(sid); |
|||
List<BaseGoodsSpuDto> dtos1=new ArrayList<>(); |
|||
if(goodsCode==0){ |
|||
dtos1 = dtos.stream().filter(d -> d.getGoodsCode().equals(baseGoodsSpuDto.getGoodsCode())).collect(Collectors.toList()); |
|||
}else{ |
|||
dtos1 = dtos.stream().filter(d -> d.getGoodsName().equals(baseGoodsSpuDto.getGoodsName())).collect(Collectors.toList()); |
|||
} |
|||
spuDetail.setGoodsExplain(dtos1.get(0).getBaseGoodsSpuDetail().getGoodsExplain()); |
|||
spuDetail.setGoodsDescription(dtos1.get(0).getBaseGoodsSpuDetail().getGoodsDescription()); |
|||
spuDetail.setSid(UUID.randomUUID().toString()); |
|||
spuDetail.setGoodSpuSid(baseGoodsSpuDto.getSid()); |
|||
for (BaseGoodsSpuDto dto : dtos1) { |
|||
BaseGoodsSkuDto sku = new BaseGoodsSkuDto(); |
|||
String skuSid = UUID.randomUUID().toString(); |
|||
sku.setGoodsSkuCode(dto.getBaseGoodsSkus().get(0).getGoodsSkuCode()); |
|||
sku.setTitle(dto.getBaseGoodsSkus().get(0).getTitle()); |
|||
sku.setExternalCode(dto.getBaseGoodsSkus().get(0).getExternalCode()); |
|||
sku.setGoodsSpuSid(sid); |
|||
sku.setSid(skuSid); |
|||
BaseGoodsSkuExtendDto skuExtend = new BaseGoodsSkuExtendDto(); |
|||
skuExtend.setSid(UUID.randomUUID().toString()); |
|||
skuExtend.setGoodsSkuSid(skuSid); |
|||
skuExtend.setSortNo("1"); |
|||
skuExtend.setFinalPurchasePrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getFinalPurchasePrice()); |
|||
skuExtend.setSafetyStockDays(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getSafetyStockDays()); |
|||
skuExtend.setIsOriginalFactory(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsOriginalFactory()); |
|||
skuExtend.setIsInventoryAlert(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsInventoryAlert()); |
|||
skuExtend.setInventoryAlertUpperLimit(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getInventoryAlertUpperLimit()); |
|||
skuExtend.setInventoryAlertLowerLimit(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getInventoryAlertLowerLimit()); |
|||
skuExtend.setCostPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getCostPrice()); |
|||
skuExtend.setTagPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getTagPrice()); |
|||
skuExtend.setSalesPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getSalesPrice()); |
|||
skuExtend.setStandardPurchasePrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getStandardPurchasePrice()); |
|||
skuExtend.setAgencyPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getAgencyPrice()); |
|||
skuExtend.setDiscount(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getDiscount()); |
|||
skuExtend.setMinimumSalesPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getMinimumSalesPrice()); |
|||
skuExtend.setIsLockingSalesPrice(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsLockingSalesPrice()); |
|||
skuExtend.setIsIntegralExchange(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIsIntegralExchange()); |
|||
skuExtend.setIntegralAmount(dto.getBaseGoodsSkus().get(0).getBaseGoodsSkuExtend().getIntegralAmount()); |
|||
sku.setBaseGoodsSkuExtend(skuExtend); |
|||
skus.add(sku); |
|||
} |
|||
baseGoodsSpuDto.setBaseGoodsSkus(skus); |
|||
baseGoodsSpuDto.setBaseGoodsSpuDetail(spuDetail); |
|||
} |
|||
return spus; |
|||
} |
|||
|
|||
private static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { |
|||
Set<Object> seen = ConcurrentHashMap.newKeySet(); |
|||
return t -> seen.add(keyExtractor.apply(t)); |
|||
} |
|||
|
|||
private BaseGoodsSpuDto packaging(String[] arr, BaseGoodsSpuDto baseGoodsSpuDto) { |
|||
Map<String, Object> result = new HashMap<>(); |
|||
//0四电名称1四电类别2规格3数量4单价5总价6单位7备注
|
|||
// BaseGoodsSpuDto baseGoodsSpuDto =null;
|
|||
try { |
|||
String goodsCode = StringUtils.isEmpty(arr[0]) ? "" : arr[0];//
|
|||
String barCode = StringUtils.isEmpty(arr[1]) ? "" : arr[1];//
|
|||
String goodsName = StringUtils.isEmpty(arr[2]) ? "" : arr[2];//
|
|||
String subTitle = StringUtils.isEmpty(arr[3]) ? "" : arr[3]; |
|||
String goodsPY = StringUtils.isEmpty(arr[4]) ? "": arr[4]; |
|||
String goodsShortName = StringUtils.isEmpty(arr[5]) ? "" :arr[5]; |
|||
String goodsTypeSid = StringUtils.isEmpty(arr[6]) ? "" : arr[6]; |
|||
String brandSid = StringUtils.isEmpty(arr[7]) ? "" : arr[7]; |
|||
String manufacturerSid = StringUtils.isEmpty(arr[8]) ? "" : arr[8]; |
|||
// String goodsUnitSid = StringUtils.isEmpty(arr[9]) ? null : arr[9];
|
|||
String goodsUnitName = StringUtils.isEmpty(arr[9]) ? "" : arr[9]; |
|||
String taxRate = StringUtils.isEmpty(arr[10]) ? "0" : arr[10]; |
|||
String shelfLife = StringUtils.isEmpty(arr[11]) ? "0" : arr[11]; |
|||
String nationalStandardCode = StringUtils.isEmpty(arr[12]) ? "" : arr[12]; |
|||
String externalCode = StringUtils.isEmpty(arr[13]) ? "" : arr[13]; |
|||
String factoryCode = StringUtils.isEmpty(arr[14]) ? "" : arr[14]; |
|||
String isListed = (StringUtils.isEmpty(arr[15]) ? "1" : arr[15].equals("是")? "1":"2"); |
|||
String useOrgSid = StringUtils.isEmpty(arr[16]) ? "" : arr[16]; |
|||
String createOrgSid = StringUtils.isEmpty(arr[17]) ? "" : arr[17]; |
|||
|
|||
// String goodSpuSid = StringUtils.isEmpty(arr[19]) ? null : arr[19];
|
|||
String goodsExplain = StringUtils.isEmpty(arr[18]) ? "" : arr[18]; |
|||
String goodsDescription = StringUtils.isEmpty(arr[19]) ? "" : arr[19]; |
|||
|
|||
String goodsSkuSid = ""; |
|||
String goodsSkuCode = StringUtils.isEmpty(arr[20]) ? "" : arr[20]; |
|||
String title = StringUtils.isEmpty(arr[21]) ? "" : arr[21]; |
|||
String skuExternalCode = StringUtils.isEmpty(arr[22]) ? "" : arr[22]; |
|||
|
|||
String finalPurchasePrice = StringUtils.isEmpty(arr[23]) ? "" : arr[23]; |
|||
String safetyStockDays = StringUtils.isEmpty(arr[24]) ? "" : arr[24]; |
|||
String isOriginalFactory = (StringUtils.isEmpty(arr[25]) ? "1" : arr[25].equals("是")? "1":"2"); |
|||
String isInventoryAlert = (StringUtils.isEmpty(arr[26]) ? "1" : arr[26].equals("是")? "1":"2"); |
|||
String inventoryAlertUpperLimit = StringUtils.isEmpty(arr[27]) ? "0" : arr[27]; |
|||
String inventoryAlertLowerLimit = StringUtils.isEmpty(arr[28]) ? "0" : arr[28]; |
|||
String costPrice = StringUtils.isEmpty(arr[29]) ? "0" : arr[29]; |
|||
String tagPrice = StringUtils.isEmpty(arr[30]) ? "0" : arr[30]; |
|||
String salesPrice = StringUtils.isEmpty(arr[31]) ? "0" : arr[31]; |
|||
String standardPurchasePrice = StringUtils.isEmpty(arr[32]) ? "0" : arr[32]; |
|||
String agencyPrice = StringUtils.isEmpty(arr[33]) ? "0" : arr[33]; |
|||
String discount = StringUtils.isEmpty(arr[34]) ? "0" : arr[34]; |
|||
String minimumSalesPrice = StringUtils.isEmpty(arr[35]) ? "0" : arr[35]; |
|||
String isLockingSalesPrice = (StringUtils.isEmpty(arr[36]) ? "1" : arr[36].equals("是")? "1":"2"); |
|||
String isIntegralExchange = (StringUtils.isEmpty(arr[37]) ? "1" : arr[37].equals("是")? "1":"2"); |
|||
String integralAmount = StringUtils.isEmpty(arr[38]) ? "0" : arr[38]; |
|||
|
|||
//excel表中物资类别保存的是分类编号,插入数据库时 根据分类编号查询基础数据中 物资类别表的id
|
|||
|
|||
baseGoodsSpuDto.setSortNo("1"); |
|||
baseGoodsSpuDto.setGoodsCode(goodsCode); |
|||
baseGoodsSpuDto.setBarCode(barCode);//物资类别 保存物资类别表id
|
|||
baseGoodsSpuDto.setGoodsName(goodsName); |
|||
baseGoodsSpuDto.setSubTitle(subTitle); |
|||
baseGoodsSpuDto.setGoodsPY(goodsPY); |
|||
baseGoodsSpuDto.setGoodsShortName(goodsShortName); |
|||
|
|||
baseGoodsSpuDto.setGoodsTypeSid(goodsTypeSid); |
|||
baseGoodsSpuDto.setBrandSid(brandSid); |
|||
baseGoodsSpuDto.setManufacturerSid(manufacturerSid); |
|||
// baseGoodsSpuDto.setGoodsUnitSid(goodsUnitSid);
|
|||
baseGoodsSpuDto.setGoodsUnitName(goodsUnitName); |
|||
baseGoodsSpuDto.setTaxRate(taxRate); |
|||
baseGoodsSpuDto.setShelfLife(shelfLife); |
|||
baseGoodsSpuDto.setNationalStandardCode(nationalStandardCode); |
|||
baseGoodsSpuDto.setExternalCode(externalCode); |
|||
baseGoodsSpuDto.setFactoryCode(factoryCode); |
|||
baseGoodsSpuDto.setIsListed(isListed); |
|||
baseGoodsSpuDto.setUseOrgSid(useOrgSid); |
|||
baseGoodsSpuDto.setCreateOrgSid(createOrgSid); |
|||
BaseGoodsSpuDetailDto dto=new BaseGoodsSpuDetailDto(); |
|||
dto.setGoodsExplain(goodsExplain); |
|||
dto.setGoodsDescription(goodsDescription); |
|||
baseGoodsSpuDto.setBaseGoodsSpuDetail(dto); |
|||
List<BaseGoodsSkuDto> dtos=new ArrayList<>(); |
|||
BaseGoodsSkuDto dto1=new BaseGoodsSkuDto(); |
|||
dto1.setGoodsSkuCode(goodsSkuCode); |
|||
dto1.setTitle(title); |
|||
dto1.setExternalCode(skuExternalCode); |
|||
BaseGoodsSkuExtendDto dto2=new BaseGoodsSkuExtendDto(); |
|||
dto2.setSortNo("1"); |
|||
dto2.setFinalPurchasePrice(finalPurchasePrice); |
|||
dto2.setSafetyStockDays(safetyStockDays); |
|||
dto2.setIsOriginalFactory(isOriginalFactory); |
|||
dto2.setIsInventoryAlert(isInventoryAlert); |
|||
dto2.setInventoryAlertUpperLimit(inventoryAlertUpperLimit); |
|||
dto2.setInventoryAlertLowerLimit(inventoryAlertLowerLimit); |
|||
dto2.setCostPrice(costPrice); |
|||
dto2.setTagPrice(tagPrice); |
|||
dto2.setSalesPrice(salesPrice); |
|||
dto2.setStandardPurchasePrice(standardPurchasePrice); |
|||
dto2.setAgencyPrice(agencyPrice); |
|||
dto2.setDiscount(discount); |
|||
dto2.setMinimumSalesPrice(minimumSalesPrice); |
|||
dto2.setIsLockingSalesPrice(isLockingSalesPrice); |
|||
dto2.setIsIntegralExchange(isIntegralExchange); |
|||
dto2.setIntegralAmount(integralAmount); |
|||
dto1.setBaseGoodsSkuExtend(dto2); |
|||
dtos.add(dto1); |
|||
baseGoodsSpuDto.setBaseGoodsSkus(dtos); |
|||
|
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
return null; |
|||
} |
|||
return baseGoodsSpuDto; |
|||
} |
|||
public ResultBean updateIsEnablebySku(String sid, String isEnable) { |
|||
return baseGoodsSpuFeign.updateIsEnablebySku(sid,isEnable); |
|||
} |
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspu; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import com.yxt.oms.biz.func.basegoodssku.BaseGoodsSkuVo; |
|||
import com.yxt.oms.biz.func.basegoodsspudetail.BaseGoodsSpuDetailVo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpuVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
private String goodsCode;//商品代码
|
|||
private String barCode;//条形码
|
|||
private String goodsName;//商品名称
|
|||
private String subTitle;//商品名称
|
|||
private String goodsPY;//拼音缩写
|
|||
private String goodsShortName;//商品简称
|
|||
private String goodsTypeSid;//商品分类sid
|
|||
private String brandSid;//品牌sid
|
|||
private String manufacturerSid;//厂家sid
|
|||
private String goodsUnitSid;//商品单位sid
|
|||
private String goodsUnitName;//商品单位名称
|
|||
private String taxRate;//税率
|
|||
private String shelfLife;//保质期天
|
|||
private String nationalStandardCode;//国标码
|
|||
private String sortNo;//排序
|
|||
private String externalCode;//外部编码
|
|||
private String factoryCode;//厂家货号
|
|||
private String isListed;//是否上架
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
private BaseGoodsSpuDetailVo baseGoodsSpuDetail; |
|||
private List<BaseGoodsSkuVo> baseGoodsSkus; |
|||
private String brandName; |
|||
private String manufacturerName; |
|||
private String typeName; |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspudetail; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpuDetail extends BaseEntity { |
|||
private String goodSpuSid;//商品基础信息Sid
|
|||
private String goodsExplain;//商品详细说明
|
|||
private String goodsDescription;//商品描述
|
|||
@TableField(value = "generic_spec") |
|||
private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对)
|
|||
@TableField(value = "special_spec") |
|||
private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值])
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspudetail; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpuDetailDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String goodSpuSid;//商品基础信息Sid
|
|||
private String goodsExplain;//商品详细说明
|
|||
private String goodsDescription;//商品描述
|
|||
@TableField(value = "generic_spec") |
|||
private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对)
|
|||
@TableField(value = "special_spec") |
|||
private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值])
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspudetail; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseGoodsSpuDetailMapper extends BaseMapper<BaseGoodsSpuDetail> { |
|||
|
|||
IPage<BaseGoodsSpuDetailVo> listPage(IPage<BaseGoodsSpuDetail> page, @Param(Constants.WRAPPER) QueryWrapper<BaseGoodsSpuDetail> qw); |
|||
|
|||
BaseGoodsSpuDetailVo getSpuDetailsBySpuSid (@Param("skuSid")String skuSid); |
|||
} |
@ -0,0 +1,24 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basegoodsspudetail.BaseGoodsSpuDetailMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basegoodsspudetail.BaseGoodsSpuDetailVo"> |
|||
select |
|||
s.*,a.goodsName |
|||
from base_goods_spu_detail s |
|||
left join base_goods_spu a on a.sid=s.goodSpuSid |
|||
|
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
<select id="getSpuDetailsBySpuSid" resultType="com.yxt.oms.biz.func.basegoodsspudetail.BaseGoodsSpuDetailVo"> |
|||
select |
|||
s.*,s.generic_spec as genericSpec,s.special_spec as specialSpec |
|||
from base_goods_spu_detail s |
|||
where s.goodSpuSid=#{skuSid} |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,13 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspudetail; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpuDetailQuery implements Query { |
|||
private String name; |
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspudetail; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import cn.hutool.core.date.DateTime; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.common.base.config.component.FileUploadComponent; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseGoodsSpuDetailService extends MybatisBaseService<BaseGoodsSpuDetailMapper, BaseGoodsSpuDetail> { |
|||
@Autowired |
|||
private FileUploadComponent fileUploadComponent; |
|||
// @Autowired
|
|||
// private BaseBrandInfoService baseBrandInfoService;
|
|||
// @Autowired
|
|||
// private BaseGoodsTypeService baseGoodsTypeService;
|
|||
// @Autowired
|
|||
// private BaseManufacturerService omsManufacturerService;
|
|||
public ResultBean<PagerVo<BaseGoodsSpuDetailVo>> listPage(PagerQuery<BaseGoodsSpuDetailQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSpuDetailQuery query = pq.getParams(); |
|||
QueryWrapper<BaseGoodsSpuDetail> qw = new QueryWrapper<>(); |
|||
if(StringUtils.isNotBlank(query.getName())){ |
|||
qw.like("goodsName",query.getName()); |
|||
} |
|||
IPage<BaseGoodsSpuDetail> page = PagerUtil.queryToPage(pq); |
|||
IPage<BaseGoodsSpuDetailVo> pagging = baseMapper.listPage(page, qw); |
|||
PagerVo<BaseGoodsSpuDetailVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
|
|||
public ResultBean<String> saveOrUpdate(BaseGoodsSpuDetailDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSpuDetail detail=baseMapper.selectOne(new QueryWrapper<BaseGoodsSpuDetail>().eq("sid",dto.getSid())); |
|||
String sid = ""; |
|||
if (null!=detail) { |
|||
sid = dto.getSid(); |
|||
BaseGoodsSpuDetail baseGoodsSpuDetail = fetchBySid(dto.getSid()); |
|||
BeanUtil.copyProperties(dto, baseGoodsSpuDetail); |
|||
baseGoodsSpuDetail.setModifyTime(new Date()); |
|||
baseMapper.updateById(baseGoodsSpuDetail); |
|||
} else { |
|||
|
|||
BaseGoodsSpuDetail baseGoodsSpuDetail = new BaseGoodsSpuDetail(); |
|||
sid = baseGoodsSpuDetail.getSid(); |
|||
BeanUtil.copyProperties(dto, baseGoodsSpuDetail); |
|||
baseGoodsSpuDetail.setCreateTime(new DateTime()); |
|||
|
|||
baseMapper.insert(baseGoodsSpuDetail); |
|||
} |
|||
return rb.success().setMsg("成功"); |
|||
} |
|||
|
|||
public ResultBean<BaseGoodsSpuDetailVo> initialization(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSpuDetailVo vo = new BaseGoodsSpuDetailVo(); |
|||
BaseGoodsSpuDetail omsGoods = fetchBySid(sid); |
|||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|||
BeanUtil.copyProperties(omsGoods, vo); |
|||
return rb.success().setData(vo); |
|||
} |
|||
public ResultBean<BaseGoodsSpuDetailVo> getSpuDetailsBySpuSid(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSpuDetailVo vo = baseMapper.getSpuDetailsBySpuSid(sid); |
|||
return rb.success().setData(vo); |
|||
} |
|||
|
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSpuDetail omsGoods = fetchBySid(sid); |
|||
if (null != omsGoods) { |
|||
baseMapper.deleteById(omsGoods.getId()); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean updateIsEnable(String sid,String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsSpuDetail omsGoods = fetchBySid(sid); |
|||
if (null != omsGoods) { |
|||
omsGoods.setIsEnable(Integer.parseInt(isEnable)); |
|||
baseMapper.updateById(omsGoods); |
|||
} |
|||
return rb.success().setMsg("成功"); |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.yxt.oms.biz.func.basegoodsspudetail; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsSpuDetailVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
private String goodSpuSid;//商品基础信息Sid
|
|||
private String goodsExplain;//商品详细说明
|
|||
private String goodsDescription;//商品描述
|
|||
@TableField(value = "generic_spec") |
|||
private String genericSpec;//通用规格参数及数据,json格式(规格参数id,规格参数值的键值对)
|
|||
@TableField(value = "special_spec") |
|||
private String specialSpec;//特有规格参数及可选值信息,json格式(特有规格参数id,[可选参数值])
|
|||
private String goodsName; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.oms.biz.func.basegoodstype; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsType extends BaseEntity { |
|||
private String goodsTypeName;//商品类别名称
|
|||
private String goodsTypeCode;//类别编码
|
|||
private String percentageRate;//提成比例
|
|||
private String percentageAmount;//提成金额
|
|||
private String pSid;//父级sid
|
|||
private String isParent;//是否为父节点,0为否,1为是,0标识为叶子节点
|
|||
private String isGoodsID="1";//是否一品一码 0 否 1是
|
|||
private String sortNo;//排序
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
private String outStockRule;//出库规则
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.yxt.oms.biz.func.basegoodstype; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsTypeDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String goodsTypeName;//商品类别名称
|
|||
private String goodsTypeCode;//类别编码
|
|||
private String percentageRate;//提成比例
|
|||
private String percentageAmount;//提成金额
|
|||
private String pSid;//父级sid
|
|||
private String isParent;//是否为父节点,0为否,1为是,0标识为叶子节点
|
|||
private String isGoodsID;//是否一品一码 0 否 1是
|
|||
private String sortNo;//排序
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
private String pName;//创建组织sid
|
|||
private String sids;//父级sid
|
|||
private String outStockRule;//出库规则
|
|||
private String userSid; |
|||
private String orgPath; |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.yxt.oms.biz.func.basegoodstype; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseGoodsTypeMapper extends BaseMapper<BaseGoodsType> { |
|||
IPage<BaseGoodsTypeVo> listPage(IPage<BaseGoodsType> page, @Param(Constants.WRAPPER) QueryWrapper<BaseGoodsType> qw); |
|||
} |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basegoodstype.BaseGoodsTypeMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basegoodstype.BaseGoodsTypeVo"> |
|||
select |
|||
* |
|||
from base_goods_type |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,25 @@ |
|||
package com.yxt.oms.biz.func.basegoodstype; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsTypeQuery implements Query { |
|||
private String name;//名字
|
|||
private String code;//编码
|
|||
private String IsGoodID;//是否一品一码(goodID),0否,1是
|
|||
private String outStockRule;//出库规则(先进先出0、先进后出1、保质期优先2)
|
|||
private String orgLevelKey;//权限等级
|
|||
@ApiModelProperty("菜单路由") |
|||
private String menuUrl; |
|||
@ApiModelProperty("组织全路径sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
private int index; |
|||
} |
@ -0,0 +1,90 @@ |
|||
package com.yxt.oms.biz.func.basegoodstype; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.commonmethod.CommonMethod; |
|||
import com.yxt.oms.biz.func.commonmethod.DataRule; |
|||
import com.yxt.oms.biz.func.sysorganization.SysOrganizationVo; |
|||
import com.yxt.oms.feign.goods.basegoodstype.BaseGoodsTypeFeign; |
|||
import com.yxt.oms.feign.portal.sysorganization.SysOrganizationFeign; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseGoodsTypeService extends MybatisBaseService<BaseGoodsTypeMapper, BaseGoodsType> { |
|||
|
|||
@Autowired |
|||
BaseGoodsTypeFeign baseGoodsTypeFeign; |
|||
@Autowired |
|||
SysOrganizationFeign sysOrganizationFeign; |
|||
@Autowired |
|||
CommonMethod commonMethod; |
|||
|
|||
public ResultBean<PagerVo<BaseGoodsTypeVo>> listPage(PagerQuery<BaseGoodsTypeQuery> pq) { |
|||
BaseGoodsTypeQuery query=pq.getParams(); |
|||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|||
pq.getParams().setIndex(dataRule.getIndex()); |
|||
return baseGoodsTypeFeign.listPage(pq); |
|||
} |
|||
public ResultBean<List<BaseGoodsType>> listAll(OrgPathQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String useOrgSid = ""; |
|||
String orgPath = query.getOrgPath(); |
|||
if (StringUtils.isNotBlank(orgPath)) { |
|||
List<String> split = Arrays.asList(orgPath.split("/")); |
|||
if (split.size() > 1) { |
|||
//获取本级sid获取本级部门信息
|
|||
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
|||
useOrgSid = sysOrganization1.getSid(); |
|||
} else { |
|||
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
|||
useOrgSid = sysOrganization.getSid(); |
|||
} |
|||
} |
|||
query.setUserOrgSid(useOrgSid); |
|||
return baseGoodsTypeFeign.listAll(query); |
|||
} |
|||
|
|||
public ResultBean<String> saveOrUpdate(BaseGoodsTypeDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsTypeFeign.saveOrUpdate(dto); |
|||
} |
|||
|
|||
public ResultBean<BaseGoodsTypeVo> initialization(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsTypeFeign.initialization(sid); |
|||
} |
|||
|
|||
|
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsType omsGoodsType = fetchBySid(sid); |
|||
if (null != omsGoodsType) { |
|||
baseMapper.deleteById(omsGoodsType.getId()); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
public ResultBean delAll(String[] sids) { |
|||
return baseGoodsTypeFeign.delBySids(sids); |
|||
} |
|||
public ResultBean updateIsEnable(String sid,String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsTypeFeign.updateIsEnable(sid, isEnable); |
|||
} |
|||
public ResultBean updateProductCode(String sid,String state) { |
|||
return baseGoodsTypeFeign.updateIsGoodsID(sid, state); |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.yxt.oms.biz.func.basegoodstype; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsTypeVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
private String goodsTypeName;//商品类别名称
|
|||
private String goodsTypeCode;//类别编码
|
|||
private String percentageRate;//提成比例
|
|||
private String percentageAmount;//提成金额
|
|||
private String pSid;//父级sid
|
|||
private String pName;//父级sid
|
|||
private String isParent="1";//是否为父节点,0为否,1为是,0标识为叶子节点
|
|||
private String isGoodsID="1";//是否一品一码 0 否 1是
|
|||
private String sortNo;//排序
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
private String sids;//创建组织sid
|
|||
private String outStockRule;//出库规则
|
|||
private String outStockRuleVaule;//出库规则
|
|||
private String userSid; |
|||
private String orgPath; |
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.yxt.oms.biz.func.basegoodsunit; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsUnit extends BaseEntity { |
|||
|
|||
private String unitName;//单位名称
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.yxt.oms.biz.func.basegoodsunit; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsUnitDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
private String unitName;//单位名称
|
|||
private String userSid; |
|||
private String orgPath; |
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.yxt.oms.biz.func.basegoodsunit; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseGoodsUnitMapper extends BaseMapper<BaseGoodsUnit> { |
|||
IPage<BaseGoodsUnitVo> listPage(IPage<BaseGoodsUnit> page, @Param(Constants.WRAPPER) QueryWrapper<BaseGoodsUnit> qw); |
|||
} |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basegoodsunit.BaseGoodsUnitMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basegoodsunit.BaseGoodsUnitVo"> |
|||
select |
|||
* |
|||
from base_goods_unit |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,22 @@ |
|||
package com.yxt.oms.biz.func.basegoodsunit; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsUnitQuery implements Query { |
|||
private String name; |
|||
private String orgLevelKey;//权限等级
|
|||
@ApiModelProperty("菜单路由") |
|||
private String menuUrl; |
|||
@ApiModelProperty("组织全路径sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
private int index; |
|||
} |
@ -0,0 +1,67 @@ |
|||
package com.yxt.oms.biz.func.basegoodsunit; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.commonmethod.CommonMethod; |
|||
import com.yxt.oms.biz.func.commonmethod.DataRule; |
|||
import com.yxt.oms.feign.goods.basegoodsunit.BaseGoodsUnitFeign; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseGoodsUnitService extends MybatisBaseService<BaseGoodsUnitMapper, BaseGoodsUnit> { |
|||
|
|||
@Autowired |
|||
BaseGoodsUnitFeign baseGoodsUnitFeign; |
|||
@Autowired |
|||
CommonMethod commonMethod; |
|||
|
|||
public ResultBean<PagerVo<BaseGoodsUnitVo>> listPage(PagerQuery<BaseGoodsUnitQuery> pq) { |
|||
BaseGoodsUnitQuery query=pq.getParams(); |
|||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|||
pq.getParams().setIndex(dataRule.getIndex()); |
|||
return baseGoodsUnitFeign.listPage(pq); |
|||
} |
|||
public ResultBean<List<BaseGoodsUnit>> listAll(OrgPathQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsUnitFeign.listAll(query); |
|||
} |
|||
|
|||
public ResultBean<String> saveOrUpdate(BaseGoodsUnitDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsUnitFeign.saveOrUpdate(dto); |
|||
} |
|||
|
|||
public ResultBean<BaseGoodsUnitVo> initialization(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsUnitFeign.initialization(sid); |
|||
} |
|||
|
|||
|
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseGoodsUnit omsGoodsType = fetchBySid(sid); |
|||
if (null != omsGoodsType) { |
|||
baseMapper.deleteById(omsGoodsType.getId()); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
public ResultBean delAll(String[] sids) { |
|||
return baseGoodsUnitFeign.delBySids(sids); |
|||
} |
|||
public ResultBean updateIsEnable(String sid,String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseGoodsUnitFeign.updateIsEnable(sid, isEnable); |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.yxt.oms.biz.func.basegoodsunit; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseGoodsUnitVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
private String unitName;//单位名称
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.oms.biz.func.basemanufacturer; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:36 |
|||
*/ |
|||
@Data |
|||
public class BaseManufacturer extends BaseEntity { |
|||
private String manufacturerName;//厂家名称
|
|||
private String manufacturerCode;//厂家编码
|
|||
private String address;//地址
|
|||
private String telephone;//电话
|
|||
private String contacts;//联系人
|
|||
private String sortNo;//排序
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.yxt.oms.biz.func.basemanufacturer; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:38 |
|||
*/ |
|||
@Data |
|||
public class BaseManufacturerDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
|
|||
private String manufacturerName;//厂家名称
|
|||
private String manufacturerCode;//厂家编码
|
|||
private String address;//地址
|
|||
private String telephone;//电话
|
|||
private String contacts;//联系人
|
|||
private String sortNo;//排序
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
private String userSid; |
|||
private String orgPath; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.oms.biz.func.basemanufacturer; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Mapper |
|||
public interface BaseManufacturerMapper extends BaseMapper<BaseManufacturer> { |
|||
IPage<BaseManufacturerVo> listPage(IPage<BaseManufacturer> page, @Param(Constants.WRAPPER) QueryWrapper<BaseManufacturer> qw); |
|||
|
|||
List<BaseManufacturerVo> getAllTypeByUseOrgSid(@Param("useOrgSid") String useOrgSid); |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.basemanufacturer.BaseManufacturerMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="listPage" resultType="com.yxt.oms.biz.func.basemanufacturer.BaseManufacturerVo"> |
|||
select |
|||
* |
|||
from base_manufacturer |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
<select id="getAllTypeByUseOrgSid" resultType="com.yxt.oms.biz.func.basemanufacturer.BaseManufacturerVo"> |
|||
select * |
|||
from base_manufacturer |
|||
where useOrgSid = #{useOrgSid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,22 @@ |
|||
package com.yxt.oms.biz.func.basemanufacturer; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseManufacturerQuery implements Query { |
|||
private String name; |
|||
private String orgLevelKey;//权限等级
|
|||
@ApiModelProperty("菜单路由") |
|||
private String menuUrl; |
|||
@ApiModelProperty("组织全路径sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
private int index; |
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.yxt.oms.biz.func.basemanufacturer; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.commonmethod.CommonMethod; |
|||
import com.yxt.oms.biz.func.commonmethod.DataRule; |
|||
import com.yxt.oms.feign.goods.basemanufacturer.BaseManufacturerFeign; |
|||
import com.yxt.oms.utils.OrgPathQuery; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseManufacturerService extends MybatisBaseService<BaseManufacturerMapper, BaseManufacturer> { |
|||
@Autowired |
|||
BaseManufacturerFeign baseManufacturerFeign; |
|||
@Autowired |
|||
CommonMethod commonMethod; |
|||
|
|||
public ResultBean<PagerVo<BaseManufacturerVo>> listPage(PagerQuery<BaseManufacturerQuery> pq) { |
|||
BaseManufacturerQuery query=pq.getParams(); |
|||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|||
pq.getParams().setIndex(dataRule.getIndex()); |
|||
return baseManufacturerFeign.listPage(pq); |
|||
} |
|||
public ResultBean<List<BaseManufacturer>> listAll( OrgPathQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseManufacturerFeign.listAll(query); |
|||
} |
|||
|
|||
public ResultBean<String> saveOrUpdate(BaseManufacturerDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseManufacturerFeign.saveOrUpdate(dto); |
|||
} |
|||
|
|||
public ResultBean<BaseManufacturerVo> initialization(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseManufacturerFeign.initialization(sid); |
|||
} |
|||
|
|||
|
|||
|
|||
public ResultBean delete(String sid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
BaseManufacturer omsManufacturer = fetchBySid(sid); |
|||
if (null != omsManufacturer) { |
|||
baseMapper.deleteById(omsManufacturer.getId()); |
|||
} |
|||
return rb.success(); |
|||
} |
|||
public ResultBean updateIsEnable(String sid,String isEnable) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseManufacturerFeign.updateIsEnable(sid, isEnable); |
|||
} |
|||
public ResultBean delAll(String[] sids) { |
|||
return baseManufacturerFeign.delBySids(sids); |
|||
} |
|||
public ResultBean<List<BaseManufacturerVo>> getAllTypeByUseOrgSid(String useOrgSid) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
return baseManufacturerFeign.getAllTypeByUseOrgSid(useOrgSid); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.yxt.oms.biz.func.basemanufacturer; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:37 |
|||
*/ |
|||
@Data |
|||
public class BaseManufacturerVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String lockVersion; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date modifyTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String state; |
|||
private String isDelete; |
|||
private String createBySid; |
|||
private String updateBySid; |
|||
private String manufacturerName;//厂家名称
|
|||
private String manufacturerCode;//厂家编码
|
|||
private String address;//地址
|
|||
private String telephone;//电话
|
|||
private String contacts;//联系人
|
|||
private String sortNo;//排序
|
|||
private String useOrgSid;//使用组织sid
|
|||
private String createOrgSid;//创建组织sid
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.oms.biz.func.baseproduct; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 9:34 |
|||
*/ |
|||
@Data |
|||
public class BaseProductChildVo { |
|||
|
|||
private String sid; |
|||
private String cSid; |
|||
private String productCode; //产品编码
|
|||
private String productName; //产品名称
|
|||
private String rateType; //产出率/配比 0/1
|
|||
private String materialName; //原料名称
|
|||
private String materialCode;//原料编码
|
|||
private String rate;//产出比例
|
|||
private List<BaseProductChildVo> children = new ArrayList<>(); |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.yxt.oms.biz.func.baseproduct; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 10:37 |
|||
*/ |
|||
@Data |
|||
public class BaseProductDetailsVo implements Vo { |
|||
private String sid; |
|||
private String createBySid; |
|||
private String useOrgSid; |
|||
private String createOrgSid; |
|||
@ApiModelProperty("对应商品sid") |
|||
private String goodsSid; // 产品对应商品sid
|
|||
private String productName; // 产品名称
|
|||
@ApiModelProperty("0产出率/1配比(初加工/深加工)") |
|||
private String rateType; // 0产出率/1配比(初加工/深加工)
|
|||
private List<BaseProductMaterialDetailsVo> list = new ArrayList<>(); //原料列表
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.yxt.oms.biz.func.baseproduct; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 10:37 |
|||
*/ |
|||
@Data |
|||
public class BaseProductDto implements Dto { |
|||
private String sid; |
|||
private String createBySid; |
|||
private String useOrgSid; |
|||
private String createOrgSid; |
|||
@ApiModelProperty("对应商品sid") |
|||
private String goodsSid; // 产品对应商品sid
|
|||
private String productName; // 产品名称
|
|||
@ApiModelProperty("0产出率/1配比(初加工/深加工)") |
|||
private String rateType; // 0产出率/1配比(初加工/深加工)
|
|||
private List<BaseProductMaterialDetailsVo> list = new ArrayList<>(); //原料列表
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.yxt.oms.biz.func.baseproduct; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 10:40 |
|||
*/ |
|||
@Data |
|||
public class BaseProductMaterialDetailsVo { |
|||
|
|||
|
|||
@ApiModelProperty("原料sid-对应商品sid") |
|||
private String materialSid; // 原料sid-对应商品sid
|
|||
private String materialName; //原料名称
|
|||
private String materialCode;//原料编码
|
|||
private String rate;//产出比例
|
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.yxt.oms.biz.func.baseproduct; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 9:30 |
|||
*/ |
|||
@Data |
|||
public class BaseProductQuery implements Query { |
|||
|
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
private String productName; |
|||
/** |
|||
* 比例类别 |
|||
*/ |
|||
private String rateType; |
|||
|
|||
|
|||
private String orgLevelKey;//权限等级
|
|||
@ApiModelProperty("菜单路由") |
|||
private String menuUrl; |
|||
@ApiModelProperty("组织全路径sid") |
|||
private String orgPath; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
private int index; |
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.yxt.oms.biz.func.baseproduct; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.biz.func.commonmethod.CommonMethod; |
|||
import com.yxt.oms.biz.func.commonmethod.DataRule; |
|||
import com.yxt.oms.feign.goods.baseproduct.BaseProductFeign; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2024/2/26 13:40 |
|||
*/ |
|||
@Service |
|||
public class BaseProductService { |
|||
@Autowired |
|||
private BaseProductFeign baseProductFeign; |
|||
@Autowired |
|||
private CommonMethod commonMethod; |
|||
|
|||
public ResultBean<PagerVo<BaseProductVo>> listPage(PagerQuery<BaseProductQuery> pq) { |
|||
//通用组装方法 根据用户sid、菜单、组织全路径sid 获取组装参数
|
|||
BaseProductQuery query = pq.getParams(); |
|||
DataRule dataRule=commonMethod.dataRule(query.getOrgPath(),query.getMenuUrl(),query.getUserSid()).getData(); |
|||
pq.getParams().setOrgLevelKey(dataRule.getDataRuleId()); |
|||
pq.getParams().setIndex(dataRule.getIndex()); |
|||
return baseProductFeign.listPage(pq); |
|||
} |
|||
|
|||
public ResultBean saveProduct(BaseProductDto dto) { |
|||
return baseProductFeign.saveOrUpdate(dto); |
|||
} |
|||
|
|||
public ResultBean<BaseProductDetailsVo> fetchDetailsBySid(String sid) { |
|||
return baseProductFeign.fetchBySid(sid); |
|||
} |
|||
|
|||
public ResultBean deleteBySids(String[] sids) { |
|||
return baseProductFeign.delBySids(sids); |
|||
} |
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.yxt.oms.biz.func.baseproduct; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 9:30 |
|||
*/ |
|||
@Data |
|||
public class BaseProductVo implements Vo { |
|||
|
|||
/** |
|||
* 原料编码 |
|||
*/ |
|||
private String materialCode; |
|||
/** |
|||
* 原料名称 |
|||
*/ |
|||
private String materialName; |
|||
/** |
|||
* 产品编码 |
|||
*/ |
|||
private String productCode; |
|||
/** |
|||
* 产品名称 |
|||
*/ |
|||
private String productName; |
|||
/** |
|||
* 比例 |
|||
*/ |
|||
private String rate; |
|||
/** |
|||
* 比例类别 |
|||
*/ |
|||
private String rateType; |
|||
private String sid; |
|||
private String cSid; |
|||
private List<BaseProductChildVo> children = new ArrayList<>(); |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.yxt.oms.biz.func.goodsspu; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 10:22 |
|||
*/ |
|||
@Data |
|||
public class ProductGoodsQuery { |
|||
|
|||
private String queryName; |
|||
private String useOrgSid; |
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.yxt.oms.biz.func.goodsspu; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author Fan |
|||
* @description |
|||
* @date 2024/8/13 10:20 |
|||
*/ |
|||
@Data |
|||
public class ProductGoodsVo { |
|||
|
|||
private String sid; |
|||
private String goodsName; |
|||
private String goodsCode; |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.biz.func.supplierbank; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-base(供应商管理) <br/> |
|||
* File: BaseSupplierBank.java <br/> |
|||
* Class: com.yxt.base.api.basesupplierbank.BaseSupplierBank <br/> |
|||
* Description: 供应商开户行信息. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-18 13:33:13 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "供应商开户行信息", description = "供应商开户行信息") |
|||
@TableName("base_supplier_bank") |
|||
public class SupplierBank extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty("供应商sid") |
|||
private String supplierSid; // 供应商sid
|
|||
@ApiModelProperty("开户行") |
|||
private String bankName; // 开户行
|
|||
@ApiModelProperty("开户行帐号") |
|||
private String bankAccount; // 开户行帐号
|
|||
@ApiModelProperty("账户名称") |
|||
private String accountName; // 账户名称
|
|||
@ApiModelProperty("账户类型key") |
|||
private String dueBankKey; // 账户类型key
|
|||
@ApiModelProperty("账户类型value") |
|||
private String dueBankValue; // 账户类型value
|
|||
@ApiModelProperty("银行网点") |
|||
private String bankingOutlets; // 银行网点
|
|||
@ApiModelProperty("开户行地址") |
|||
private String bankAddress; // 开户行地址
|
|||
@ApiModelProperty("联行号") |
|||
private String paymentLines; // 联行号
|
|||
@ApiModelProperty("银行代码") |
|||
private String swiftCode; // 银行代码
|
|||
@ApiModelProperty("币种") |
|||
private String currency; // 币种
|
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.biz.func.supplierbank; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-base(供应商管理) <br/> |
|||
* File: BaseSupplierBankVo.java <br/> |
|||
* Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankVo <br/> |
|||
* Description: 供应商开户行信息 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-18 13:33:13 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "供应商开户行信息 视图数据详情", description = "供应商开户行信息 视图数据详情") |
|||
public class SupplierBankDetailsVo implements Vo { |
|||
|
|||
private String sid; // sid
|
|||
|
|||
@ApiModelProperty("供应商sid") |
|||
private String supplierSid; // 供应商sid
|
|||
@ApiModelProperty("开户行") |
|||
private String bankName; // 开户行
|
|||
@ApiModelProperty("开户行帐号") |
|||
private String bankAccount; // 开户行帐号
|
|||
@ApiModelProperty("账户名称") |
|||
private String accountName; // 账户名称
|
|||
@ApiModelProperty("账户类型key") |
|||
private String dueBankKey; // 账户类型key
|
|||
@ApiModelProperty("账户类型value") |
|||
private String dueBankValue; // 账户类型value
|
|||
@ApiModelProperty("银行网点") |
|||
private String bankingOutlets; // 银行网点
|
|||
@ApiModelProperty("开户行地址") |
|||
private String bankAddress; // 开户行地址
|
|||
@ApiModelProperty("联行号") |
|||
private String paymentLines; // 联行号
|
|||
@ApiModelProperty("银行代码") |
|||
private String swiftCode; // 银行代码
|
|||
@ApiModelProperty("币种") |
|||
private String currency; // 币种
|
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.biz.func.supplierbank; |
|||
|
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-base(供应商管理) <br/> |
|||
* File: BaseSupplierBankDto.java <br/> |
|||
* Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankDto <br/> |
|||
* Description: 供应商开户行信息 数据传输对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-18 13:33:13 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "供应商开户行信息 数据传输对象", description = "供应商开户行信息 数据传输对象") |
|||
public class SupplierBankDto implements Dto { |
|||
|
|||
private String sid; // sid
|
|||
|
|||
@ApiModelProperty("供应商sid") |
|||
private String supplierSid; // 供应商sid
|
|||
@ApiModelProperty("开户行") |
|||
private String bankName; // 开户行
|
|||
@ApiModelProperty("开户行帐号") |
|||
private String bankAccount; // 开户行帐号
|
|||
@ApiModelProperty("账户名称") |
|||
private String accountName; // 账户名称
|
|||
@ApiModelProperty("账户类型key") |
|||
private String dueBankKey; // 账户类型key
|
|||
@ApiModelProperty("账户类型value") |
|||
private String dueBankValue; // 账户类型value
|
|||
@ApiModelProperty("银行网点") |
|||
private String bankingOutlets; // 银行网点
|
|||
@ApiModelProperty("开户行地址") |
|||
private String bankAddress; // 开户行地址
|
|||
@ApiModelProperty("联行号") |
|||
private String paymentLines; // 联行号
|
|||
@ApiModelProperty("银行代码") |
|||
private String swiftCode; // 银行代码
|
|||
@ApiModelProperty("币种") |
|||
private String currency; // 币种
|
|||
|
|||
} |
@ -0,0 +1,67 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.biz.func.supplierbank; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import org.apache.ibatis.annotations.Delete; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: yxt-base(供应商管理) <br/> |
|||
* File: BaseSupplierBankMapper.java <br/> |
|||
* Class: com.yxt.base.biz.basesupplierbank.BaseSupplierBankMapper <br/> |
|||
* Description: 供应商开户行信息. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-18 13:33:13 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Mapper |
|||
public interface SupplierBankMapper extends BaseMapper<SupplierBank> { |
|||
|
|||
IPage<SupplierBankVo> selectPageVo(IPage<SupplierBank> page, @Param(Constants.WRAPPER) Wrapper<SupplierBank> qw); |
|||
|
|||
List<SupplierBankVo> selectListAllVo(@Param(Constants.WRAPPER) Wrapper<SupplierBank> qw); |
|||
|
|||
@Select("select * from base_supplier_bank") |
|||
List<SupplierBankVo> selectListVo(); |
|||
|
|||
@Delete("delete from base_supplier_bank where supplierSid = #{supplierSid}") |
|||
int deleteBySupplierSid(String supplierSid); |
|||
|
|||
@Select("select * from base_supplier_bank where supplierSid = #{supplierSid}") |
|||
List<SupplierBankDetailsVo> selectBySupplierSid(String supplierSid); |
|||
} |
@ -0,0 +1,13 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.oms.biz.func.supplierbank.SupplierBankMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
<select id="selectPageVo" resultType="com.yxt.oms.biz.func.supplierbank.SupplierBankVo"> |
|||
SELECT * FROM base_supplier_bank <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
|
|||
<select id="selectListAllVo" resultType="com.yxt.oms.biz.func.supplierbank.SupplierBankVo"> |
|||
SELECT * FROM base_supplier_bank <where> ${ew.sqlSegment} </where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,74 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.biz.func.supplierbank; |
|||
|
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-base(供应商管理) <br/> |
|||
* File: BaseSupplierBankQuery.java <br/> |
|||
* Class: com.yxt.base.api.basesupplierbank.BaseSupplierBankQuery <br/> |
|||
* Description: 供应商开户行信息 查询条件. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-18 13:33:13 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "供应商开户行信息 查询条件", description = "供应商开户行信息 查询条件") |
|||
public class SupplierBankQuery implements Query { |
|||
|
|||
@ApiModelProperty("供应商sid") |
|||
private String supplierSid; // 供应商sid
|
|||
@ApiModelProperty("开户行") |
|||
private String bankName; // 开户行
|
|||
@ApiModelProperty("开户行帐号") |
|||
private String bankAccount; // 开户行帐号
|
|||
@ApiModelProperty("账户名称") |
|||
private String accountName; // 账户名称
|
|||
@ApiModelProperty("账户类型key") |
|||
private String dueBankKey; // 账户类型key
|
|||
@ApiModelProperty("账户类型value") |
|||
private String dueBankValue; // 账户类型value
|
|||
@ApiModelProperty("银行网点") |
|||
private String bankingOutlets; // 银行网点
|
|||
@ApiModelProperty("开户行地址") |
|||
private String bankAddress; // 开户行地址
|
|||
@ApiModelProperty("联行号") |
|||
private String paymentLines; // 联行号
|
|||
@ApiModelProperty("银行代码") |
|||
private String swiftCode; // 银行代码
|
|||
@ApiModelProperty("币种") |
|||
private String currency; // 币种
|
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.oms.biz.func.supplierbank; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.oms.feign.supplier.supplierbank.SupplierBankFeign; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* Project: yxt-base(供应商管理) <br/> |
|||
* File: BaseSupplierBankService.java <br/> |
|||
* Class: com.yxt.base.biz.basesupplierbank.BaseSupplierBankService <br/> |
|||
* Description: 供应商开户行信息 业务逻辑. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2024-03-18 13:33:13 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Service |
|||
public class SupplierBankService extends MybatisBaseService<SupplierBankMapper, SupplierBank> { |
|||
@Autowired |
|||
SupplierBankFeign supplierBankFeign; |
|||
public ResultBean<PagerVo<SupplierBankVo>> listPageVo(PagerQuery<SupplierBankQuery> pq) { |
|||
return supplierBankFeign.listPage(pq); |
|||
} |
|||
|
|||
public ResultBean saveOrUpdateDto(SupplierBankDto dto){ |
|||
return supplierBankFeign.save(dto); |
|||
} |
|||
|
|||
public ResultBean<SupplierBankDetailsVo> fetchDetailsVoBySid(String sid){ |
|||
return supplierBankFeign.fetchDetailsBySid(sid); |
|||
} |
|||
|
|||
public ResultBean delAll(String[] sids) { |
|||
return supplierBankFeign.delBySids(sids); |
|||
} |
|||
|
|||
|
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue