产品信息

localizer
ljw 2025-09-20 15:28:49 +08:00
parent 376dc0202e
commit bfa6bfd7a8
3 changed files with 129 additions and 2 deletions

View File

@ -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();
}
}

View File

@ -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
*/

View File

@ -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);
}
}