产品列表配置附加费
This commit is contained in:
+38
@@ -18,6 +18,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.price.domain.PrcSurcharge;
|
||||
import com.ruoyi.price.domain.PrcSurchargeRel;
|
||||
import com.ruoyi.price.service.IPrcSurchargeRelService;
|
||||
import com.ruoyi.price.service.IPrcSurchargeService;
|
||||
|
||||
/**
|
||||
@@ -32,6 +34,9 @@ public class SurchargeController extends BaseController
|
||||
@Autowired
|
||||
private IPrcSurchargeService surchargeService;
|
||||
|
||||
@Autowired
|
||||
private IPrcSurchargeRelService surchargeRelService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(PrcSurcharge surcharge)
|
||||
@@ -48,6 +53,39 @@ public class SurchargeController extends BaseController
|
||||
return success(surchargeService.selectPrcSurchargeById(scId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定产品已关联的附加费(非分页,供产品列表抽屉使用)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:query')")
|
||||
@GetMapping("/byProduct/{productCode}")
|
||||
public AjaxResult listByProduct(@PathVariable String productCode)
|
||||
{
|
||||
return success(surchargeRelService.selectRelByProductCode(productCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定附加费到产品/明细(body: scId, productId, productCode, detailId;detailId 空=产品级)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:add')")
|
||||
@Log(title = "附加费关联", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/rel")
|
||||
public AjaxResult addRel(@RequestBody PrcSurchargeRel rel)
|
||||
{
|
||||
rel.setCreateBy(getUsername());
|
||||
return toAjax(surchargeRelService.insertPrcSurchargeRel(rel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑(删除关联记录,不删除附加费本身)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:remove')")
|
||||
@Log(title = "附加费关联", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/rel/{relIds}")
|
||||
public AjaxResult removeRel(@PathVariable Long[] relIds)
|
||||
{
|
||||
return toAjax(surchargeRelService.deletePrcSurchargeRelByIds(relIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:surcharge:add')")
|
||||
@Log(title = "附加费配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
|
||||
Reference in New Issue
Block a user