添加耗材功能
This commit is contained in:
parent
32401b3ca9
commit
329b3872f8
|
|
@ -49,7 +49,7 @@ public interface TbConsInfoService {
|
|||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbConsInfo resources);
|
||||
void update(TbConsInfo resources) throws Exception;
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
|
|
|||
|
|
@ -30,4 +30,7 @@ public class TbConsInfoQueryCriteria{
|
|||
/** 精确 */
|
||||
@Query
|
||||
private Integer shopId;
|
||||
|
||||
@Query
|
||||
private String status;
|
||||
}
|
||||
|
|
@ -114,9 +114,21 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbConsInfo resources) {
|
||||
public void update(TbConsInfo resources) throws Exception {
|
||||
TbConsInfo tbConsInfo = tbConsInfoRepository.findById(resources.getId()).orElseGet(TbConsInfo::new);
|
||||
ValidationUtil.isNull( tbConsInfo.getId(),"TbConsInfo","id",resources.getId());
|
||||
|
||||
if(Objects.isNull(tbConsInfo)){
|
||||
throw new Exception("耗材信息不存在");
|
||||
}
|
||||
|
||||
|
||||
tbConsInfo.setConCode(resources.getConCode());
|
||||
tbConsInfo.setConName(resources.getConName());
|
||||
tbConsInfo.setPrice(resources.getPrice());
|
||||
tbConsInfo.setConUnit(resources.getConUnit());
|
||||
tbConsInfo.setConWarning(resources.getConWarning());
|
||||
tbConsInfo.setStatus(resources.getStatus());
|
||||
tbConsInfo.setUpdateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tbConsInfoRepository.save(tbConsInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue