产品信息
parent
376dc0202e
commit
bfa6bfd7a8
|
|
@ -53,7 +53,7 @@ public class GoodsInfoController {
|
|||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<GoodsInfoEntity> detail(@RequestParam Long id) {
|
||||
public R<GoodsInfoEntity> detail(@RequestParam("id") Long id) {
|
||||
return R.success(goodsInfoService.detail(id));
|
||||
}
|
||||
|
||||
|
|
@ -65,4 +65,40 @@ public class GoodsInfoController {
|
|||
return R.success(goodsInfoService.paging(pageParam, goodsInfoEntity));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否确认磅重
|
||||
*/
|
||||
@PostMapping("/setPoundWeight")
|
||||
public R<?> setPoundWeight(@RequestParam Long id, @RequestParam Boolean isPoundWeight) {
|
||||
goodsInfoService.setPoundWeight(id, isPoundWeight);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否有回执单
|
||||
*/
|
||||
@PostMapping("/setReceipt")
|
||||
public R<?> setReceipt(@RequestParam Long id, @RequestParam Boolean isReceipt) {
|
||||
goodsInfoService.setReceipt(id, isReceipt);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否上报
|
||||
*/
|
||||
@PostMapping("/setReport")
|
||||
public R<?> setReport(@RequestParam Long id, @RequestParam Boolean isReport) {
|
||||
goodsInfoService.setReport(id, isReport);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否预约
|
||||
*/
|
||||
@PostMapping("/setSubscribe")
|
||||
public R<?> setSubscribe(@RequestParam Long id, @RequestParam Boolean isSubscribe) {
|
||||
goodsInfoService.setSubscribe(id, isSubscribe);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@ public class GoodsInfoEntity {
|
|||
@TableField(exist = false)
|
||||
private String goodsCategoryName;
|
||||
|
||||
/**
|
||||
* 库存类型 0-->出库 1-->入库
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Boolean inventoryType;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
|
|
@ -71,6 +77,46 @@ public class GoodsInfoEntity {
|
|||
*/
|
||||
private String memo;
|
||||
|
||||
/**
|
||||
* 计费方式 1-->入场计费 2-->出厂计费
|
||||
*/
|
||||
private String moneyWay;
|
||||
|
||||
/**
|
||||
* 付费方 1-->用户 2-->平台
|
||||
*/
|
||||
private String payer;
|
||||
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
private String goodsSn;
|
||||
|
||||
/**
|
||||
* 是否确认磅重 0-->否 1-->是
|
||||
*/
|
||||
private Boolean isPoundWeight;
|
||||
|
||||
/**
|
||||
* 是否有回执单 0-->否 1-->是
|
||||
*/
|
||||
private Boolean isReceipt;
|
||||
|
||||
/**
|
||||
* 是否上报 0-->否 1-->是
|
||||
*/
|
||||
private Boolean isReport;
|
||||
|
||||
/**
|
||||
* 是否预约 0-->否 1-->是
|
||||
*/
|
||||
private Boolean isSubscribe;
|
||||
|
||||
/**
|
||||
* 权重
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 创建人 Id; sys_user.id
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.njzscloud.supervisory.goods.mapper.GoodsInfoMapper;
|
|||
import com.njzscloud.supervisory.goods.pojo.entity.GoodsCategoryEntity;
|
||||
import com.njzscloud.supervisory.goods.pojo.entity.GoodsInfoEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.ehcache.shadow.org.terracotta.offheapstore.paging.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -59,6 +58,7 @@ public class GoodsInfoService extends ServiceImpl<GoodsInfoMapper, GoodsInfoEnti
|
|||
GoodsCategoryEntity categoryEntity = goodsCategoryService.detail(Long.valueOf(entity.getGoodsCategoryId()));
|
||||
if (null != categoryEntity) {
|
||||
entity.setGoodsCategoryName(categoryEntity.getCategoryName());
|
||||
entity.setInventoryType(categoryEntity.getInventoryType());
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
|
|
@ -82,9 +82,54 @@ public class GoodsInfoService extends ServiceImpl<GoodsInfoMapper, GoodsInfoEnti
|
|||
GoodsCategoryEntity categoryEntity = goodsCategoryService.getById(entity.getGoodsCategoryId());
|
||||
if (null != categoryEntity) {
|
||||
entity.setGoodsCategoryName(categoryEntity.getCategoryName());
|
||||
entity.setInventoryType(categoryEntity.getInventoryType());
|
||||
}
|
||||
}
|
||||
return PageResult.of(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否确认磅重
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setPoundWeight(Long id, Boolean isPoundWeight) {
|
||||
GoodsInfoEntity entity = new GoodsInfoEntity();
|
||||
entity.setId(id);
|
||||
entity.setIsPoundWeight(isPoundWeight);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否有回执单
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setReceipt(Long id, Boolean isReceipt) {
|
||||
GoodsInfoEntity entity = new GoodsInfoEntity();
|
||||
entity.setId(id);
|
||||
entity.setIsReceipt(isReceipt);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否上报
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setReport(Long id, Boolean isReport) {
|
||||
GoodsInfoEntity entity = new GoodsInfoEntity();
|
||||
entity.setId(id);
|
||||
entity.setIsReport(isReport);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否预约
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setSubscribe(Long id, Boolean isSubscribe) {
|
||||
GoodsInfoEntity entity = new GoodsInfoEntity();
|
||||
entity.setId(id);
|
||||
entity.setIsSubscribe(isSubscribe);
|
||||
this.updateById(entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue