yangdamao 2 anos atrás
pai
commit
e84c31d866

+ 1 - 1
zhongzheng-admin-store/src/main/java/com/zhongzheng/controller/store/GoodsController.java

@@ -40,7 +40,7 @@ public class GoodsController extends BaseController {
     @Log(title = "新增积分商品", businessType = BusinessType.INSERT)
     @PostMapping("/points")
     public AjaxResult<Void> addPoints(@RequestBody GoodsAddBo bo) {
-        return toAjax(iGoodsService.insertPointsByAddBo(bo)>0 ? 1 : 0);
+        return toAjax(iGoodsService.savePointsByAddBo(bo)>0 ? 1 : 0);
     }
 
     /**

+ 3 - 0
zhongzheng-admin-store/src/main/resources/application-dev.yml

@@ -166,3 +166,6 @@ oldOrder:
 
 oldSys:
     host: http://gdxypx.xy.com
+
+invoice:
+    host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -142,4 +142,6 @@ public interface IGoodsService extends IService<Goods> {
 	Goods getGoodsByIdNotTenant(Long goodsId);
 
 	GoodsVo getPointsDetail(Long goodsId);
+
+	Long savePointsByAddBo(GoodsAddBo bo);
 }

+ 14 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -802,7 +802,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 throw new CustomException("过期商品不允许上架");
             }
         }
-        if ((entity.getStatus() == -1 || entity.getStatus() == 0) && entity.getGoodsId().longValue() > 0 &&entity.getGoodsType()!=7) {
+        if ((entity.getStatus() == -1 || entity.getStatus() == 0) && entity.getGoodsId().longValue() > 0 &&(Validator.isNotEmpty(entity.getGoodsType()) && entity.getGoodsType()!=7)) {
             List<Long> payStatus = new ArrayList<>();
             payStatus.add(2L);
             payStatus.add(3L);
@@ -4410,6 +4410,19 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return BeanUtil.toBean(getById(goodsId),GoodsVo.class);
     }
 
+    @Override
+    public Long savePointsByAddBo(GoodsAddBo bo) {
+        Goods add = BeanUtil.toBean(bo, Goods.class);
+        add.setCode(ServletUtils.getEncoded("SP"));
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        add.setGoodsType(7);
+        add.setUseType("2");
+        boolean result = this.save(add);
+        return add.getGoodsId();
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean updateGoodsRepair(UpdateGoodsRepairBo bo) {