修改附加费操作
This commit is contained in:
+27
-5
@@ -108,20 +108,42 @@ public class SurchargeController extends BaseController
|
||||
return toAjax(surchargeService.insertPrcSurcharge(surcharge));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改(版本化):内容无变化时返回 warn 提示,否则原记录作废 + 插入新记录,产品关联自动重指向新记录。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:edit')")
|
||||
@Log(title = "附加费配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody PrcSurcharge surcharge)
|
||||
{
|
||||
surcharge.setUpdateBy(getUsername());
|
||||
return toAjax(surchargeService.updatePrcSurcharge(surcharge));
|
||||
int rows = surchargeService.updatePrcSurcharge(surcharge);
|
||||
if (rows == -1)
|
||||
{
|
||||
return AjaxResult.warn("未做任何修改");
|
||||
}
|
||||
return toAjax(rows);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用(原地修改 ss_code=of,不新增数据,不物理删除)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:remove')")
|
||||
@Log(title = "附加费配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{scIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] scIds)
|
||||
@Log(title = "附加费停用", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/disable/{scIds}")
|
||||
public AjaxResult disable(@PathVariable Long[] scIds)
|
||||
{
|
||||
return toAjax(surchargeService.deletePrcSurchargeByIds(scIds));
|
||||
return toAjax(surchargeService.disablePrcSurchargeByIds(scIds, getUsername()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用(原地修改 ss_code=on,不新增数据)。
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:remove')")
|
||||
@Log(title = "附加费启用", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/enable/{scIds}")
|
||||
public AjaxResult enable(@PathVariable Long[] scIds)
|
||||
{
|
||||
return toAjax(surchargeService.enablePrcSurchargeByIds(scIds, getUsername()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user