成品销售出库

highway
chj 2 years ago
parent 0e36fc75a6
commit 63550d6dce

@ -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<WmsSellOutEmbryo> 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<WmsSellOutEmbryo> list = wmsSellOutEmbryoService.selectWmsSellOutEmbryoList(wmsSellOutEmbryo);
ExcelUtil<WmsSellOutEmbryo> util = new ExcelUtil<WmsSellOutEmbryo>(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));
}
}

@ -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<String,String> redisTemplate;
/**
*
*/
@RequiresPermissions("wms:selloutconntray:list")
@GetMapping("/list")
public TableDataInfo list(WmsSellOutTray wmsSellOutTray) {
startPage();
List<WmsSellOutTray> 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<WmsSellOutTray> list = wmsSellOutTrayService.selectWmsSellOutTrayList(wmsSellOutTray);
ExcelUtil<WmsSellOutTray> util = new ExcelUtil<WmsSellOutTray>(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<WmsSellOutTray> wmsSellOutTrays,@PathVariable("number") Long number){
ValueOperations<String, String> 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));
}
}

@ -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<WmsSellOutEmbryo> 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<WmsSellOutEmbryo> selectWmsSellOutEmbryoByDeliveryOrder(String deliveryOrder);
/**
*
* @param deliveryOrder
* @param productCode
* @return
*/
public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(@Param("deliveryOrder") String deliveryOrder,@Param("productCode") String productCode);
}

@ -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<WmsSellOutTray> 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<WmsSellOutTray> selectWmsSellOutTraysByDeliveryOrderAndProductCode(@Param("deliveryOrder") String deliveryOrder,@Param("productCode") String productCode);
/**
*
* @param barcode
* @return
*/
public int deleteWmsSellOutTrayByBarcode(String barcode);
}

@ -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<WmsSellOutEmbryo> 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<WmsSellOutEmbryo> selectWmsSellOutEmbryoByDeliveryOrder(String deliveryOrder);
/**
*
* @param deliveryOrder
* @param productCode
* @return
*/
public WmsSellOutEmbryo selectWmsSellOutEmbryoByOrderCodeAndProductCode(String deliveryOrder,String productCode);
}

@ -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<WmsSellOutTray> 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<WmsSellOutTray> wmsSellOutTrays);
/**
*
* @param deliveryOrder
* @param productCode
* @return
*/
public List<WmsSellOutTray> selectWmsSellOutTraysByIDAndCode(String deliveryOrder,String productCode);
/**
*
* @param barcode
* @return
*/
public int deleteWmsSellOutTrayByBarcode(String barcode);
}

@ -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<String,String> 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<WmsSellOutEmbryo> 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<WmsSellOutEmbryo> 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<String, String> opsForValue = redisTemplate.opsForValue();
opsForValue.set("deliveryOrder",deliveryOrder);
opsForValue.set("productCode",productCode);
return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoByOrderCodeAndProductCode(deliveryOrder,productCode);
}
}

@ -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<String,String> 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<WmsSellOutTray> 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<String, String> 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<WmsSellOutTray> 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<String, String> 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<String, String> 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()<wmsSellOutEmbryo.getOutQuantity()){
// throw new ServiceException("该产品库存不足!");
// } else {
// BigDecimal outQuantity = new BigDecimal(wmsSellOutEmbryo.getOutQuantity());
// wmsFpStorageNews.setAmount(wmsFpStorageNews.getAmount().subtract(outQuantity));
// wmsFpStorageNewsMapper.updateWmsFpStorageNews(wmsFpStorageNews);
// }
//todo 对库存明细修改
for (WmsSellOutTray wmsSellOutTray : wmsSellOutTrays) {
WmsProductPutTrayCode wmsProductPutTrayCode = wmsProductPutTrayCodeMapper.selectWmsProductPutTrayCodeByBarcode(wmsSellOutTray.getBarcode());
WmsFpStorageNewsSn wmsFpStorageNewsSn = wmsFpStorageNewsSnMapper.selectWmsFpStorageNewsSnBySnAndProductCodeAndWlCode(productCode,wmsProductPutTrayCode.getSn(),wmsSellOutTray.getWlCode());
//todo 对托盘上的箱数-1
BigDecimal bigDecimal = new BigDecimal("1");
wmsFpStorageNewsSn.setAmount(wmsFpStorageNewsSn.getAmount().subtract(bigDecimal));
wmsFpStorageNewsSnMapper.updateWmsFpStorageNewsSn(wmsFpStorageNewsSn);
}
redisTemplate.delete("deliveryOrder");
redisTemplate.delete("productCode");
return 1;
}
/**
*
* @param deliveryOrder
* @param productCode
* @return
*/
@Override
// @DS("#header.poolName")
public List<WmsSellOutTray> 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);
}
}

