From 63550d6dce127fe382c13db28cfc6fc6e2c4636d Mon Sep 17 00:00:00 2001 From: chj <16637853242@163.com> Date: Mon, 11 Sep 2023 17:53:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=90=E5=93=81=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsSellOutEmbryoController.java | 121 ++++++++ .../controller/WmsSellOutTrayController.java | 146 ++++++++++ .../op/wms/mapper/WmsSellOutEmbryoMapper.java | 77 +++++ .../op/wms/mapper/WmsSellOutTrayMapper.java | 85 ++++++ .../wms/service/IWmsSellOutEmbryoService.java | 76 +++++ .../wms/service/IWmsSellOutTrayService.java | 83 ++++++ .../impl/WmsSellOutEmbryoServiceImpl.java | 137 +++++++++ .../impl/WmsSellOutTrayServiceImpl.java | 268 ++++++++++++++++++ .../mapper/wms/WmsSellOutEmbryoMapper.xml | 241 ++++++++++++++++ .../mapper/wms/WmsSellOutTrayMapper.xml | 223 +++++++++++++++ 10 files changed, 1457 insertions(+) create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutTrayController.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutTrayMapper.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutTrayService.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java create mode 100644 op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutTrayServiceImpl.java create mode 100644 op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml create mode 100644 op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutTrayMapper.xml diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java new file mode 100644 index 00000000..8bd0161e --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java @@ -0,0 +1,121 @@ +package com.op.wms.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.wms.domain.WmsSellOutEmbryo; +import com.op.wms.service.IWmsSellOutEmbryoService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 成品销售出库Controller + * + * @author Open Platform + * @date 2023-09-04 + */ +@RestController +@RequestMapping("/sellout") +public class WmsSellOutEmbryoController extends BaseController { + @Autowired + private IWmsSellOutEmbryoService wmsSellOutEmbryoService; + + /** + * 查询成品销售出库列表 + */ + @RequiresPermissions("wms:sellout:list") + @GetMapping("/list") + public TableDataInfo list(WmsSellOutEmbryo wmsSellOutEmbryo) { + startPage(); + List list = wmsSellOutEmbryoService.selectWmsSellOutEmbryoList(wmsSellOutEmbryo); + return getDataTable(list); + } + + /** + * 导出成品销售出库列表 + */ + @RequiresPermissions("wms:sellout:export") + @Log(title = "成品销售出库", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmsSellOutEmbryo wmsSellOutEmbryo) { + List list = wmsSellOutEmbryoService.selectWmsSellOutEmbryoList(wmsSellOutEmbryo); + ExcelUtil util = new ExcelUtil(WmsSellOutEmbryo.class); + util.exportExcel(response, list, "成品销售出库数据"); + } + + /** + * 获取成品销售出库详细信息 + */ + @RequiresPermissions("wms:sellout:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(wmsSellOutEmbryoService.selectWmsSellOutEmbryoById(id)); + } + + /** + * 新增成品销售出库 + */ + @RequiresPermissions("wms:sellout:add") + @Log(title = "成品销售出库", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WmsSellOutEmbryo wmsSellOutEmbryo) { + return toAjax(wmsSellOutEmbryoService.insertWmsSellOutEmbryo(wmsSellOutEmbryo)); + } + + /** + * 修改成品销售出库 + */ + @RequiresPermissions("wms:sellout:edit") + @Log(title = "成品销售出库", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmsSellOutEmbryo wmsSellOutEmbryo) { + return toAjax(wmsSellOutEmbryoService.updateWmsSellOutEmbryo(wmsSellOutEmbryo)); + } + + /** + * 删除成品销售出库 + */ + @RequiresPermissions("wms:sellout:remove") + @Log(title = "成品销售出库", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(wmsSellOutEmbryoService.deleteWmsSellOutEmbryoByIds(ids)); + } + + /** + * 根据交货单号查询下面的产品编码 + * @param deliveryOrder + * @return + */ + @GetMapping("/showProduceCode/{deliveryOrder}") + public AjaxResult selectWmsSellOutEmbryoByDeliveryOrder(@PathVariable("deliveryOrder") String deliveryOrder){ + return AjaxResult.success(wmsSellOutEmbryoService.selectWmsSellOutEmbryoByDeliveryOrder(deliveryOrder)); + } + + /** + * 手持根据订单号和产品编码查询接口 + * @param deliveryOrder + * @param productCode + * @return + * selectWmsSellOutByOrderCodeAndProductCode + */ + @GetMapping("/s/{deliveryOrder}/{productCode}") + public AjaxResult selectWmsSellOutByOrderCodeAndProductCode(@PathVariable("deliveryOrder") String deliveryOrder, @PathVariable("productCode") String productCode){ + return AjaxResult.success(wmsSellOutEmbryoService.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder,productCode)); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutTrayController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutTrayController.java new file mode 100644 index 00000000..bc91e136 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutTrayController.java @@ -0,0 +1,146 @@ +package com.op.wms.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.op.wms.domain.WmsSellOutEmbryo; +import com.op.wms.service.IWmsSellOutEmbryoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.op.common.log.annotation.Log; +import com.op.common.log.enums.BusinessType; +import com.op.common.security.annotation.RequiresPermissions; +import com.op.wms.domain.WmsSellOutTray; +import com.op.wms.service.IWmsSellOutTrayService; +import com.op.common.core.web.controller.BaseController; +import com.op.common.core.web.domain.AjaxResult; +import com.op.common.core.utils.poi.ExcelUtil; +import com.op.common.core.web.page.TableDataInfo; + +/** + * 成品销售出库关联托盘箱码Controller + * + * @author Open Platform + * @date 2023-09-04 + */ +@RestController +@RequestMapping("/selloutconntray") +public class WmsSellOutTrayController extends BaseController { + @Autowired + private IWmsSellOutTrayService wmsSellOutTrayService; + @Autowired + private IWmsSellOutEmbryoService wmsSellOutEmbryoService; + @Autowired + private RedisTemplate redisTemplate; + + /** + * 查询成品销售出库关联托盘箱码列表 + */ + @RequiresPermissions("wms:selloutconntray:list") + @GetMapping("/list") + public TableDataInfo list(WmsSellOutTray wmsSellOutTray) { + startPage(); + List list = wmsSellOutTrayService.selectWmsSellOutTrayList(wmsSellOutTray); + return getDataTable(list); + } + + /** + * 导出成品销售出库关联托盘箱码列表 + */ + @RequiresPermissions("wms:selloutconntray:export") + @Log(title = "成品销售出库关联托盘箱码", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmsSellOutTray wmsSellOutTray) { + List list = wmsSellOutTrayService.selectWmsSellOutTrayList(wmsSellOutTray); + ExcelUtil util = new ExcelUtil(WmsSellOutTray.class); + util.exportExcel(response, list, "成品销售出库关联托盘箱码数据"); + } + + /** + * 获取成品销售出库关联托盘箱码详细信息 + */ + @RequiresPermissions("wms:selloutconntray:query") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(wmsSellOutTrayService.selectWmsSellOutTrayById(id)); + } + + /** + * 新增成品销售出库关联托盘箱码 + * 扫描箱码接口 + */ +// @RequiresPermissions("wms:selloutconntray:add") + @Log(title = "成品销售出库关联托盘箱码", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WmsSellOutTray wmsSellOutTray) { + return toAjax(wmsSellOutTrayService.insertWmsSellOutTray(wmsSellOutTray)); + } + + /** + * 修改成品销售出库关联托盘箱码 + */ + @RequiresPermissions("wms:selloutconntray:edit") + @Log(title = "成品销售出库关联托盘箱码", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmsSellOutTray wmsSellOutTray) { + return toAjax(wmsSellOutTrayService.updateWmsSellOutTray(wmsSellOutTray)); + } + + /** + * 删除成品销售出库关联托盘箱码 + */ + @RequiresPermissions("wms:selloutconntray:remove") + @Log(title = "成品销售出库关联托盘箱码", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { + return toAjax(wmsSellOutTrayService.deleteWmsSellOutTrayByIds(ids)); + } + + + + /** + * 手持销售出库确认 + * @param wmsSellOutTrays + * @return + */ + @PostMapping("/out/{number}") + public AjaxResult handSellOut(@RequestBody List wmsSellOutTrays,@PathVariable("number") Long number){ + ValueOperations opsForValue = redisTemplate.opsForValue(); + String deliveryOrder = opsForValue.get("deliveryOrder"); + String productCode = opsForValue.get("productCode"); + WmsSellOutEmbryo wmsSellOutEmbryo = wmsSellOutEmbryoService.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder, productCode); + wmsSellOutEmbryo.setOutQuantity(number); + wmsSellOutEmbryoService.updateWmsSellOutEmbryo(wmsSellOutEmbryo); + return toAjax(wmsSellOutTrayService.handSellOut(wmsSellOutTrays)); + } + + /** + * 根据交货单号和产品编码查询展示接口 + * @param deliveryOrder + * @param productCode + * @return + */ + @GetMapping("/showTrays/{deliveryOrder}/{productCode}") + public AjaxResult selectWmsSellOutTrays(@PathVariable("deliveryOrder") String deliveryOrder,@PathVariable("productCode") String productCode){ + return AjaxResult.success(wmsSellOutTrayService.selectWmsSellOutTraysByIDAndCode(deliveryOrder,productCode)); + } + + /** + * 根据箱码删除接口 + * @param barcode + * @return + */ + @DeleteMapping("/deleteTray/{barcode}") + public AjaxResult deleteWmsSellOutTray(@PathVariable("barcode") String barcode){ + return toAjax(wmsSellOutTrayService.deleteWmsSellOutTrayByBarcode(barcode)); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java new file mode 100644 index 00000000..241a28a4 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutEmbryoMapper.java @@ -0,0 +1,77 @@ +package com.op.wms.mapper; + +import java.util.List; + +import com.op.wms.domain.WmsSellOutEmbryo; +import org.apache.ibatis.annotations.Param; + +/** + * 成品销售出库Mapper接口 + * + * @author Open Platform + * @date 2023-09-04 + */ +public interface WmsSellOutEmbryoMapper { + /** + * 查询成品销售出库 + * + * @param id 成品销售出库主键 + * @return 成品销售出库 + */ + public WmsSellOutEmbryo selectWmsSellOutEmbryoById(String id); + + /** + * 查询成品销售出库列表 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 成品销售出库集合 + */ + public List selectWmsSellOutEmbryoList(WmsSellOutEmbryo wmsSellOutEmbryo); + + /** + * 新增成品销售出库 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 结果 + */ + public int insertWmsSellOutEmbryo(WmsSellOutEmbryo wmsSellOutEmbryo); + + /** + * 修改成品销售出库 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 结果 + */ + public int updateWmsSellOutEmbryo(WmsSellOutEmbryo wmsSellOutEmbryo); + + /** + * 删除成品销售出库 + * + * @param id 成品销售出库主键 + * @return 结果 + */ + public int deleteWmsSellOutEmbryoById(String id); + + /** + * 批量删除成品销售出库 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmsSellOutEmbryoByIds(String[] ids); + + /** + * 根据备货单号查询下面的产品编码 + * @param deliveryOrder + * @return + */ + public List selectWmsSellOutEmbryoByDeliveryOrder(String deliveryOrder); + + /** + * 根据订单号和产品编码查询 + * @param deliveryOrder + * @param productCode + * @return + */ + public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(@Param("deliveryOrder") String deliveryOrder,@Param("productCode") String productCode); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutTrayMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutTrayMapper.java new file mode 100644 index 00000000..d346ea80 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsSellOutTrayMapper.java @@ -0,0 +1,85 @@ +package com.op.wms.mapper; + +import java.util.List; + +import com.op.wms.domain.WmsSellOutTray; +import org.apache.ibatis.annotations.Param; + +/** + * 成品销售出库关联托盘箱码Mapper接口 + * + * @author Open Platform + * @date 2023-09-04 + */ +public interface WmsSellOutTrayMapper { + /** + * 查询成品销售出库关联托盘箱码 + * + * @param id 成品销售出库关联托盘箱码主键 + * @return 成品销售出库关联托盘箱码 + */ + public WmsSellOutTray selectWmsSellOutTrayById(String id); + + /** + * 查询成品销售出库关联托盘箱码列表 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 成品销售出库关联托盘箱码集合 + */ + public List selectWmsSellOutTrayList(WmsSellOutTray wmsSellOutTray); + + /** + * 新增成品销售出库关联托盘箱码 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 结果 + */ + public int insertWmsSellOutTray(WmsSellOutTray wmsSellOutTray); + + /** + * 修改成品销售出库关联托盘箱码 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 结果 + */ + public int updateWmsSellOutTray(WmsSellOutTray wmsSellOutTray); + + /** + * 删除成品销售出库关联托盘箱码 + * + * @param id 成品销售出库关联托盘箱码主键 + * @return 结果 + */ + public int deleteWmsSellOutTrayById(String id); + + /** + * 批量删除成品销售出库关联托盘箱码 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmsSellOutTrayByIds(String[] ids); + + /** + * 根据交货单号和产品和托盘号编码查询 + * @param deliveryOrder + * @param productCode + * @return + */ + public WmsSellOutTray selectWmsSellOutTrayByDeliveryOrderAndProductCode(@Param("deliveryOrder") String deliveryOrder, @Param("productCode") String productCode,@Param("barcode") String barcode); + + /** + * 根据交货单号和产品编码查询展示 + * @param deliveryOrder + * @param productCode + * @return + */ + public List selectWmsSellOutTraysByDeliveryOrderAndProductCode(@Param("deliveryOrder") String deliveryOrder,@Param("productCode") String productCode); + + /** + * 根据箱码删除接口 + * @param barcode + * @return + */ + public int deleteWmsSellOutTrayByBarcode(String barcode); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java new file mode 100644 index 00000000..2874a618 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java @@ -0,0 +1,76 @@ +package com.op.wms.service; + +import java.util.List; +import com.op.wms.domain.WmsSellOutEmbryo; + +/** + * 成品销售出库Service接口 + * + * @author Open Platform + * @date 2023-09-04 + */ +public interface IWmsSellOutEmbryoService { + /** + * 查询成品销售出库 + * + * @param id 成品销售出库主键 + * @return 成品销售出库 + */ + public WmsSellOutEmbryo selectWmsSellOutEmbryoById(String id); + + /** + * 查询成品销售出库列表 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 成品销售出库集合 + */ + public List selectWmsSellOutEmbryoList(WmsSellOutEmbryo wmsSellOutEmbryo); + + /** + * 新增成品销售出库 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 结果 + */ + public int insertWmsSellOutEmbryo(WmsSellOutEmbryo wmsSellOutEmbryo); + + /** + * 修改成品销售出库 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 结果 + */ + public int updateWmsSellOutEmbryo(WmsSellOutEmbryo wmsSellOutEmbryo); + + /** + * 批量删除成品销售出库 + * + * @param ids 需要删除的成品销售出库主键集合 + * @return 结果 + */ + public int deleteWmsSellOutEmbryoByIds(String[] ids); + + /** + * 删除成品销售出库信息 + * + * @param id 成品销售出库主键 + * @return 结果 + */ + public int deleteWmsSellOutEmbryoById(String id); + + + /** + * 根据备货单号查询下面的产品编码 + * @param deliveryOrder + * @return + */ + public List selectWmsSellOutEmbryoByDeliveryOrder(String deliveryOrder); + + /** + * 根据订单号和产品编码查询 + * @param deliveryOrder + * @param productCode + * @return + */ + public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(String deliveryOrder,String productCode); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutTrayService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutTrayService.java new file mode 100644 index 00000000..9cf4e5cc --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutTrayService.java @@ -0,0 +1,83 @@ +package com.op.wms.service; + +import java.util.List; +import com.op.wms.domain.WmsSellOutTray; + +/** + * 成品销售出库关联托盘箱码Service接口 + * + * @author Open Platform + * @date 2023-09-04 + */ +public interface IWmsSellOutTrayService { + /** + * 查询成品销售出库关联托盘箱码 + * + * @param id 成品销售出库关联托盘箱码主键 + * @return 成品销售出库关联托盘箱码 + */ + public WmsSellOutTray selectWmsSellOutTrayById(String id); + + /** + * 查询成品销售出库关联托盘箱码列表 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 成品销售出库关联托盘箱码集合 + */ + public List selectWmsSellOutTrayList(WmsSellOutTray wmsSellOutTray); + + /** + * 新增成品销售出库关联托盘箱码 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 结果 + */ + public int insertWmsSellOutTray(WmsSellOutTray wmsSellOutTray); + + /** + * 修改成品销售出库关联托盘箱码 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 结果 + */ + public int updateWmsSellOutTray(WmsSellOutTray wmsSellOutTray); + + /** + * 批量删除成品销售出库关联托盘箱码 + * + * @param ids 需要删除的成品销售出库关联托盘箱码主键集合 + * @return 结果 + */ + public int deleteWmsSellOutTrayByIds(String[] ids); + + /** + * 删除成品销售出库关联托盘箱码信息 + * + * @param id 成品销售出库关联托盘箱码主键 + * @return 结果 + */ + public int deleteWmsSellOutTrayById(String id); + + + /** + * 手持点击出库 + * @param wmsSellOutTrays + * @return + */ + public int handSellOut(List wmsSellOutTrays); + + /** + * 根据单号和产品编码查询展示 + * @param deliveryOrder + * @param productCode + * @return + */ + public List selectWmsSellOutTraysByIDAndCode(String deliveryOrder,String productCode); + + /** + * 根据箱码删除接口 + * @param barcode + * @return + */ + public int deleteWmsSellOutTrayByBarcode(String barcode); +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java new file mode 100644 index 00000000..9376fa81 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java @@ -0,0 +1,137 @@ +package com.op.wms.service.impl; + +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Service; +import com.op.wms.mapper.WmsSellOutEmbryoMapper; +import com.op.wms.domain.WmsSellOutEmbryo; +import com.op.wms.service.IWmsSellOutEmbryoService; + +/** + * 成品销售出库Service业务层处理 + * + * @author Open Platform + * @date 2023-09-04 + */ +@Service +public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService { + @Autowired + private WmsSellOutEmbryoMapper wmsSellOutEmbryoMapper; + + @Autowired + private RedisTemplate redisTemplate; + + /** + * 查询成品销售出库 + * + * @param id 成品销售出库主键 + * @return 成品销售出库 + */ + @Override + @DS("#header.poolName") + public WmsSellOutEmbryo selectWmsSellOutEmbryoById(String id) { + return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoById(id); + } + + /** + * 查询成品销售出库列表 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 成品销售出库 + */ + @Override + @DS("#header.poolName") + public List selectWmsSellOutEmbryoList(WmsSellOutEmbryo wmsSellOutEmbryo) { + return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoList(wmsSellOutEmbryo); + } + + /** + * 新增成品销售出库 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int insertWmsSellOutEmbryo(WmsSellOutEmbryo wmsSellOutEmbryo) { + wmsSellOutEmbryo.setId(IdUtils.fastSimpleUUID()); + wmsSellOutEmbryo.setCreateTime(DateUtils.getNowDate()); + return wmsSellOutEmbryoMapper.insertWmsSellOutEmbryo(wmsSellOutEmbryo); + } + + /** + * 修改成品销售出库 + * + * @param wmsSellOutEmbryo 成品销售出库 + * @return 结果 + */ + @Override +// @DS("#header.poolName") + public int updateWmsSellOutEmbryo(WmsSellOutEmbryo wmsSellOutEmbryo) { + //todo 需要修改 + DynamicDataSourceContextHolder.push("ds_1000"); + wmsSellOutEmbryo.setUpdateTime(DateUtils.getNowDate()); + return wmsSellOutEmbryoMapper.updateWmsSellOutEmbryo(wmsSellOutEmbryo); + } + + /** + * 批量删除成品销售出库 + * + * @param ids 需要删除的成品销售出库主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWmsSellOutEmbryoByIds(String[] ids) { + return wmsSellOutEmbryoMapper.deleteWmsSellOutEmbryoByIds(ids); + } + + /** + * 删除成品销售出库信息 + * + * @param id 成品销售出库主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWmsSellOutEmbryoById(String id) { + return wmsSellOutEmbryoMapper.deleteWmsSellOutEmbryoById(id); + } + + /** + * 根据备货单号查询下面的产品编码 + * @param deliveryOrder + * @return + */ + @Override +// @DS("#header.poolName") + public List selectWmsSellOutEmbryoByDeliveryOrder(String deliveryOrder) { + //todo 需要修改 + DynamicDataSourceContextHolder.push("ds_1000"); + return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByDeliveryOrder(deliveryOrder); + } + + /** + * 根据订单号和产品编码查询 + * @param deliveryOrder + * @param productCode + * @return + */ + @Override +// @DS("#header.poolName") + public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(String deliveryOrder, String productCode) { + //todo 需要修改 + DynamicDataSourceContextHolder.push("ds_1000"); + ValueOperations opsForValue = redisTemplate.opsForValue(); + opsForValue.set("deliveryOrder",deliveryOrder); + opsForValue.set("productCode",productCode); + return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder,productCode); + } +} diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutTrayServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutTrayServiceImpl.java new file mode 100644 index 00000000..940f4f98 --- /dev/null +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutTrayServiceImpl.java @@ -0,0 +1,268 @@ +package com.op.wms.service.impl; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.context.SecurityContextHolder; +import com.op.common.core.exception.ServiceException; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; +import com.op.wms.domain.*; +import com.op.wms.mapper.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Service; +import com.op.wms.service.IWmsSellOutTrayService; +import org.springframework.util.ObjectUtils; + +/** + * 成品销售出库关联托盘箱码Service业务层处理 + * + * @author Open Platform + * @date 2023-09-04 + */ +@Service +public class WmsSellOutTrayServiceImpl implements IWmsSellOutTrayService { + @Autowired + private WmsSellOutTrayMapper wmsSellOutTrayMapper; + @Autowired + private WmsProductPutTrayCodeMapper wmsProductPutTrayCodeMapper; +// 库存主表 + @Autowired + private WmsFpStorageNewsMapper wmsFpStorageNewsMapper; + + @Autowired + private WmsSellOutEmbryoMapper wmsSellOutEmbryoMapper; + @Autowired + private RedisTemplate redisTemplate; + //库存明细 + @Autowired + private WmsFpStorageNewsSnMapper wmsFpStorageNewsSnMapper; + + /** + * 查询成品销售出库关联托盘箱码 + * + * @param id 成品销售出库关联托盘箱码主键 + * @return 成品销售出库关联托盘箱码 + */ + @Override + @DS("#header.poolName") + public WmsSellOutTray selectWmsSellOutTrayById(String id) { + return wmsSellOutTrayMapper.selectWmsSellOutTrayById(id); + } + + /** + * 查询成品销售出库关联托盘箱码列表 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 成品销售出库关联托盘箱码 + */ + @Override + @DS("#header.poolName") + public List selectWmsSellOutTrayList(WmsSellOutTray wmsSellOutTray) { + return wmsSellOutTrayMapper.selectWmsSellOutTrayList(wmsSellOutTray); + } + + /** + * 新增成品销售出库关联托盘箱码 + * 扫描箱码接口 + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 结果 + */ + @Override +// @DS("#header.poolName") + public int insertWmsSellOutTray(WmsSellOutTray wmsSellOutTray) { + //todo 需要修改 + DynamicDataSourceContextHolder.push("ds_1000"); + ValueOperations opsForValue = redisTemplate.opsForValue(); + String deliveryOrder = opsForValue.get("deliveryOrder"); + String productCode = opsForValue.get("productCode"); + WmsSellOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder, productCode); + //todo 根据箱码查询托盘 + WmsProductPutTrayCode wmsProductPutTrayCode = wmsProductPutTrayCodeMapper.selectWmsProductPutTrayCodeByBarcode(wmsSellOutTray.getBarcode()); + //todo 根据托盘号和产品编码查询库存主表 + WmsFpStorageNewsSn wmsFpStorageNewsSn = wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnBySnAndProductCode(wmsProductPutTrayCode.getSn(), productCode); + if (ObjectUtils.isEmpty(wmsFpStorageNewsSn)){ + throw new ServiceException("库存中没有这个产品!"); + } + //todo 校验批次号是否一致 + if (wmsSellOutEmbryo1.getLotNumber().equals(wmsFpStorageNewsSn.getBatchNumber())){ + WmsSellOutTray wmsSellOutTray1 = wmsSellOutTrayMapper.selectWmsSellOutTrayByDeliveryOrderAndProductCode(deliveryOrder, productCode, wmsSellOutTray.getBarcode()); + if (wmsSellOutTray1==null){ + wmsSellOutTray.setId(IdUtils.fastSimpleUUID()); + wmsSellOutTray.setDeliveryOrder(deliveryOrder); + wmsSellOutTray.setProductCode(productCode); + WmsSellOutEmbryo wmsSellOutEmbryo = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder, productCode); + wmsSellOutTray.setFactoryCode(wmsSellOutEmbryo.getFactoryCode()); + wmsSellOutTray.setWhCode(wmsSellOutEmbryo.getWhCode()); + wmsSellOutTray.setWaCode(wmsSellOutEmbryo.getWaCode()); + wmsSellOutTray.setWlCode(wmsFpStorageNewsSn.getWlCode()); + wmsSellOutTray.setProductName(wmsSellOutEmbryo.getProductName()); + wmsSellOutTray.setProductSort(wmsSellOutEmbryo.getProductSort()); + wmsSellOutTray.setCreateTime(DateUtils.getNowDate()); + wmsSellOutTray.setBarcode(wmsSellOutTray.getBarcode()); + wmsSellOutTray.setLotNumber(wmsSellOutEmbryo.getLotNumber()); + //根据箱码查询托盘号 + wmsSellOutTray.setSn(wmsProductPutTrayCode.getSn()); + }else { + throw new ServiceException("这个产品已经出库!"); + } + }else { + throw new ServiceException("批次号在库存中不存在!"); + } +// WmsSellOutEmbryo wmsSellOutEmbryo1 = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder, productCode); +// WmsSellOutTray wmsSellOutTray1 = wmsSellOutTrayMapper.selectWmsSellOutTrayByDeliveryOrderAndProductCode(deliveryOrder, productCode, wmsSellOutTray.getBarcode()); +// if (wmsSellOutTray1==null){ +// wmsSellOutTray.setId(IdUtils.fastSimpleUUID()); +// wmsSellOutTray.setDeliveryOrder(deliveryOrder); +// wmsSellOutTray.setProductCode(productCode); +// WmsSellOutEmbryo wmsSellOutEmbryo = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder, productCode); +// wmsSellOutTray.setFactoryCode(wmsSellOutEmbryo.getFactoryCode()); +// wmsSellOutTray.setWhCode(wmsSellOutEmbryo.getWhCode()); +// wmsSellOutTray.setWaCode(wmsSellOutEmbryo.getWaCode()); +// wmsSellOutTray.setWlCode(wmsSellOutEmbryo.getWlCode()); +// wmsSellOutTray.setProductName(wmsSellOutEmbryo.getProductName()); +// wmsSellOutTray.setProductSort(wmsSellOutEmbryo.getProductSort()); +// wmsSellOutTray.setCreateTime(DateUtils.getNowDate()); +// wmsSellOutTray.setBarcode(wmsSellOutTray.getBarcode()); +// wmsSellOutTray.setLotNumber(wmsSellOutEmbryo.getLotNumber()); +// //根据箱码查询托盘号 +// WmsProductPutTrayCode wmsProductPutTrayCode = wmsProductPutTrayCodeMapper.selectWmsProductPutTrayCodeByBarcode(wmsSellOutTray.getBarcode()); +// wmsSellOutTray.setSn(wmsProductPutTrayCode.getSn()); +// }else { +// throw new ServiceException("这个产品已经出库!"); +// } +//// if ((wmsSellOutTray1.getBarcode()).equals(wmsSellOutTray.getBarcode())){ +//// throw new ServiceException("这个产品已经出库!"); +//// } + return wmsSellOutTrayMapper.insertWmsSellOutTray(wmsSellOutTray); + } + + /** + * 修改成品销售出库关联托盘箱码 + * + * @param wmsSellOutTray 成品销售出库关联托盘箱码 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int updateWmsSellOutTray(WmsSellOutTray wmsSellOutTray) { + wmsSellOutTray.setUpdateTime(DateUtils.getNowDate()); + return wmsSellOutTrayMapper.updateWmsSellOutTray(wmsSellOutTray); + } + + /** + * 批量删除成品销售出库关联托盘箱码 + * + * @param ids 需要删除的成品销售出库关联托盘箱码主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWmsSellOutTrayByIds(String[] ids) { + return wmsSellOutTrayMapper.deleteWmsSellOutTrayByIds(ids); + } + + /** + * 删除成品销售出库关联托盘箱码信息 + * + * @param id 成品销售出库关联托盘箱码主键 + * @return 结果 + */ + @Override + @DS("#header.poolName") + public int deleteWmsSellOutTrayById(String id) { + return wmsSellOutTrayMapper.deleteWmsSellOutTrayById(id); + } + + /** + * 手持点击出库 + * @param wmsSellOutTrays + * @return + */ + @Override +// @DS("#header.poolName") + public int handSellOut(List wmsSellOutTrays) { + //todo 需要修改 + DynamicDataSourceContextHolder.push("ds_1000"); + for (WmsSellOutTray wmsSellOutTray : wmsSellOutTrays) { + //todo 根据箱码查询托盘号 + WmsProductPutTrayCode wmsProductPutTrayCode = wmsProductPutTrayCodeMapper.selectWmsProductPutTrayCodeByBarcode(wmsSellOutTray.getBarcode()); + //todo 对托盘和箱码的状态进行解绑修改 + wmsProductPutTrayCode.setRelatStatus("0"); + wmsProductPutTrayCodeMapper.updateWmsProductPutTrayCode(wmsProductPutTrayCode); + } + //todo 出库完成之后,减库存——根据产品编码和库位编码减库存 + ValueOperations opsForValue = redisTemplate.opsForValue(); + String deliveryOrder = opsForValue.get("deliveryOrder"); + String productCode = opsForValue.get("productCode"); + for (WmsSellOutTray wmsSellOutTray : wmsSellOutTrays) { + //根据产品编码和库位号查询主表 + WmsFpStorageNews wmsFpStorageNews = wmsFpStorageNewsMapper.selectWmsFpStorageNewsByProductCodeAndWlCode(productCode, wmsSellOutTray.getWlCode()); + if (ObjectUtils.isEmpty(wmsFpStorageNews)) { + throw new ServiceException("该产品没有库存!"); + }else { + BigDecimal outQuantity = new BigDecimal("1"); + wmsFpStorageNews.setAmount(wmsFpStorageNews.getAmount().subtract(outQuantity)); + wmsFpStorageNewsMapper.updateWmsFpStorageNews(wmsFpStorageNews); + } + } +// ValueOperations opsForValue = redisTemplate.opsForValue(); +// String deliveryOrder = opsForValue.get("deliveryOrder"); +// String productCode = opsForValue.get("productCode"); +// WmsFpStorageNews wmsFpStorageNews = wmsFpStorageNewsMapper.selectWmsFpStorageNewsByProductCode(productCode); +// WmsSellOutEmbryo wmsSellOutEmbryo = wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder,productCode); +// if (ObjectUtils.isEmpty(wmsFpStorageNews)) { +// throw new ServiceException("该产品没有库存!"); +// }if (wmsFpStorageNews.getAmount().intValue()<=0 || wmsFpStorageNews.getAmount().intValue() selectWmsSellOutTraysByIDAndCode(String deliveryOrder, String productCode) { + //todo 需要修改 + DynamicDataSourceContextHolder.push("ds_1000"); + return wmsSellOutTrayMapper.selectWmsSellOutTraysByDeliveryOrderAndProductCode(deliveryOrder,productCode); + } + + /** + * 根据箱码删除接口 + * @param barcode + * @return + */ + @Override + public int deleteWmsSellOutTrayByBarcode(String barcode) { + //todo 需要修改 + DynamicDataSourceContextHolder.push("ds_1000"); + return wmsSellOutTrayMapper.deleteWmsSellOutTrayByBarcode(barcode); + } +} diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml new file mode 100644 index 00000000..23bcc748 --- /dev/null +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutEmbryoMapper.xml @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, delivery_order, Item_number, factory_code, wh_code, wa_code, wl_code, delivery_place, product_name, product_code, product_sort, specification, unit_of_measure, lot_number, plan_quantity, out_quantity, status, SAP_status, SAP_proof, SAP_message, out_date, attr1, attr2, attr3, attr4, attr5, attr6, attr7, attr8, attr9, attr10, create_by, create_time, update_by, update_time, remark from wms_sell_out_embryo + + + + + + + + + + + + + insert into wms_sell_out_embryo + + id, + delivery_order, + Item_number, + factory_code, + wh_code, + wa_code, + wl_code, + delivery_place, + product_name, + product_code, + product_sort, + specification, + unit_of_measure, + lot_number, + plan_quantity, + out_quantity, + status, + SAP_status, + SAP_proof, + SAP_message, + out_date, + attr1, + attr2, + attr3, + attr4, + attr5, + attr6, + attr7, + attr8, + attr9, + attr10, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{id}, + #{deliveryOrder}, + #{itemNumber}, + #{factoryCode}, + #{whCode}, + #{waCode}, + #{wlCode}, + #{deliveryPlace}, + #{productName}, + #{productCode}, + #{productSort}, + #{specification}, + #{unitOfMeasure}, + #{lotNumber}, + #{planQuantity}, + #{outQuantity}, + #{status}, + #{sapStatus}, + #{sapProof}, + #{sapMessage}, + #{outDate}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{attr5}, + #{attr6}, + #{attr7}, + #{attr8}, + #{attr9}, + #{attr10}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update wms_sell_out_embryo + + delivery_order = #{deliveryOrder}, + Item_number = #{itemNumber}, + factory_code = #{factoryCode}, + wh_code = #{whCode}, + wa_code = #{waCode}, + wl_code = #{wlCode}, + delivery_place = #{deliveryPlace}, + product_name = #{productName}, + product_code = #{productCode}, + product_sort = #{productSort}, + specification = #{specification}, + unit_of_measure = #{unitOfMeasure}, + lot_number = #{lotNumber}, + plan_quantity = #{planQuantity}, + out_quantity = #{outQuantity}, + status = #{status}, + SAP_status = #{sapStatus}, + SAP_proof = #{sapProof}, + SAP_message = #{sapMessage}, + out_date = #{outDate}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + attr5 = #{attr5}, + attr6 = #{attr6}, + attr7 = #{attr7}, + attr8 = #{attr8}, + attr9 = #{attr9}, + attr10 = #{attr10}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from wms_sell_out_embryo where id = #{id} + + + + delete from wms_sell_out_embryo where id in + + #{id} + + + \ No newline at end of file diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutTrayMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutTrayMapper.xml new file mode 100644 index 00000000..d87cc40e --- /dev/null +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsSellOutTrayMapper.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, delivery_order, factory_code, wh_code, wa_code, wl_code, product_name, product_code, product_sort, sn, barcode, lot_number, user_defined2, user_defined3, user_defined4, user_defined5, user_defined6, user_defined7, user_defined8, create_by, create_time, update_by, update_time from wms_sell_out_tray + + + + + + + + + + insert into wms_sell_out_tray + + id, + delivery_order, + factory_code, + wh_code, + wa_code, + wl_code, + product_name, + product_code, + product_sort, + sn, + barcode, + lot_number, + user_defined2, + user_defined3, + user_defined4, + user_defined5, + user_defined6, + user_defined7, + user_defined8, + create_by, + create_time, + update_by, + update_time, + + + #{id}, + #{deliveryOrder}, + #{factoryCode}, + #{whCode}, + #{waCode}, + #{wlCode}, + #{productName}, + #{productCode}, + #{productSort}, + #{sn}, + #{barcode}, + #{lotNumber}, + #{userDefined2}, + #{userDefined3}, + #{userDefined4}, + #{userDefined5}, + #{userDefined6}, + #{userDefined7}, + #{userDefined8}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wms_sell_out_tray + + delivery_order = #{deliveryOrder}, + factory_code = #{factoryCode}, + wh_code = #{whCode}, + wa_code = #{waCode}, + wl_code = #{wlCode}, + product_name = #{productName}, + product_code = #{productCode}, + product_sort = #{productSort}, + sn = #{sn}, + barcode = #{barcode}, + lot_number = #{lotNumber}, + user_defined2 = #{userDefined2}, + user_defined3 = #{userDefined3}, + user_defined4 = #{userDefined4}, + user_defined5 = #{userDefined5}, + user_defined6 = #{userDefined6}, + user_defined7 = #{userDefined7}, + user_defined8 = #{userDefined8}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from wms_sell_out_tray where id = #{id} + + + + delete from wms_sell_out_tray where id in + + #{id} + + + + + delete from wms_sell_out_tray where barcode = #{barcode} + + \ No newline at end of file