超市售卖商品绑定门店
This commit is contained in:
@ -40,4 +40,7 @@ public class StoreSaleGoodsDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String equipmentCode;
|
private String equipmentCode;
|
||||||
|
|
||||||
|
|
||||||
|
private Long carteenId;
|
||||||
|
|
||||||
}
|
}
|
@ -26,7 +26,7 @@ public interface StoreGoodsMapper extends BaseMapperX<StoreGoodsDO> {
|
|||||||
.eqIfPresent(StoreGoodsDO::getEquipmentCode, reqVO.getEquipmentCode())
|
.eqIfPresent(StoreGoodsDO::getEquipmentCode, reqVO.getEquipmentCode())
|
||||||
.betweenIfPresent(StoreGoodsDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(StoreGoodsDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.inIfPresent(StoreGoodsDO::getGoodsId, reqVO.getIds())
|
.inIfPresent(StoreGoodsDO::getGoodsId, reqVO.getIds())
|
||||||
.orderByDesc(StoreGoodsDO::getCategoryId));
|
.orderByDesc(StoreGoodsDO::getGoodsId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.store.dto.StoreGoodsDto;
|
import cn.iocoder.yudao.module.member.controller.app.store.dto.StoreGoodsDto;
|
||||||
import cn.iocoder.yudao.module.member.controller.app.store.dto.StoreSaleGoodsDto;
|
import cn.iocoder.yudao.module.member.controller.app.store.dto.StoreSaleGoodsDto;
|
||||||
|
import cn.iocoder.yudao.module.system.api.cashregisterinfo.CashregisterinfoApi;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -36,6 +37,8 @@ public class StoreSaleGoodsServiceImpl implements StoreSaleGoodsService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private StoreSaleGoodsMapper storeSaleGoodsMapper;
|
private StoreSaleGoodsMapper storeSaleGoodsMapper;
|
||||||
|
@Resource
|
||||||
|
private CashregisterinfoApi cashregisterinfoApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createStoreSaleGoods(StoreSaleGoodsSaveReqVO createReqVO) {
|
public Long createStoreSaleGoods(StoreSaleGoodsSaveReqVO createReqVO) {
|
||||||
@ -88,10 +91,12 @@ public class StoreSaleGoodsServiceImpl implements StoreSaleGoodsService {
|
|||||||
//清空
|
//清空
|
||||||
storeSaleGoodsMapper.delete(new LambdaQueryWrapper<StoreSaleGoodsDO>().eq(StoreSaleGoodsDO::getEquipmentCode, dto.getEquipmentCode()));
|
storeSaleGoodsMapper.delete(new LambdaQueryWrapper<StoreSaleGoodsDO>().eq(StoreSaleGoodsDO::getEquipmentCode, dto.getEquipmentCode()));
|
||||||
ArrayList<StoreSaleGoodsDO> list = new ArrayList<>();
|
ArrayList<StoreSaleGoodsDO> list = new ArrayList<>();
|
||||||
|
Long storeId = cashregisterinfoApi.getStoreId(dto.getEquipmentCode());
|
||||||
for (StoreGoodsDto storeGoodsDto : dto.getEquipmentGoodsCustoms()) {
|
for (StoreGoodsDto storeGoodsDto : dto.getEquipmentGoodsCustoms()) {
|
||||||
StoreSaleGoodsDO storeSaleGoodsDO = new StoreSaleGoodsDO();
|
StoreSaleGoodsDO storeSaleGoodsDO = new StoreSaleGoodsDO();
|
||||||
BeanUtil.copyProperties(storeGoodsDto, storeSaleGoodsDO);
|
BeanUtil.copyProperties(storeGoodsDto, storeSaleGoodsDO);
|
||||||
storeSaleGoodsDO.setEquipmentCode(dto.getEquipmentCode());
|
storeSaleGoodsDO.setEquipmentCode(dto.getEquipmentCode());
|
||||||
|
storeSaleGoodsDO.setCarteenId(storeId);
|
||||||
list.add(storeSaleGoodsDO);
|
list.add(storeSaleGoodsDO);
|
||||||
}
|
}
|
||||||
return storeSaleGoodsMapper.insertBatch(list);
|
return storeSaleGoodsMapper.insertBatch(list);
|
||||||
|
@ -4,6 +4,6 @@ public interface CashregisterinfoApi {
|
|||||||
|
|
||||||
String getStoreName(String equipmentCode);
|
String getStoreName(String equipmentCode);
|
||||||
|
|
||||||
|
Long getStoreId(String equipmentCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,4 +29,14 @@ public class CashregisterinfoApiImpl implements CashregisterinfoApi{
|
|||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getStoreId(String equipmentCode) {
|
||||||
|
List<CashRegisterInfoDO> cashRegisterInfoDOS = cashRegisterInfoMapper.selectList(Wrappers.<CashRegisterInfoDO>lambdaQuery().eq(CashRegisterInfoDO::getEquipmentCode, equipmentCode));
|
||||||
|
if(CollectionUtil.isNotEmpty(cashRegisterInfoDOS)){
|
||||||
|
CashRegisterInfoDO cashRegisterInfoDO = cashRegisterInfoDOS.get(0);
|
||||||
|
return cashRegisterInfoDO.getCarteenId();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user