@ -0,0 +1,241 @@
<?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.op.wms.mapper.WmsSellOutEmbryoMapper">
<resultMap type="WmsSellOutEmbryo" id="WmsSellOutEmbryoResult">
<result property="id" column="id" />
<result property="deliveryOrder" column="delivery_order" />
<result property="itemNumber" column="Item_number" />
<result property="factoryCode" column="factory_code" />
<result property="whCode" column="wh_code" />
<result property="waCode" column="wa_code" />
<result property="wlCode" column="wl_code" />
<result property="deliveryPlace" column="delivery_place" />
<result property="productName" column="product_name" />
<result property="productCode" column="product_code" />
<result property="productSort" column="product_sort" />
<result property="specification" column="specification" />
<result property="unitOfMeasure" column="unit_of_measure" />
<result property="lotNumber" column="lot_number" />
<result property="planQuantity" column="plan_quantity" />
<result property="outQuantity" column="out_quantity" />
<result property="status" column="status" />
<result property="sapStatus" column="SAP_status" />
<result property="sapProof" column="SAP_proof" />
<result property="sapMessage" column="SAP_message" />
<result property="outDate" column="out_date" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="attr5" column="attr5" />
<result property="attr6" column="attr6" />
<result property="attr7" column="attr7" />
<result property="attr8" column="attr8" />
<result property="attr9" column="attr9" />
<result property="attr10" column="attr10" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectWmsSellOutEmbryoVo">
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
</sql>
<select id="selectWmsSellOutEmbryoList" parameterType="WmsSellOutEmbryo" resultMap="WmsSellOutEmbryoResult">
<include refid="selectWmsSellOutEmbryoVo"/>
<where>
<if test="deliveryOrder != null and deliveryOrder != ''"> and delivery_order = #{deliveryOrder}</if>
<if test="itemNumber != null and itemNumber != ''"> and Item_number = #{itemNumber}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
<if test="deliveryPlace != null and deliveryPlace != ''"> and delivery_place = #{deliveryPlace}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productSort != null and productSort != ''"> and product_sort = #{productSort}</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="lotNumber != null and lotNumber != ''"> and lot_number = #{lotNumber}</if>
<if test="planQuantity != null "> and plan_quantity = #{planQuantity}</if>
<if test="outQuantity != null "> and out_quantity = #{outQuantity}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="sapStatus != null and sapStatus != ''"> and SAP_status = #{sapStatus}</if>
<if test="sapProof != null and sapProof != ''"> and SAP_proof = #{sapProof}</if>
<if test="sapMessage != null and sapMessage != ''"> and SAP_message = #{sapMessage}</if>
<if test="outDate != null "> and out_date = #{outDate}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
<if test="attr5 != null and attr5 != ''"> and attr5 = #{attr5}</if>
<if test="attr6 != null and attr6 != ''"> and attr6 = #{attr6}</if>
<if test="attr7 != null and attr7 != ''"> and attr7 = #{attr7}</if>
<if test="attr8 != null and attr8 != ''"> and attr8 = #{attr8}</if>
<if test="attr9 != null and attr9 != ''"> and attr9 = #{attr9}</if>
<if test="attr10 != null and attr10 != ''"> and attr10 = #{attr10}</if>
</where>
</select>
<select id="selectWmsSellOutEmbryoById" parameterType="String" resultMap="WmsSellOutEmbryoResult">
<include refid="selectWmsSellOutEmbryoVo"/>
where id = #{id}
</select>
<!-- 根据订单号和产品编码查询-->
<select id="selectWmsSellOutEmbryoByOrderCodeAndProductCode"
resultMap="WmsSellOutEmbryoResult">
SELECT
id,product_name,Item_number,factory_code,wh_code,wa_code,wl_code,delivery_place,
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
WHERE
delivery_order = #{deliveryOrder} AND product_code = #{productCode}
</select>
<!-- 根据备货单号查询下面的产品编码-->
<select id="selectWmsSellOutEmbryoByDeliveryOrder" resultMap="WmsSellOutEmbryoResult">
select product_name,product_code from wms_sell_out_embryo where delivery_order = #{deliveryOrder}
</select>
<insert id="insertWmsSellOutEmbryo" parameterType="WmsSellOutEmbryo">
insert into wms_sell_out_embryo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deliveryOrder != null">delivery_order,</if>
<if test="itemNumber != null">Item_number,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="whCode != null">wh_code,</if>
<if test="waCode != null">wa_code,</if>
<if test="wlCode != null">wl_code,</if>
<if test="deliveryPlace != null">delivery_place,</if>
<if test="productName != null">product_name,</if>
<if test="productCode != null">product_code,</if>
<if test="productSort != null">product_sort,</if>
<if test="specification != null">specification,</if>
<if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="lotNumber != null">lot_number,</if>
<if test="planQuantity != null">plan_quantity,</if>
<if test="outQuantity != null">out_quantity,</if>
<if test="status != null">status,</if>
<if test="sapStatus != null">SAP_status,</if>
<if test="sapProof != null">SAP_proof,</if>
<if test="sapMessage != null">SAP_message,</if>
<if test="outDate != null">out_date,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="attr5 != null">attr5,</if>
<if test="attr6 != null">attr6,</if>
<if test="attr7 != null">attr7,</if>
<if test="attr8 != null">attr8,</if>
<if test="attr9 != null">attr9,</if>
<if test="attr10 != null">attr10,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deliveryOrder != null">#{deliveryOrder},</if>
<if test="itemNumber != null">#{itemNumber},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="whCode != null">#{whCode},</if>
<if test="waCode != null">#{waCode},</if>
<if test="wlCode != null">#{wlCode},</if>
<if test="deliveryPlace != null">#{deliveryPlace},</if>
<if test="productName != null">#{productName},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productSort != null">#{productSort},</if>
<if test="specification != null">#{specification},</if>
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="lotNumber != null">#{lotNumber},</if>
<if test="planQuantity != null">#{planQuantity},</if>
<if test="outQuantity != null">#{outQuantity},</if>
<if test="status != null">#{status},</if>
<if test="sapStatus != null">#{sapStatus},</if>
<if test="sapProof != null">#{sapProof},</if>
<if test="sapMessage != null">#{sapMessage},</if>
<if test="outDate != null">#{outDate},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="attr5 != null">#{attr5},</if>
<if test="attr6 != null">#{attr6},</if>
<if test="attr7 != null">#{attr7},</if>
<if test="attr8 != null">#{attr8},</if>
<if test="attr9 != null">#{attr9},</if>
<if test="attr10 != null">#{attr10},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateWmsSellOutEmbryo" parameterType="WmsSellOutEmbryo">
update wms_sell_out_embryo
<trim prefix="SET" suffixOverrides=",">
<if test="deliveryOrder != null">delivery_order = #{deliveryOrder},</if>
<if test="itemNumber != null">Item_number = #{itemNumber},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="whCode != null">wh_code = #{whCode},</if>
<if test="waCode != null">wa_code = #{waCode},</if>
<if test="wlCode != null">wl_code = #{wlCode},</if>
<if test="deliveryPlace != null">delivery_place = #{deliveryPlace},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productSort != null">product_sort = #{productSort},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="lotNumber != null">lot_number = #{lotNumber},</if>
<if test="planQuantity != null">plan_quantity = #{planQuantity},</if>
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
<if test="status != null">status = #{status},</if>
<if test="sapStatus != null">SAP_status = #{sapStatus},</if>
<if test="sapProof != null">SAP_proof = #{sapProof},</if>
<if test="sapMessage != null">SAP_message = #{sapMessage},</if>
<if test="outDate != null">out_date = #{outDate},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="attr5 != null">attr5 = #{attr5},</if>
<if test="attr6 != null">attr6 = #{attr6},</if>
<if test="attr7 != null">attr7 = #{attr7},</if>
<if test="attr8 != null">attr8 = #{attr8},</if>
<if test="attr9 != null">attr9 = #{attr9},</if>
<if test="attr10 != null">attr10 = #{attr10},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWmsSellOutEmbryoById" parameterType="String">
delete from wms_sell_out_embryo where id = #{id}
</delete>
<delete id="deleteWmsSellOutEmbryoByIds" parameterType="String">
delete from wms_sell_out_embryo where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,223 @@
<?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.op.wms.mapper.WmsSellOutTrayMapper">
<resultMap type="WmsSellOutTray" id="WmsSellOutTrayResult">
<result property="id" column="id" />
<result property="deliveryOrder" column="delivery_order" />
<result property="factoryCode" column="factory_code" />
<result property="whCode" column="wh_code" />
<result property="waCode" column="wa_code" />
<result property="wlCode" column="wl_code" />
<result property="productName" column="product_name" />
<result property="productCode" column="product_code" />
<result property="productSort" column="product_sort" />
<result property="sn" column="sn" />
<result property="barcode" column="barcode" />
<result property="lotNumber" column="lot_number" />
<result property="userDefined2" column="user_defined2" />
<result property="userDefined3" column="user_defined3" />
<result property="userDefined4" column="user_defined4" />
<result property="userDefined5" column="user_defined5" />
<result property="userDefined6" column="user_defined6" />
<result property="userDefined7" column="user_defined7" />
<result property="userDefined8" column="user_defined8" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWmsSellOutTrayVo">
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
</sql>
<select id="selectWmsSellOutTrayList" parameterType="WmsSellOutTray" resultMap="WmsSellOutTrayResult">
<include refid="selectWmsSellOutTrayVo"/>
<where>
<if test="deliveryOrder != null and deliveryOrder != ''"> and delivery_order = #{deliveryOrder}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="whCode != null and whCode != ''"> and wh_code = #{whCode}</if>
<if test="waCode != null and waCode != ''"> and wa_code = #{waCode}</if>
<if test="wlCode != null and wlCode != ''"> and wl_code = #{wlCode}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
<if test="productSort != null and productSort != ''"> and product_sort = #{productSort}</if>
<if test="sn != null and sn != ''"> and sn = #{sn}</if>
<if test="barcode != null and barcode != ''"> and barcode = #{barcode}</if>
<if test="lotNumber != null and lotNumber != ''"> and lot_number = #{lotNumber}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and user_defined2 = #{userDefined2}</if>
<if test="userDefined3 != null and userDefined3 != ''"> and user_defined3 = #{userDefined3}</if>
<if test="userDefined4 != null and userDefined4 != ''"> and user_defined4 = #{userDefined4}</if>
<if test="userDefined5 != null and userDefined5 != ''"> and user_defined5 = #{userDefined5}</if>
<if test="userDefined6 != null and userDefined6 != ''"> and user_defined6 = #{userDefined6}</if>
<if test="userDefined7 != null and userDefined7 != ''"> and user_defined7 = #{userDefined7}</if>
<if test="userDefined8 != null and userDefined8 != ''"> and user_defined8 = #{userDefined8}</if>
</where>
</select>
<select id="selectWmsSellOutTrayById" parameterType="String" resultMap="WmsSellOutTrayResult">
<include refid="selectWmsSellOutTrayVo"/>
where id = #{id}
</select>
<select id="selectWmsSellOutTrayByDeliveryOrderAndProductCode"
resultMap="WmsSellOutTrayResult">
SELECT
create_by,
create_time,
factory_code,
id,
lot_number,
product_name,
product_sort,
sn,
update_by,
update_time,
user_defined2,
user_defined3,
user_defined4,
user_defined5,
user_defined6,
user_defined7,
user_defined8,
wa_code,
wh_code,
wl_code
FROM
wms_sell_out_tray
WHERE
delivery_order = #{deliveryOrder} AND
product_code = #{productCode} and barcode=#{barcode}
</select>
<select id="selectWmsSellOutTraysByDeliveryOrderAndProductCode"
resultMap="WmsSellOutTrayResult">
SELECT
create_by,
create_time,
factory_code,
id,
lot_number,
product_name,
product_sort,
sn,
update_by,
update_time,
user_defined2,
user_defined3,
user_defined4,
user_defined5,
user_defined6,
user_defined7,
user_defined8,
wa_code,
wh_code,
wl_code,
barcode
FROM
wms_sell_out_tray
WHERE
delivery_order = #{deliveryOrder} AND
product_code = #{productCode}
</select>
<insert id="insertWmsSellOutTray" parameterType="WmsSellOutTray">
insert into wms_sell_out_tray
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="deliveryOrder != null">delivery_order,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="whCode != null">wh_code,</if>
<if test="waCode != null">wa_code,</if>
<if test="wlCode != null">wl_code,</if>
<if test="productName != null">product_name,</if>
<if test="productCode != null">product_code,</if>
<if test="productSort != null">product_sort,</if>
<if test="sn != null">sn,</if>
<if test="barcode != null">barcode,</if>
<if test="lotNumber != null">lot_number,</if>
<if test="userDefined2 != null">user_defined2,</if>
<if test="userDefined3 != null">user_defined3,</if>
<if test="userDefined4 != null">user_defined4,</if>
<if test="userDefined5 != null">user_defined5,</if>
<if test="userDefined6 != null">user_defined6,</if>
<if test="userDefined7 != null">user_defined7,</if>
<if test="userDefined8 != null">user_defined8,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="deliveryOrder != null">#{deliveryOrder},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="whCode != null">#{whCode},</if>
<if test="waCode != null">#{waCode},</if>
<if test="wlCode != null">#{wlCode},</if>
<if test="productName != null">#{productName},</if>
<if test="productCode != null">#{productCode},</if>
<if test="productSort != null">#{productSort},</if>
<if test="sn != null">#{sn},</if>
<if test="barcode != null">#{barcode},</if>
<if test="lotNumber != null">#{lotNumber},</if>
<if test="userDefined2 != null">#{userDefined2},</if>
<if test="userDefined3 != null">#{userDefined3},</if>
<if test="userDefined4 != null">#{userDefined4},</if>
<if test="userDefined5 != null">#{userDefined5},</if>
<if test="userDefined6 != null">#{userDefined6},</if>
<if test="userDefined7 != null">#{userDefined7},</if>
<if test="userDefined8 != null">#{userDefined8},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmsSellOutTray" parameterType="WmsSellOutTray">
update wms_sell_out_tray
<trim prefix="SET" suffixOverrides=",">
<if test="deliveryOrder != null">delivery_order = #{deliveryOrder},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="whCode != null">wh_code = #{whCode},</if>
<if test="waCode != null">wa_code = #{waCode},</if>
<if test="wlCode != null">wl_code = #{wlCode},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="productCode != null">product_code = #{productCode},</if>
<if test="productSort != null">product_sort = #{productSort},</if>
<if test="sn != null">sn = #{sn},</if>
<if test="barcode != null">barcode = #{barcode},</if>
<if test="lotNumber != null">lot_number = #{lotNumber},</if>
<if test="userDefined2 != null">user_defined2 = #{userDefined2},</if>
<if test="userDefined3 != null">user_defined3 = #{userDefined3},</if>
<if test="userDefined4 != null">user_defined4 = #{userDefined4},</if>
<if test="userDefined5 != null">user_defined5 = #{userDefined5},</if>
<if test="userDefined6 != null">user_defined6 = #{userDefined6},</if>
<if test="userDefined7 != null">user_defined7 = #{userDefined7},</if>
<if test="userDefined8 != null">user_defined8 = #{userDefined8},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWmsSellOutTrayById" parameterType="String">
delete from wms_sell_out_tray where id = #{id}
</delete>
<delete id="deleteWmsSellOutTrayByIds" parameterType="String">
delete from wms_sell_out_tray where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 根据箱码删除接口-->
<delete id="deleteWmsSellOutTrayByBarcode">
delete from wms_sell_out_tray where barcode = #{barcode}
</delete>
</mapper>
Loading…
Cancel
Save