| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.transaction.Transactional;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.goods.CommonGoodsMapper;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class CommonGoodsServiceImpl implements CommonGoodsService {
|
| | |
| | | return commonGoodsMapper.selectByGoodsIdAndGoodsType(goodsId, goodsType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void updateBatchCommonGoods(List<CommonGoods> listCommonGoods) {
|
| | | |
| | | if (listCommonGoods == null || listCommonGoods.size() == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | | for (CommonGoods commonGoods: listCommonGoods) {
|
| | | try {
|
| | | updateCommonGoods(commonGoods);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | @Transactional
|
| | | public void addBatchCommonGoods(List<CommonGoods> listCommonGoods) {
|
| | | |
| | | if (listCommonGoods == null || listCommonGoods.size() == 0) {
|
| | | return;
|
| | | }
|
| | | |
| | | for (CommonGoods commonGoods: listCommonGoods) {
|
| | | try {
|
| | | addCommonGoods(commonGoods);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|