master
parent
0f1e69dc7f
commit
72f624b618
|
|
@ -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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
|
|
|
||||||
|
|
@ -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())
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue