Commit 6b4f5b0b by 吴迪

【新增】修改新增时候的代码

parent 2e31656d
...@@ -40,18 +40,15 @@ public class RetailpictureServiceImpl extends ServiceImpl<RetailpictureDao, Reta ...@@ -40,18 +40,15 @@ public class RetailpictureServiceImpl extends ServiceImpl<RetailpictureDao, Reta
@Override @Override
public R insertPicture(RetailpictureEntity picture, SysUserEntity user) { public R insertPicture(RetailpictureEntity picture, SysUserEntity user) {
if(picture.getPictureid() ==null){
return R.error("id不能为空!");
}
QueryWrapper<RetailpictureEntity> newsEntityQueryWrapper = new QueryWrapper<>();
newsEntityQueryWrapper.eq("pictureid",picture.getPictureid());
picture.setEditor(user.getUsername()); picture.setEditor(user.getUsername());
picture.setLasteditor(user.getUsername()); picture.setLasteditor(user.getUsername());
int update = baseMapper.update(picture, newsEntityQueryWrapper); picture.setInputdate(new Date());
if (update>0){ picture.setStatus(0);
return R.ok("修改成功!"); int insert = baseMapper.insert(picture);
if (insert>0){
return R.ok("新增成功!");
}else{ }else{
return R.error("修改失败!"); return R.error("新增失败!");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment