bug:修改商品状态无效

This commit is contained in:
xuwenbo
2020-05-18 19:06:10 +08:00
parent 34a1a4ad1f
commit 4c7aa7a479
5 changed files with 24 additions and 5 deletions

View File

@ -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);
}

View File

@ -64,4 +64,6 @@ public interface YxStoreProductService extends BaseService<YxStoreProduct>{
String getStoreProductAttrResult(Integer id);
void updateProduct(YxStoreProduct resources);
void delete(Integer id);
}

View File

@ -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;
}

View File

@ -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) {

View File

@ -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);
}