From 4d164aa76e3a6c5a271abd15d82dfa5c8a866a63 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Thu, 6 Jun 2024 09:36:00 +0800 Subject: [PATCH] 6/6 --- .../WmsInventoryBatchService.java | 94 ++++++++++++++++ .../WmsInventoryCheckbillDetailQuery.java | 50 +++++++++ .../WmsInventoryCheckbillDetailService.java | 104 ++++++++++++++++++ 3 files changed, 248 insertions(+) create mode 100644 src/main/java/com/yxt/warehouse/biz/wmsinventorybatch/WmsInventoryBatchService.java create mode 100644 src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailQuery.java create mode 100644 src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailService.java diff --git a/src/main/java/com/yxt/warehouse/biz/wmsinventorybatch/WmsInventoryBatchService.java b/src/main/java/com/yxt/warehouse/biz/wmsinventorybatch/WmsInventoryBatchService.java new file mode 100644 index 0000000..bbe6502 --- /dev/null +++ b/src/main/java/com/yxt/warehouse/biz/wmsinventorybatch/WmsInventoryBatchService.java @@ -0,0 +1,94 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.warehouse.biz.wmsinventorybatch; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * Project: yxt-wms(库存)
+ * File: WmsInventoryBatchService.java
+ * Class: com.yxt.wms.biz.wmsinventorybatch.WmsInventoryBatchService
+ * Description: 商品库存-批次属性 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-04-30 14:05:11
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class WmsInventoryBatchService extends MybatisBaseService { + + public PagerVo listPageVo(PagerQuery pq) { + WmsInventoryBatchQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(WmsInventoryBatchDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(WmsInventoryBatchDto dto){ + WmsInventoryBatch entity = new WmsInventoryBatch(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(WmsInventoryBatchDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + WmsInventoryBatch entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public WmsInventoryBatchDetailsVo fetchDetailsVoBySid(String sid){ + WmsInventoryBatch entity = fetchBySid(sid); + WmsInventoryBatchDetailsVo vo = new WmsInventoryBatchDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } +} \ No newline at end of file diff --git a/src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailQuery.java b/src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailQuery.java new file mode 100644 index 0000000..7f6b088 --- /dev/null +++ b/src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailQuery.java @@ -0,0 +1,50 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.warehouse.biz.wmsinventorycheckbilldetail; + + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * Project: yxt-wms(仓储)
+ * File: WmsInventoryCheckbillDetailQuery.java
+ * Class: com.yxt.wms.api.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailQuery
+ * Description: 库存盘点-明细 查询条件.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-22 09:25:02
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "库存盘点-明细 查询条件", description = "库存盘点-明细 查询条件") +public class WmsInventoryCheckbillDetailQuery implements Query { + +} diff --git a/src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailService.java b/src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailService.java new file mode 100644 index 0000000..6a88dec --- /dev/null +++ b/src/main/java/com/yxt/warehouse/biz/wmsinventorycheckbilldetail/WmsInventoryCheckbillDetailService.java @@ -0,0 +1,104 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.warehouse.biz.wmsinventorycheckbilldetail; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.PagerUtil; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.vo.PagerVo; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Project: yxt-wms(仓储)
+ * File: WmsInventoryCheckbillDetailService.java
+ * Class: com.yxt.wms.biz.wmsinventorycheckbilldetail.WmsInventoryCheckbillDetailService
+ * Description: 库存盘点-明细 业务逻辑.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2024-03-22 09:25:02
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class WmsInventoryCheckbillDetailService extends MybatisBaseService { + + public PagerVo listPageVo(PagerQuery pq) { + WmsInventoryCheckbillDetailQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public void saveOrUpdateDto(WmsInventoryCheckbillDetailDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + this.insertByDto(dto); + return; + } + this.updateByDto(dto); + } + + public void insertByDto(WmsInventoryCheckbillDetailDto dto){ + WmsInventoryCheckbillDetail entity = new WmsInventoryCheckbillDetail(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + } + + public void updateByDto(WmsInventoryCheckbillDetailDto dto){ + String dtoSid = dto.getSid(); + if (StringUtils.isBlank(dtoSid)) { + return; + } + WmsInventoryCheckbillDetail entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public WmsInventoryCheckbillDetailDetailsVo fetchDetailsVoBySid(String sid){ + WmsInventoryCheckbillDetail entity = fetchBySid(sid); + WmsInventoryCheckbillDetailDetailsVo vo = new WmsInventoryCheckbillDetailDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public void delByMainSid(String dtoSid) { + baseMapper.delByMainSid(dtoSid); + } + + public List selByMainSid(String billSid) { + return baseMapper.selByMainSid(billSid); + } +} \ No newline at end of file