|
|
@ -1,4 +1,4 @@ |
|
|
|
package com.yxt.warehouse.biz.wmsinventoryallocatebill; |
|
|
|
package com.yxt.warehouse.biz.warehouseinventoryallocatebill; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
@ -10,9 +10,9 @@ import com.yxt.common.base.utils.StringUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import com.yxt.warehouse.biz.wmsinventoryallocatebilldetail.WmsInventoryAllocateBillDetailDtoNew; |
|
|
|
import com.yxt.warehouse.biz.wmsinventoryallocatebilldetail.WmsInventoryAllocateBillDetailService; |
|
|
|
import com.yxt.warehouse.biz.wmsinventoryallocatebilldetail.WmsInventoryAllocatebillDetailDetailsVoNew; |
|
|
|
import com.yxt.warehouse.biz.warehouseinventoryallocatebilldetail.WarehouseInventoryAllocatebillDetailDtoNew; |
|
|
|
import com.yxt.warehouse.biz.warehouseinventoryallocatebilldetail.WarehouseInventoryAllocatebillDetailService; |
|
|
|
import com.yxt.warehouse.biz.warehouseinventoryallocatebilldetail.WarehouseInventoryAllocatebillDetailDetailsVoNew; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -23,33 +23,33 @@ import java.util.List; |
|
|
|
* @date 2024/2/26 13:40 |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInventoryAllocateBillMapper, WmsInventoryAllocateBill> { |
|
|
|
public class WarehouseInventoryAllocatebillService extends MybatisBaseService<WarehouseInventoryAllocatebillMapper, WarehouseInventoryAllocatebill> { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WmsInventoryAllocateBillDetailService wmsInventoryAllocateBillDetailService; |
|
|
|
private WarehouseInventoryAllocatebillDetailService wmsInventoryAllocateBillDetailService; |
|
|
|
|
|
|
|
public ResultBean<PagerVo<WmsInventoryAllocateBillVo>> listPage(PagerQuery<WmsInventoryAllocateBillQuery> pq) { |
|
|
|
public ResultBean<PagerVo<WarehouseInventoryAllocatebillVo>> listPage(PagerQuery<WarehouseInventoryAllocatebillQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
WmsInventoryAllocateBillQuery query = pq.getParams(); |
|
|
|
QueryWrapper<WmsInventoryAllocateBill> qw = new QueryWrapper<>(); |
|
|
|
WarehouseInventoryAllocatebillQuery query = pq.getParams(); |
|
|
|
QueryWrapper<WarehouseInventoryAllocatebill> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.like("rackName", query.getName()); |
|
|
|
} |
|
|
|
|
|
|
|
IPage<WmsInventoryAllocateBill> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<WmsInventoryAllocateBillVo> pagging = baseMapper.listPage(page, qw); |
|
|
|
PagerVo<WmsInventoryAllocateBillVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
List<WmsInventoryAllocateBillVo> records = pagging.getRecords(); |
|
|
|
IPage<WarehouseInventoryAllocatebill> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<WarehouseInventoryAllocatebillVo> pagging = baseMapper.listPage(page, qw); |
|
|
|
PagerVo<WarehouseInventoryAllocatebillVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
List<WarehouseInventoryAllocatebillVo> records = pagging.getRecords(); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public PagerVo<WmsInventoryAllocateBillVoNew> listPageVo(PagerQuery<WmsInventoryAllocateBillQueryNew> pq) { |
|
|
|
WmsInventoryAllocateBillQueryNew query = pq.getParams(); |
|
|
|
QueryWrapper<WmsInventoryAllocateBill> qw = new QueryWrapper<>(); |
|
|
|
IPage<WmsInventoryAllocateBill> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<WmsInventoryAllocateBillVoNew> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<WmsInventoryAllocateBillVoNew> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
public PagerVo<WarehouseInventoryAllocatebillVoNew> listPageVo(PagerQuery<WarehouseInventoryAllocatebillQueryNew> pq) { |
|
|
|
WarehouseInventoryAllocatebillQueryNew query = pq.getParams(); |
|
|
|
QueryWrapper<WarehouseInventoryAllocatebill> qw = new QueryWrapper<>(); |
|
|
|
IPage<WarehouseInventoryAllocatebill> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<WarehouseInventoryAllocatebillVoNew> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<WarehouseInventoryAllocatebillVoNew> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
@ -80,9 +80,9 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<WmsInventoryAllocateBill> outWarehousing(WmsInventoryAllocateBillDto dto) { |
|
|
|
public ResultBean<WarehouseInventoryAllocatebill> outWarehousing(WarehouseInventoryAllocatebillDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
WmsInventoryAllocateBill wmsInventory = baseMapper.selectOne(new QueryWrapper<WmsInventoryAllocateBill>().eq("goodsSid", dto.getGoodsSid()).eq("warehouseSid", dto.getWarehouseSid())); |
|
|
|
WarehouseInventoryAllocatebill wmsInventory = baseMapper.selectOne(new QueryWrapper<WarehouseInventoryAllocatebill>().eq("goodsSid", dto.getGoodsSid()).eq("warehouseSid", dto.getWarehouseSid())); |
|
|
|
double exisInventory = Double.valueOf(wmsInventory.getCount()); |
|
|
|
double out = Double.valueOf(dto.getCount()); |
|
|
|
if (null == wmsInventory) { |
|
|
@ -96,16 +96,16 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven |
|
|
|
return rb.success().setData(wmsInventory); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<String> saveOrUpdate(WmsInventoryAllocateBillDto dto) { |
|
|
|
public ResultBean<String> saveOrUpdate(WarehouseInventoryAllocatebillDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String sid = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getSid())) { |
|
|
|
sid = dto.getSid(); |
|
|
|
WmsInventoryAllocateBill wmsWarehouseRack = fetchBySid(dto.getSid()); |
|
|
|
WarehouseInventoryAllocatebill wmsWarehouseRack = fetchBySid(dto.getSid()); |
|
|
|
BeanUtil.copyProperties(dto, wmsWarehouseRack, "id", "sid"); |
|
|
|
baseMapper.updateById(wmsWarehouseRack); |
|
|
|
} else { |
|
|
|
WmsInventoryAllocateBill wmsWarehouseRack = new WmsInventoryAllocateBill(); |
|
|
|
WarehouseInventoryAllocatebill wmsWarehouseRack = new WarehouseInventoryAllocatebill(); |
|
|
|
sid = wmsWarehouseRack.getSid(); |
|
|
|
BeanUtil.copyProperties(dto, wmsWarehouseRack, "id", "sid"); |
|
|
|
wmsWarehouseRack.setCreateTime(new DateTime()); |
|
|
@ -114,16 +114,16 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven |
|
|
|
return rb.success().setMsg("成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<WmsInventoryAllocateBillVo> initialization(String sid) { |
|
|
|
public ResultBean<WarehouseInventoryAllocatebillVo> initialization(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
WmsInventoryAllocateBillVo vo = baseMapper.initialization(sid); |
|
|
|
WarehouseInventoryAllocatebillVo vo = baseMapper.initialization(sid); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean delete(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
WmsInventoryAllocateBill wmsWarehouseRack = fetchBySid(sid); |
|
|
|
WarehouseInventoryAllocatebill wmsWarehouseRack = fetchBySid(sid); |
|
|
|
if (null != wmsWarehouseRack) { |
|
|
|
baseMapper.deleteById(wmsWarehouseRack.getId()); |
|
|
|
} |
|
|
@ -132,7 +132,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven |
|
|
|
|
|
|
|
public ResultBean updateIsEnable(String sid, String isEnable) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
WmsInventoryAllocateBill wmsWarehouseRack = fetchBySid(sid); |
|
|
|
WarehouseInventoryAllocatebill wmsWarehouseRack = fetchBySid(sid); |
|
|
|
if (null != wmsWarehouseRack) { |
|
|
|
wmsWarehouseRack.setIsEnable(Integer.parseInt(isEnable)); |
|
|
|
baseMapper.updateById(wmsWarehouseRack); |
|
|
@ -140,11 +140,11 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven |
|
|
|
return rb.success().setMsg("成功"); |
|
|
|
} |
|
|
|
|
|
|
|
public WmsInventoryAllocateBillDetailsVoNew fetchDetailsVoBySid(String sid) { |
|
|
|
WmsInventoryAllocateBill entity = fetchBySid(sid); |
|
|
|
WmsInventoryAllocateBillDetailsVoNew vo = new WmsInventoryAllocateBillDetailsVoNew(); |
|
|
|
public WarehouseInventoryAllocatebillDetailsVoNew fetchDetailsVoBySid(String sid) { |
|
|
|
WarehouseInventoryAllocatebill entity = fetchBySid(sid); |
|
|
|
WarehouseInventoryAllocatebillDetailsVoNew vo = new WarehouseInventoryAllocatebillDetailsVoNew(); |
|
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
|
List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(sid); |
|
|
|
List<WarehouseInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(sid); |
|
|
|
vo.setWmsInventoryAllocateBillDetailNewList(wmsInventoryAllocatebillDetailDetailsVoNews); |
|
|
|
return vo; |
|
|
|
} |
|
|
@ -156,12 +156,12 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void saveOrUpdateDto(WmsInventoryAllocateBillDtoNew dto) { |
|
|
|
public void saveOrUpdateDto(WarehouseInventoryAllocatebillDtoNew dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
List<WmsInventoryAllocateBillDetailDtoNew> wmsInventoryAllocateBillDetailNewList = dto.getWmsInventoryAllocateBillDetailNewList(); |
|
|
|
List<WarehouseInventoryAllocatebillDetailDtoNew> wmsInventoryAllocateBillDetailNewList = dto.getWmsInventoryAllocateBillDetailNewList(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
String sid = this.insertByDto(dto); |
|
|
|
for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) { |
|
|
|
for (WarehouseInventoryAllocatebillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) { |
|
|
|
wmsInventoryAllocateBillDetailDtoNew.setBillSid(sid); |
|
|
|
wmsInventoryAllocateBillDetailService.saveOrUpdateDto(wmsInventoryAllocateBillDetailDtoNew); |
|
|
|
} |
|
|
@ -169,27 +169,27 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven |
|
|
|
} |
|
|
|
this.updateByDto(dto); |
|
|
|
wmsInventoryAllocateBillDetailService.delByMainSid(dtoSid); |
|
|
|
for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) { |
|
|
|
for (WarehouseInventoryAllocatebillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) { |
|
|
|
wmsInventoryAllocateBillDetailDtoNew.setBillSid(dtoSid); |
|
|
|
wmsInventoryAllocateBillDetailService.saveOrUpdateDto(wmsInventoryAllocateBillDetailDtoNew); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public String insertByDto(WmsInventoryAllocateBillDtoNew dto) { |
|
|
|
WmsInventoryAllocateBill entity = new WmsInventoryAllocateBill(); |
|
|
|
public String insertByDto(WarehouseInventoryAllocatebillDtoNew dto) { |
|
|
|
WarehouseInventoryAllocatebill entity = new WarehouseInventoryAllocatebill(); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
baseMapper.insert(entity); |
|
|
|
return entity.getSid(); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateByDto(WmsInventoryAllocateBillDtoNew dto) { |
|
|
|
public void updateByDto(WarehouseInventoryAllocatebillDtoNew dto) { |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void allocation(WmsInventoryAllocateBillDtoNew dto) { |
|
|
|
public void allocation(WarehouseInventoryAllocatebillDtoNew dto) { |
|
|
|
|
|
|
|
} |
|
|
|
} |