bug:修改商品状态无效
This commit is contained in:
@ -84,7 +84,7 @@ public class StoreProductController {
|
||||
@PreAuthorize("@el.check('admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE')")
|
||||
public ResponseEntity delete(@PathVariable Integer id){
|
||||
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
|
||||
yxStoreProductService.removeById(id);
|
||||
yxStoreProductService.delete(id);
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
@ -64,4 +64,6 @@ public interface YxStoreProductService extends BaseService<YxStoreProduct>{
|
||||
String getStoreProductAttrResult(Integer id);
|
||||
|
||||
void updateProduct(YxStoreProduct resources);
|
||||
|
||||
void delete(Integer id);
|
||||
}
|
||||
|
@ -18,4 +18,15 @@ import co.yixiang.annotation.Query;
|
||||
*/
|
||||
@Data
|
||||
public class YxStoreProductQueryCriteria{
|
||||
|
||||
// 模糊
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String storeName;
|
||||
|
||||
// 精确
|
||||
@Query
|
||||
private Integer isDel;
|
||||
|
||||
@Query
|
||||
private Integer isShow;
|
||||
}
|
||||
|
@ -270,6 +270,11 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
||||
this.saveOrUpdate(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Integer id) {
|
||||
storeProductMapper.updateDel(1,id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void clearProductAttr(Integer id,boolean isActice) {
|
||||
|
@ -24,8 +24,9 @@ import org.springframework.stereotype.Repository;
|
||||
@Mapper
|
||||
public interface StoreProductMapper extends CoreMapper<YxStoreProduct> {
|
||||
|
||||
@Update("update yx_store_product set is_show = #{i} where id = #{id}")
|
||||
void updateDel(@Param("i")int i,@Param("id") Integer id);
|
||||
@Update("update yx_store_product set is_del = #{i} where id = #{id}")
|
||||
void updateOnsale(@Param("i")int i, @Param("id")Integer id);
|
||||
|
||||
@Update("update yx_store_product set is_del = #{status} where id = #{id}")
|
||||
void updateDel(@Param("status")int status,@Param("id") Integer id);
|
||||
@Update("update yx_store_product set is_show = #{status} where id = #{id}")
|
||||
void updateOnsale(@Param("status")int status, @Param("id")Integer id);
|
||||
}
|
||||
|
Reference in New Issue
Block a user