| | |
| | | BaseGoods goods = new BaseGoods(); |
| | | goods.setBaseDataId(data.getId()); |
| | | goods.setIsdeleted(Constants.ZERO); |
| | | if(baseGoodsMapper.selectCount(new QueryWrapper<>(goods)) >0){ |
| | | //如果已经存在,逻辑删除旧的商品数据 |
| | | UpdateWrapper<BaseGoods> updateModel = new UpdateWrapper<>(); |
| | | updateModel.lambda().set(BaseGoods::getIsdeleted,Constants.ONE); |
| | | updateModel.lambda().set(BaseGoods::getEditDate, new Date()); |
| | | updateModel.lambda().eq(BaseGoods::getBaseDataId, data.getId()); |
| | | baseGoodsMapper.update(null, updateModel); |
| | | } |
| | | goods.setCreateDate(date); |
| | | goods.setName(StringUtils.defaultString(data.getName(),data.getTitle())); |
| | | goods.setRemark(data.getTitle()); |