添加耗材功能
This commit is contained in:
@@ -49,7 +49,7 @@ public interface TbConsInfoService {
|
|||||||
* 编辑
|
* 编辑
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void update(TbConsInfo resources);
|
void update(TbConsInfo resources) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 多选删除
|
* 多选删除
|
||||||
|
|||||||
@@ -30,4 +30,7 @@ public class TbConsInfoQueryCriteria{
|
|||||||
/** 精确 */
|
/** 精确 */
|
||||||
@Query
|
@Query
|
||||||
private Integer shopId;
|
private Integer shopId;
|
||||||
|
|
||||||
|
@Query
|
||||||
|
private String status;
|
||||||
}
|
}
|
||||||
@@ -114,9 +114,21 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@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);
|
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);
|
tbConsInfoRepository.save(tbConsInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user