master
lzq 2026-01-07 17:48:12 +08:00
parent 0f1e69dc7f
commit 72f624b618
4 changed files with 24 additions and 6 deletions

View File

@ -1,5 +1,7 @@
package com.njzscloud.dispose.goods.pojo.param; 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.ExpenseItemCategory;
import com.njzscloud.dispose.finance.constant.ExpenseStrategy; import com.njzscloud.dispose.finance.constant.ExpenseStrategy;
import com.njzscloud.dispose.finance.constant.Payer; import com.njzscloud.dispose.finance.constant.Payer;
@ -50,7 +52,8 @@ public class AddGoodsParam {
/** /**
* unit * unit
*/ */
private String unit; @DictKey("unit")
private DictItem unit;
/** /**
* *

View File

@ -48,7 +48,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
this.save(goodsEntity); this.save(goodsEntity);
// 付费项 // 付费项
AddGoodsParam.ExpenseItem expenseItem = addGoodsParam.getExpenseItem(); AddGoodsParam.ExpenseItem expenseItem = addGoodsParam.getExpenseItem();
if (expenseItem == null) {
return;
}
String goodsName = addGoodsParam.getGoodsName(); String goodsName = addGoodsParam.getGoodsName();
AddExpenseItemParam addExpenseItemParam = BeanUtil.copyProperties(expenseItem, AddExpenseItemParam.class) AddExpenseItemParam addExpenseItemParam = BeanUtil.copyProperties(expenseItem, AddExpenseItemParam.class)
.setGoodsId(goodsEntity.getId()) .setGoodsId(goodsEntity.getId())

View File

@ -59,6 +59,15 @@ public class CraftController {
return R.success(craftService.detail(id)); 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();
}
/** /**
* *
*/ */

View File

@ -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(); Optional<CraftEntity> optionalCraft = list.stream().filter(item -> item.getCraftVer().equals(addCraftParam.getCraftVer())).findFirst();
Assert.isFalse(optionalCraft.isPresent(), () -> Exceptions.exception("工艺版本号已存在")); Assert.isFalse(optionalCraft.isPresent(), () -> Exceptions.exception("工艺版本号已存在"));
if (addCraftParam.getCanuse()) { /* if (addCraftParam.getCanuse()) {
updateBatchById(list.stream().map(item -> item.setCanuse(false)).toList()); updateBatchById(list.stream().map(item -> item.setCanuse(false)).toList());
} } */
this.save(BeanUtil.copyProperties(addCraftParam, CraftEntity.class) 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) { 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));
} }
} }