master
parent
0f1e69dc7f
commit
72f624b618
|
|
@ -1,5 +1,7 @@
|
|||
package com.njzscloud.dispose.goods.pojo.param;
|
||||
|
||||
import com.njzscloud.common.core.ienum.DictItem;
|
||||
import com.njzscloud.common.core.ienum.DictKey;
|
||||
import com.njzscloud.dispose.finance.constant.ExpenseItemCategory;
|
||||
import com.njzscloud.dispose.finance.constant.ExpenseStrategy;
|
||||
import com.njzscloud.dispose.finance.constant.Payer;
|
||||
|
|
@ -50,7 +52,8 @@ public class AddGoodsParam {
|
|||
/**
|
||||
* 计量单位;字典代码:unit
|
||||
*/
|
||||
private String unit;
|
||||
@DictKey("unit")
|
||||
private DictItem unit;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import java.util.List;
|
|||
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> implements GoodsService {
|
||||
|
||||
private final ExpenseItemService expenseItemService;
|
||||
private final GoodsCategoryMapper goodsCategoryMapper;
|
||||
private final GoodsCategoryMapper goodsCategoryMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
|
@ -48,7 +48,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
|
|||
this.save(goodsEntity);
|
||||
// 付费项
|
||||
AddGoodsParam.ExpenseItem expenseItem = addGoodsParam.getExpenseItem();
|
||||
|
||||
if (expenseItem == null) {
|
||||
return;
|
||||
}
|
||||
String goodsName = addGoodsParam.getGoodsName();
|
||||
AddExpenseItemParam addExpenseItemParam = BeanUtil.copyProperties(expenseItem, AddExpenseItemParam.class)
|
||||
.setGoodsId(goodsEntity.getId())
|
||||
|
|
|
|||
|
|
@ -59,6 +59,15 @@ public class CraftController {
|
|||
return R.success(craftService.detail(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用/启用
|
||||
*/
|
||||
@GetMapping("/disable")
|
||||
public R<?> disable(@RequestParam("id") Long id, @RequestParam("disable") Boolean disable) {
|
||||
craftService.disable(id, disable);
|
||||
return R.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ public class CraftService extends ServiceImpl<CraftMapper, CraftEntity> implemen
|
|||
Optional<CraftEntity> optionalCraft = list.stream().filter(item -> item.getCraftVer().equals(addCraftParam.getCraftVer())).findFirst();
|
||||
Assert.isFalse(optionalCraft.isPresent(), () -> Exceptions.exception("工艺版本号已存在"));
|
||||
|
||||
if (addCraftParam.getCanuse()) {
|
||||
/* if (addCraftParam.getCanuse()) {
|
||||
updateBatchById(list.stream().map(item -> item.setCanuse(false)).toList());
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
this.save(BeanUtil.copyProperties(addCraftParam, CraftEntity.class)
|
||||
|
|
@ -76,6 +76,10 @@ public class CraftService extends ServiceImpl<CraftMapper, CraftEntity> implemen
|
|||
* 分页查询
|
||||
*/
|
||||
public PageResult<SearchCraftResult> paging(PageParam pageParam, SearchCraftParam searchCraftParam) {
|
||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.lambdaQuery()));
|
||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.query()));
|
||||
}
|
||||
|
||||
public void disable(Long id, Boolean disable) {
|
||||
this.updateById(new CraftEntity().setId(id).setCanuse(disable));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue