提交价格套餐功能

This commit is contained in:
wuweihua
2026-09-04 14:56:05 +08:00
parent f8b9681583
commit 5e15ab9c44
47 changed files with 6243 additions and 9 deletions
@@ -0,0 +1,196 @@
package com.ruoyi.web.controller.price;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
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.PrcCustomerPriceSet;
import com.ruoyi.price.domain.PrcPriceSet;
import com.ruoyi.price.domain.PrcPriceSetDetail;
import com.ruoyi.price.service.IPrcPriceSetService;
/**
* 价格套餐管理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/price/set")
public class PriceSetController extends BaseController
{
@Autowired
private IPrcPriceSetService priceSetService;
@PreAuthorize("@ss.hasPermi('price:set:list')")
@GetMapping("/list")
public TableDataInfo list(PrcPriceSet set)
{
startPage();
List<PrcPriceSet> list = priceSetService.selectPrcPriceSetList(set);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:set:query')")
@GetMapping("/{priceSetId:[0-9]+}")
public AjaxResult getInfo(@PathVariable Long priceSetId)
{
return success(priceSetService.selectPrcPriceSetById(priceSetId));
}
@PreAuthorize("@ss.hasPermi('price:set:add')")
@Log(title = "价格套餐", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@Validated @RequestBody PrcPriceSet set)
{
set.setCreateBy(getUsername());
set.setUpdateBy(getUsername());
Long id = priceSetService.savePrcPriceSet(set);
return success(id);
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "价格套餐", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@Validated @RequestBody PrcPriceSet set)
{
set.setUpdateBy(getUsername());
return toAjax(priceSetService.updatePrcPriceSet(set));
}
@PreAuthorize("@ss.hasPermi('price:set:remove')")
@Log(title = "价格套餐", businessType = BusinessType.DELETE)
@DeleteMapping("/{priceSetIds}")
public AjaxResult remove(@PathVariable Long[] priceSetIds)
{
return toAjax(priceSetService.deletePrcPriceSetByIds(priceSetIds));
}
@PreAuthorize("@ss.hasPermi('price:set:audit')")
@Log(title = "价格套餐提交审核", businessType = BusinessType.UPDATE)
@PutMapping("/submit/{priceSetId}")
public AjaxResult submit(@PathVariable Long priceSetId)
{
return toAjax(priceSetService.submit(priceSetId, getUsername()));
}
@PreAuthorize("@ss.hasPermi('price:set:audit')")
@Log(title = "价格套餐生效", businessType = BusinessType.UPDATE)
@PutMapping("/approve/{priceSetId}")
public AjaxResult approve(@PathVariable Long priceSetId)
{
return toAjax(priceSetService.approve(priceSetId, getUsername()));
}
@PreAuthorize("@ss.hasPermi('price:set:audit')")
@Log(title = "价格套餐驳回", businessType = BusinessType.UPDATE)
@PutMapping("/reject/{priceSetId}")
public AjaxResult reject(@PathVariable Long priceSetId)
{
return toAjax(priceSetService.reject(priceSetId, getUsername()));
}
@PreAuthorize("@ss.hasPermi('price:set:audit')")
@Log(title = "价格套餐停用", businessType = BusinessType.UPDATE)
@PutMapping("/disable/{priceSetId}")
public AjaxResult disable(@PathVariable Long priceSetId)
{
return toAjax(priceSetService.disable(priceSetId, getUsername()));
}
@PreAuthorize("@ss.hasPermi('price:set:add')")
@Log(title = "价格套餐复用", businessType = BusinessType.INSERT)
@PostMapping("/copy/{priceSetId}")
public AjaxResult copy(@PathVariable Long priceSetId)
{
Long id = priceSetService.copy(priceSetId, getUsername());
return success(id);
}
@PreAuthorize("@ss.hasPermi('price:set:query')")
@PostMapping("/validate")
public AjaxResult validate(@RequestBody PrcPriceSet set)
{
return success(priceSetService.validate(set));
}
@PreAuthorize("@ss.hasPermi('price:set:list')")
@GetMapping("/detail/list")
public TableDataInfo detailList(PrcPriceSetDetail detail)
{
startPage();
List<PrcPriceSetDetail> list = priceSetService.selectDetailList(detail);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "套餐明细", businessType = BusinessType.INSERT)
@PostMapping("/detail")
public AjaxResult addDetail(@RequestBody PrcPriceSetDetail detail)
{
return toAjax(priceSetService.insertDetail(detail));
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "套餐明细", businessType = BusinessType.UPDATE)
@PutMapping("/detail")
public AjaxResult editDetail(@RequestBody PrcPriceSetDetail detail)
{
return toAjax(priceSetService.updateDetail(detail));
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "套餐明细", businessType = BusinessType.DELETE)
@DeleteMapping("/detail/{psdIds}")
public AjaxResult removeDetail(@PathVariable Long[] psdIds)
{
return toAjax(priceSetService.deleteDetailByIds(psdIds));
}
@PreAuthorize("@ss.hasPermi('price:set:list')")
@GetMapping("/customer/list")
public TableDataInfo customerList(PrcCustomerPriceSet customer)
{
startPage();
List<PrcCustomerPriceSet> list = priceSetService.selectCustomerList(customer);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "套餐客户绑定", businessType = BusinessType.INSERT)
@PostMapping("/customer")
public AjaxResult addCustomer(@RequestBody PrcCustomerPriceSet customer)
{
customer.setCreateBy(getUsername());
return toAjax(priceSetService.insertCustomer(customer));
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "套餐客户绑定", businessType = BusinessType.UPDATE)
@PutMapping("/customer")
public AjaxResult editCustomer(@RequestBody PrcCustomerPriceSet customer)
{
customer.setUpdateBy(getUsername());
return toAjax(priceSetService.updateCustomer(customer));
}
@PreAuthorize("@ss.hasPermi('price:set:edit')")
@Log(title = "套餐客户绑定", businessType = BusinessType.DELETE)
@DeleteMapping("/customer/{customerPricesetIds}")
public AjaxResult removeCustomer(@PathVariable Long[] customerPricesetIds)
{
return toAjax(priceSetService.deleteCustomerByIds(customerPricesetIds));
}
}
@@ -0,0 +1,110 @@
package com.ruoyi.web.controller.price;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
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.PrcWeightSectionDetail;
import com.ruoyi.price.domain.PrcWeightSectionTemplate;
import com.ruoyi.price.service.IPrcWeightService;
/**
* 重量段管理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/price/weight")
public class WeightController extends BaseController
{
@Autowired
private IPrcWeightService weightService;
@PreAuthorize("@ss.hasPermi('price:weight:list')")
@GetMapping("/template/list")
public TableDataInfo templateList(PrcWeightSectionTemplate template)
{
startPage();
List<PrcWeightSectionTemplate> list = weightService.selectPrcWeightSectionTemplateList(template);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:weight:query')")
@GetMapping("/template/{wstId}")
public AjaxResult getTemplate(@PathVariable Long wstId)
{
return success(weightService.selectPrcWeightSectionTemplateById(wstId));
}
@PreAuthorize("@ss.hasPermi('price:weight:add')")
@Log(title = "重量段模板", businessType = BusinessType.INSERT)
@PostMapping("/template")
public AjaxResult addTemplate(@Validated @RequestBody PrcWeightSectionTemplate template)
{
template.setCreateBy(getUsername());
return toAjax(weightService.insertPrcWeightSectionTemplate(template));
}
@PreAuthorize("@ss.hasPermi('price:weight:edit')")
@Log(title = "重量段模板", businessType = BusinessType.UPDATE)
@PutMapping("/template")
public AjaxResult editTemplate(@Validated @RequestBody PrcWeightSectionTemplate template)
{
template.setUpdateBy(getUsername());
return toAjax(weightService.updatePrcWeightSectionTemplate(template));
}
@PreAuthorize("@ss.hasPermi('price:weight:remove')")
@Log(title = "重量段模板", businessType = BusinessType.DELETE)
@DeleteMapping("/template/{wstIds}")
public AjaxResult removeTemplate(@PathVariable Long[] wstIds)
{
return toAjax(weightService.deletePrcWeightSectionTemplateByIds(wstIds));
}
@PreAuthorize("@ss.hasPermi('price:weight:list')")
@GetMapping("/detail/list")
public TableDataInfo detailList(PrcWeightSectionDetail detail)
{
startPage();
List<PrcWeightSectionDetail> list = weightService.selectPrcWeightSectionDetailList(detail);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:weight:add')")
@Log(title = "重量段明细", businessType = BusinessType.INSERT)
@PostMapping("/detail")
public AjaxResult addDetail(@Validated @RequestBody PrcWeightSectionDetail detail)
{
return toAjax(weightService.insertPrcWeightSectionDetail(detail));
}
@PreAuthorize("@ss.hasPermi('price:weight:edit')")
@Log(title = "重量段明细", businessType = BusinessType.UPDATE)
@PutMapping("/detail")
public AjaxResult editDetail(@Validated @RequestBody PrcWeightSectionDetail detail)
{
return toAjax(weightService.updatePrcWeightSectionDetail(detail));
}
@PreAuthorize("@ss.hasPermi('price:weight:remove')")
@Log(title = "重量段明细", businessType = BusinessType.DELETE)
@DeleteMapping("/detail/{wsdIds}")
public AjaxResult removeDetail(@PathVariable Long[] wsdIds)
{
return toAjax(weightService.deletePrcWeightSectionDetailByIds(wsdIds));
}
}
@@ -0,0 +1,144 @@
package com.ruoyi.web.controller.price;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
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.XtdZoneCountry;
import com.ruoyi.price.domain.XtdZoneDivision;
import com.ruoyi.price.domain.XtdZoneScheme;
import com.ruoyi.price.service.IXtdZoneService;
/**
* 分区管理
*
* @author ruoyi
*/
@RestController
@RequestMapping("/price/zone")
public class ZoneController extends BaseController
{
@Autowired
private IXtdZoneService zoneService;
@PreAuthorize("@ss.hasPermi('price:zone:list')")
@GetMapping("/scheme/list")
public TableDataInfo schemeList(XtdZoneScheme scheme)
{
startPage();
List<XtdZoneScheme> list = zoneService.selectXtdZoneSchemeList(scheme);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:zone:query')")
@GetMapping("/scheme/{zsId}")
public AjaxResult getScheme(@PathVariable Long zsId)
{
return success(zoneService.selectXtdZoneSchemeById(zsId));
}
@PreAuthorize("@ss.hasPermi('price:zone:add')")
@Log(title = "分区方案", businessType = BusinessType.INSERT)
@PostMapping("/scheme")
public AjaxResult addScheme(@Validated @RequestBody XtdZoneScheme scheme)
{
scheme.setCreateBy(getUsername());
return toAjax(zoneService.insertXtdZoneScheme(scheme));
}
@PreAuthorize("@ss.hasPermi('price:zone:edit')")
@Log(title = "分区方案", businessType = BusinessType.UPDATE)
@PutMapping("/scheme")
public AjaxResult editScheme(@Validated @RequestBody XtdZoneScheme scheme)
{
scheme.setUpdateBy(getUsername());
return toAjax(zoneService.updateXtdZoneScheme(scheme));
}
@PreAuthorize("@ss.hasPermi('price:zone:remove')")
@Log(title = "分区方案", businessType = BusinessType.DELETE)
@DeleteMapping("/scheme/{zsIds}")
public AjaxResult removeScheme(@PathVariable Long[] zsIds)
{
return toAjax(zoneService.deleteXtdZoneSchemeByIds(zsIds));
}
@PreAuthorize("@ss.hasPermi('price:zone:list')")
@GetMapping("/division/list")
public TableDataInfo divisionList(XtdZoneDivision division)
{
startPage();
List<XtdZoneDivision> list = zoneService.selectXtdZoneDivisionList(division);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:zone:add')")
@Log(title = "分区区划", businessType = BusinessType.INSERT)
@PostMapping("/division")
public AjaxResult addDivision(@Validated @RequestBody XtdZoneDivision division)
{
return toAjax(zoneService.insertXtdZoneDivision(division));
}
@PreAuthorize("@ss.hasPermi('price:zone:edit')")
@Log(title = "分区区划", businessType = BusinessType.UPDATE)
@PutMapping("/division")
public AjaxResult editDivision(@Validated @RequestBody XtdZoneDivision division)
{
return toAjax(zoneService.updateXtdZoneDivision(division));
}
@PreAuthorize("@ss.hasPermi('price:zone:remove')")
@Log(title = "分区区划", businessType = BusinessType.DELETE)
@DeleteMapping("/division/{zdIds}")
public AjaxResult removeDivision(@PathVariable Long[] zdIds)
{
return toAjax(zoneService.deleteXtdZoneDivisionByIds(zdIds));
}
@PreAuthorize("@ss.hasPermi('price:zone:list')")
@GetMapping("/country/list")
public TableDataInfo countryList(XtdZoneCountry country)
{
startPage();
List<XtdZoneCountry> list = zoneService.selectXtdZoneCountryList(country);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('price:zone:add')")
@Log(title = "分区国家", businessType = BusinessType.INSERT)
@PostMapping("/country")
public AjaxResult addCountry(@Validated @RequestBody XtdZoneCountry country)
{
return toAjax(zoneService.insertXtdZoneCountry(country));
}
@PreAuthorize("@ss.hasPermi('price:zone:edit')")
@Log(title = "分区国家", businessType = BusinessType.UPDATE)
@PutMapping("/country")
public AjaxResult editCountry(@Validated @RequestBody XtdZoneCountry country)
{
return toAjax(zoneService.updateXtdZoneCountry(country));
}
@PreAuthorize("@ss.hasPermi('price:zone:remove')")
@Log(title = "分区国家", businessType = BusinessType.DELETE)
@DeleteMapping("/country/{zcIds}")
public AjaxResult removeCountry(@PathVariable Long[] zcIds)
{
return toAjax(zoneService.deleteXtdZoneCountryByIds(zcIds));
}
}