提交价格套餐功能
This commit is contained in:
+196
@@ -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));
|
||||
}
|
||||
}
|
||||
+110
@@ -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));
|
||||
}
|
||||
}
|
||||
+144
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户套餐 prc_customer_price_set
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcCustomerPriceSet extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long customerPricesetId;
|
||||
private Long priceSetId;
|
||||
private Long customerId;
|
||||
private String customerName;
|
||||
/** 优先级,数字越小越优先 */
|
||||
private Integer bindPriority;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date prBegindate;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date prEnddate;
|
||||
private String priceSetNote;
|
||||
|
||||
public Long getCustomerPricesetId() { return customerPricesetId; }
|
||||
public void setCustomerPricesetId(Long customerPricesetId) { this.customerPricesetId = customerPricesetId; }
|
||||
public Long getPriceSetId() { return priceSetId; }
|
||||
public void setPriceSetId(Long priceSetId) { this.priceSetId = priceSetId; }
|
||||
public Long getCustomerId() { return customerId; }
|
||||
public void setCustomerId(Long customerId) { this.customerId = customerId; }
|
||||
public String getCustomerName() { return customerName; }
|
||||
public void setCustomerName(String customerName) { this.customerName = customerName; }
|
||||
public Integer getBindPriority() { return bindPriority; }
|
||||
public void setBindPriority(Integer bindPriority) { this.bindPriority = bindPriority; }
|
||||
public Date getPrBegindate() { return prBegindate; }
|
||||
public void setPrBegindate(Date prBegindate) { this.prBegindate = prBegindate; }
|
||||
public Date getPrEnddate() { return prEnddate; }
|
||||
public void setPrEnddate(Date prEnddate) { this.prEnddate = prEnddate; }
|
||||
public String getPriceSetNote() { return priceSetNote; }
|
||||
public void setPriceSetNote(String priceSetNote) { this.priceSetNote = priceSetNote; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("customerPricesetId", getCustomerPricesetId())
|
||||
.append("priceSetId", getPriceSetId())
|
||||
.append("customerId", getCustomerId())
|
||||
.append("bindPriority", getBindPriority())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 价格套餐 prc_price_set
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcPriceSet extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 价格套餐id */
|
||||
private Long priceSetId;
|
||||
/** 套餐编码 */
|
||||
private String priceSetCode;
|
||||
/** 套餐名称 */
|
||||
private String priceSetName;
|
||||
/** 备注 */
|
||||
private String priceSetNote;
|
||||
/** 计价类型 FIXED / DISCOUNT */
|
||||
private String setType;
|
||||
/** 默认折扣百分数 */
|
||||
private BigDecimal defaultDiscount;
|
||||
/** 默认套餐 Y */
|
||||
private String defaultType;
|
||||
/** 试算标记 Y */
|
||||
private String calculateSign;
|
||||
/** 生效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
/** 状态 D/A/E/R/S */
|
||||
private String status;
|
||||
/** 租户ID */
|
||||
private Long tmsId;
|
||||
|
||||
/** 产品数(列表) */
|
||||
private Integer productCount;
|
||||
/** 客户数(列表) */
|
||||
private Integer customerCount;
|
||||
/** 是否已过期(计算字段) */
|
||||
private Boolean expired;
|
||||
/** 列表搜索关键字 */
|
||||
private String keyword;
|
||||
/** 保存后是否提交审核 Y */
|
||||
private String submitFlag;
|
||||
|
||||
/** 套餐明细(向导保存) */
|
||||
private List<PrcPriceSetDetail> details;
|
||||
/** 绑定客户(向导保存) */
|
||||
private List<PrcCustomerPriceSet> customers;
|
||||
|
||||
public Long getPriceSetId() { return priceSetId; }
|
||||
public void setPriceSetId(Long priceSetId) { this.priceSetId = priceSetId; }
|
||||
public String getPriceSetCode() { return priceSetCode; }
|
||||
public void setPriceSetCode(String priceSetCode) { this.priceSetCode = priceSetCode; }
|
||||
public String getPriceSetName() { return priceSetName; }
|
||||
public void setPriceSetName(String priceSetName) { this.priceSetName = priceSetName; }
|
||||
public String getPriceSetNote() { return priceSetNote; }
|
||||
public void setPriceSetNote(String priceSetNote) { this.priceSetNote = priceSetNote; }
|
||||
public String getSetType() { return setType; }
|
||||
public void setSetType(String setType) { this.setType = setType; }
|
||||
public BigDecimal getDefaultDiscount() { return defaultDiscount; }
|
||||
public void setDefaultDiscount(BigDecimal defaultDiscount) { this.defaultDiscount = defaultDiscount; }
|
||||
public String getDefaultType() { return defaultType; }
|
||||
public void setDefaultType(String defaultType) { this.defaultType = defaultType; }
|
||||
public String getCalculateSign() { return calculateSign; }
|
||||
public void setCalculateSign(String calculateSign) { this.calculateSign = calculateSign; }
|
||||
public Date getEffectiveDate() { return effectiveDate; }
|
||||
public void setEffectiveDate(Date effectiveDate) { this.effectiveDate = effectiveDate; }
|
||||
public Date getExpireDate() { return expireDate; }
|
||||
public void setExpireDate(Date expireDate) { this.expireDate = expireDate; }
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
public Long getTmsId() { return tmsId; }
|
||||
public void setTmsId(Long tmsId) { this.tmsId = tmsId; }
|
||||
public Integer getProductCount() { return productCount; }
|
||||
public void setProductCount(Integer productCount) { this.productCount = productCount; }
|
||||
public Integer getCustomerCount() { return customerCount; }
|
||||
public void setCustomerCount(Integer customerCount) { this.customerCount = customerCount; }
|
||||
public Boolean getExpired() { return expired; }
|
||||
public void setExpired(Boolean expired) { this.expired = expired; }
|
||||
public String getKeyword() { return keyword; }
|
||||
public void setKeyword(String keyword) { this.keyword = keyword; }
|
||||
public String getSubmitFlag() { return submitFlag; }
|
||||
public void setSubmitFlag(String submitFlag) { this.submitFlag = submitFlag; }
|
||||
public List<PrcPriceSetDetail> getDetails() { return details; }
|
||||
public void setDetails(List<PrcPriceSetDetail> details) { this.details = details; }
|
||||
public List<PrcCustomerPriceSet> getCustomers() { return customers; }
|
||||
public void setCustomers(List<PrcCustomerPriceSet> customers) { this.customers = customers; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("priceSetId", getPriceSetId())
|
||||
.append("priceSetCode", getPriceSetCode())
|
||||
.append("priceSetName", getPriceSetName())
|
||||
.append("setType", getSetType())
|
||||
.append("status", getStatus())
|
||||
.append("effectiveDate", getEffectiveDate())
|
||||
.append("expireDate", getExpireDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
/**
|
||||
* 套餐校验项
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcPriceSetCheckItem
|
||||
{
|
||||
/** 校验项名称 */
|
||||
private String item;
|
||||
/** PASS / WARN / FAIL / INFO */
|
||||
private String result;
|
||||
/** 说明 */
|
||||
private String message;
|
||||
|
||||
public PrcPriceSetCheckItem()
|
||||
{
|
||||
}
|
||||
|
||||
public PrcPriceSetCheckItem(String item, String result, String message)
|
||||
{
|
||||
this.item = item;
|
||||
this.result = result;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getItem() { return item; }
|
||||
public void setItem(String item) { this.item = item; }
|
||||
public String getResult() { return result; }
|
||||
public void setResult(String result) { this.result = result; }
|
||||
public String getMessage() { return message; }
|
||||
public void setMessage(String message) { this.message = message; }
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 价格套餐明细 prc_price_set_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcPriceSetDetail implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long psdId;
|
||||
private Long priceSetId;
|
||||
private String productCode;
|
||||
private String productName;
|
||||
private String countryCode;
|
||||
private String countryName;
|
||||
private Long zdId;
|
||||
private Long wsdId;
|
||||
private String weightLabel;
|
||||
private BigDecimal fvValue;
|
||||
private BigDecimal fvRegistrationFee;
|
||||
private BigDecimal discountValue;
|
||||
private Integer prId;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
public Long getPsdId() { return psdId; }
|
||||
public void setPsdId(Long psdId) { this.psdId = psdId; }
|
||||
public Long getPriceSetId() { return priceSetId; }
|
||||
public void setPriceSetId(Long priceSetId) { this.priceSetId = priceSetId; }
|
||||
public String getProductCode() { return productCode; }
|
||||
public void setProductCode(String productCode) { this.productCode = productCode; }
|
||||
public String getProductName() { return productName; }
|
||||
public void setProductName(String productName) { this.productName = productName; }
|
||||
public String getCountryCode() { return countryCode; }
|
||||
public void setCountryCode(String countryCode) { this.countryCode = countryCode; }
|
||||
public String getCountryName() { return countryName; }
|
||||
public void setCountryName(String countryName) { this.countryName = countryName; }
|
||||
public Long getZdId() { return zdId; }
|
||||
public void setZdId(Long zdId) { this.zdId = zdId; }
|
||||
public Long getWsdId() { return wsdId; }
|
||||
public void setWsdId(Long wsdId) { this.wsdId = wsdId; }
|
||||
public String getWeightLabel() { return weightLabel; }
|
||||
public void setWeightLabel(String weightLabel) { this.weightLabel = weightLabel; }
|
||||
public BigDecimal getFvValue() { return fvValue; }
|
||||
public void setFvValue(BigDecimal fvValue) { this.fvValue = fvValue; }
|
||||
public BigDecimal getFvRegistrationFee() { return fvRegistrationFee; }
|
||||
public void setFvRegistrationFee(BigDecimal fvRegistrationFee) { this.fvRegistrationFee = fvRegistrationFee; }
|
||||
public BigDecimal getDiscountValue() { return discountValue; }
|
||||
public void setDiscountValue(BigDecimal discountValue) { this.discountValue = discountValue; }
|
||||
public Integer getPrId() { return prId; }
|
||||
public void setPrId(Integer prId) { this.prId = prId; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("psdId", getPsdId())
|
||||
.append("priceSetId", getPriceSetId())
|
||||
.append("productCode", getProductCode())
|
||||
.append("countryCode", getCountryCode())
|
||||
.append("wsdId", getWsdId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 重量段明细 prc_weight_section_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcWeightSectionDetail implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 重量段明细ID */
|
||||
private Long wsdId;
|
||||
/** 重量段模板ID */
|
||||
private Long wstId;
|
||||
/** 段标题 */
|
||||
private String wlTitle;
|
||||
/** 起始重量 */
|
||||
private BigDecimal wlStartweight;
|
||||
/** 结束重量 */
|
||||
private BigDecimal wlEndweight;
|
||||
/** 计费方式代码 */
|
||||
private String weightBillingCode;
|
||||
/** 单位重量 */
|
||||
private BigDecimal fvUnitweight;
|
||||
/** 生效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
/** 失效日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date expireDate;
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
public Long getWsdId() { return wsdId; }
|
||||
public void setWsdId(Long wsdId) { this.wsdId = wsdId; }
|
||||
public Long getWstId() { return wstId; }
|
||||
public void setWstId(Long wstId) { this.wstId = wstId; }
|
||||
public String getWlTitle() { return wlTitle; }
|
||||
public void setWlTitle(String wlTitle) { this.wlTitle = wlTitle; }
|
||||
public BigDecimal getWlStartweight() { return wlStartweight; }
|
||||
public void setWlStartweight(BigDecimal wlStartweight) { this.wlStartweight = wlStartweight; }
|
||||
public BigDecimal getWlEndweight() { return wlEndweight; }
|
||||
public void setWlEndweight(BigDecimal wlEndweight) { this.wlEndweight = wlEndweight; }
|
||||
public String getWeightBillingCode() { return weightBillingCode; }
|
||||
public void setWeightBillingCode(String weightBillingCode) { this.weightBillingCode = weightBillingCode; }
|
||||
public BigDecimal getFvUnitweight() { return fvUnitweight; }
|
||||
public void setFvUnitweight(BigDecimal fvUnitweight) { this.fvUnitweight = fvUnitweight; }
|
||||
public Date getEffectiveDate() { return effectiveDate; }
|
||||
public void setEffectiveDate(Date effectiveDate) { this.effectiveDate = effectiveDate; }
|
||||
public Date getExpireDate() { return expireDate; }
|
||||
public void setExpireDate(Date expireDate) { this.expireDate = expireDate; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("wsdId", getWsdId())
|
||||
.append("wstId", getWstId())
|
||||
.append("wlTitle", getWlTitle())
|
||||
.append("wlStartweight", getWlStartweight())
|
||||
.append("wlEndweight", getWlEndweight())
|
||||
.append("weightBillingCode", getWeightBillingCode())
|
||||
.append("fvUnitweight", getFvUnitweight())
|
||||
.append("effectiveDate", getEffectiveDate())
|
||||
.append("expireDate", getExpireDate())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 重量段模板 prc_weight_section_template
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PrcWeightSectionTemplate extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 重量段模板ID */
|
||||
private Long wstId;
|
||||
/** 模板名称 */
|
||||
private String wstName;
|
||||
/** 状态码(on/off) */
|
||||
private String ssCode;
|
||||
/** 产品组代码 */
|
||||
private String pgCode;
|
||||
/** 服务渠道ID */
|
||||
private Long snId;
|
||||
/** 货物类型代码 */
|
||||
private String ctCode;
|
||||
/** 付款方式代码 */
|
||||
private String pmCode;
|
||||
/** 备注 */
|
||||
private String wstNote;
|
||||
/** 租户ID */
|
||||
private Long tmsId;
|
||||
/** 明细数量(列表展示,非表字段) */
|
||||
private Integer detailCount;
|
||||
|
||||
public Long getWstId() { return wstId; }
|
||||
public void setWstId(Long wstId) { this.wstId = wstId; }
|
||||
public String getWstName() { return wstName; }
|
||||
public void setWstName(String wstName) { this.wstName = wstName; }
|
||||
public String getSsCode() { return ssCode; }
|
||||
public void setSsCode(String ssCode) { this.ssCode = ssCode; }
|
||||
public String getPgCode() { return pgCode; }
|
||||
public void setPgCode(String pgCode) { this.pgCode = pgCode; }
|
||||
public Long getSnId() { return snId; }
|
||||
public void setSnId(Long snId) { this.snId = snId; }
|
||||
public String getCtCode() { return ctCode; }
|
||||
public void setCtCode(String ctCode) { this.ctCode = ctCode; }
|
||||
public String getPmCode() { return pmCode; }
|
||||
public void setPmCode(String pmCode) { this.pmCode = pmCode; }
|
||||
public String getWstNote() { return wstNote; }
|
||||
public void setWstNote(String wstNote) { this.wstNote = wstNote; }
|
||||
public Long getTmsId() { return tmsId; }
|
||||
public void setTmsId(Long tmsId) { this.tmsId = tmsId; }
|
||||
public Integer getDetailCount() { return detailCount; }
|
||||
public void setDetailCount(Integer detailCount) { this.detailCount = detailCount; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("wstId", getWstId())
|
||||
.append("wstName", getWstName())
|
||||
.append("ssCode", getSsCode())
|
||||
.append("pgCode", getPgCode())
|
||||
.append("snId", getSnId())
|
||||
.append("ctCode", getCtCode())
|
||||
.append("pmCode", getPmCode())
|
||||
.append("wstNote", getWstNote())
|
||||
.append("tmsId", getTmsId())
|
||||
.append("detailCount", getDetailCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 分区国家 xtd_zonecountry
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class XtdZoneCountry implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分区国家ID */
|
||||
private Long zcId;
|
||||
/** 区划ID */
|
||||
private Long zdId;
|
||||
/** 国家代码(ISO2) */
|
||||
private String countryCode;
|
||||
/** 划分类型(默认C) */
|
||||
private String zcDividekind;
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
|
||||
public Long getZcId() { return zcId; }
|
||||
public void setZcId(Long zcId) { this.zcId = zcId; }
|
||||
public Long getZdId() { return zdId; }
|
||||
public void setZdId(Long zdId) { this.zdId = zdId; }
|
||||
public String getCountryCode() { return countryCode; }
|
||||
public void setCountryCode(String countryCode) { this.countryCode = countryCode; }
|
||||
public String getZcDividekind() { return zcDividekind; }
|
||||
public void setZcDividekind(String zcDividekind) { this.zcDividekind = zcDividekind; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("zcId", getZcId())
|
||||
.append("zdId", getZdId())
|
||||
.append("countryCode", getCountryCode())
|
||||
.append("zcDividekind", getZcDividekind())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 分区区划 xtd_zone_division
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class XtdZoneDivision implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 区划ID */
|
||||
private Long zdId;
|
||||
/** 分区方案ID */
|
||||
private Long zsId;
|
||||
/** 排序 */
|
||||
private Integer zdSort;
|
||||
/** 区划代码 */
|
||||
private String zdCode;
|
||||
/** 区划名称 */
|
||||
private String znName;
|
||||
/** 区划英文名 */
|
||||
private String znEname;
|
||||
/** 备注 */
|
||||
private String znNote;
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdAt;
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updatedAt;
|
||||
/** 国家数量(列表展示,非表字段) */
|
||||
private Integer countryCount;
|
||||
|
||||
public Long getZdId() { return zdId; }
|
||||
public void setZdId(Long zdId) { this.zdId = zdId; }
|
||||
public Long getZsId() { return zsId; }
|
||||
public void setZsId(Long zsId) { this.zsId = zsId; }
|
||||
public Integer getZdSort() { return zdSort; }
|
||||
public void setZdSort(Integer zdSort) { this.zdSort = zdSort; }
|
||||
public String getZdCode() { return zdCode; }
|
||||
public void setZdCode(String zdCode) { this.zdCode = zdCode; }
|
||||
public String getZnName() { return znName; }
|
||||
public void setZnName(String znName) { this.znName = znName; }
|
||||
public String getZnEname() { return znEname; }
|
||||
public void setZnEname(String znEname) { this.znEname = znEname; }
|
||||
public String getZnNote() { return znNote; }
|
||||
public void setZnNote(String znNote) { this.znNote = znNote; }
|
||||
public Date getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Date createdAt) { this.createdAt = createdAt; }
|
||||
public Date getUpdatedAt() { return updatedAt; }
|
||||
public void setUpdatedAt(Date updatedAt) { this.updatedAt = updatedAt; }
|
||||
public Integer getCountryCount() { return countryCount; }
|
||||
public void setCountryCount(Integer countryCount) { this.countryCount = countryCount; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("zdId", getZdId())
|
||||
.append("zsId", getZsId())
|
||||
.append("zdSort", getZdSort())
|
||||
.append("zdCode", getZdCode())
|
||||
.append("znName", getZnName())
|
||||
.append("znEname", getZnEname())
|
||||
.append("znNote", getZnNote())
|
||||
.append("createdAt", getCreatedAt())
|
||||
.append("updatedAt", getUpdatedAt())
|
||||
.append("countryCount", getCountryCount())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ruoyi.price.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 分区方案 xtd_zone_scheme
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class XtdZoneScheme extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 分区方案ID */
|
||||
private Long zsId;
|
||||
|
||||
/** 方案名称 */
|
||||
private String zsName;
|
||||
|
||||
/** 状态码(on/off) */
|
||||
private String ssCode;
|
||||
|
||||
/** 产品组代码 */
|
||||
private String pgCode;
|
||||
|
||||
/** 服务渠道ID */
|
||||
private Long snId;
|
||||
|
||||
/** 备注 */
|
||||
private String zsNote;
|
||||
|
||||
/** 租户ID */
|
||||
private Long tmsId;
|
||||
|
||||
/** 区划数量(列表展示,非表字段) */
|
||||
private Integer divisionCount;
|
||||
|
||||
public Long getZsId() { return zsId; }
|
||||
public void setZsId(Long zsId) { this.zsId = zsId; }
|
||||
public String getZsName() { return zsName; }
|
||||
public void setZsName(String zsName) { this.zsName = zsName; }
|
||||
public String getSsCode() { return ssCode; }
|
||||
public void setSsCode(String ssCode) { this.ssCode = ssCode; }
|
||||
public String getPgCode() { return pgCode; }
|
||||
public void setPgCode(String pgCode) { this.pgCode = pgCode; }
|
||||
public Long getSnId() { return snId; }
|
||||
public void setSnId(Long snId) { this.snId = snId; }
|
||||
public String getZsNote() { return zsNote; }
|
||||
public void setZsNote(String zsNote) { this.zsNote = zsNote; }
|
||||
public Long getTmsId() { return tmsId; }
|
||||
public void setTmsId(Long tmsId) { this.tmsId = tmsId; }
|
||||
public Integer getDivisionCount() { return divisionCount; }
|
||||
public void setDivisionCount(Integer divisionCount) { this.divisionCount = divisionCount; }
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("zsId", getZsId())
|
||||
.append("zsName", getZsName())
|
||||
.append("ssCode", getSsCode())
|
||||
.append("pgCode", getPgCode())
|
||||
.append("snId", getSnId())
|
||||
.append("zsNote", getZsNote())
|
||||
.append("tmsId", getTmsId())
|
||||
.append("divisionCount", getDivisionCount())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.price.domain.PrcCustomerPriceSet;
|
||||
|
||||
/**
|
||||
* 客户套餐 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcCustomerPriceSetMapper
|
||||
{
|
||||
public PrcCustomerPriceSet selectPrcCustomerPriceSetById(Long customerPricesetId);
|
||||
|
||||
public List<PrcCustomerPriceSet> selectPrcCustomerPriceSetList(PrcCustomerPriceSet customer);
|
||||
|
||||
public int insertPrcCustomerPriceSet(PrcCustomerPriceSet customer);
|
||||
|
||||
public int updatePrcCustomerPriceSet(PrcCustomerPriceSet customer);
|
||||
|
||||
public int deletePrcCustomerPriceSetByIds(Long[] customerPricesetIds);
|
||||
|
||||
public int deletePrcCustomerPriceSetByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countOverlap(@Param("customerId") Long customerId,
|
||||
@Param("priceSetId") Long priceSetId,
|
||||
@Param("beginDate") java.util.Date beginDate,
|
||||
@Param("endDate") java.util.Date endDate);
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcPriceSetDetail;
|
||||
|
||||
/**
|
||||
* 价格套餐明细 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcPriceSetDetailMapper
|
||||
{
|
||||
public PrcPriceSetDetail selectPrcPriceSetDetailById(Long psdId);
|
||||
|
||||
public List<PrcPriceSetDetail> selectPrcPriceSetDetailList(PrcPriceSetDetail detail);
|
||||
|
||||
public int insertPrcPriceSetDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int updatePrcPriceSetDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int deletePrcPriceSetDetailByIds(Long[] psdIds);
|
||||
|
||||
public int deletePrcPriceSetDetailByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countProductByPriceSetId(Long priceSetId);
|
||||
|
||||
public int countByPriceSetId(Long priceSetId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcPriceSet;
|
||||
|
||||
/**
|
||||
* 价格套餐 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcPriceSetMapper
|
||||
{
|
||||
public PrcPriceSet selectPrcPriceSetById(Long priceSetId);
|
||||
|
||||
public List<PrcPriceSet> selectPrcPriceSetList(PrcPriceSet set);
|
||||
|
||||
public int insertPrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int updatePrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int updatePrcPriceSetStatus(PrcPriceSet set);
|
||||
|
||||
public int deletePrcPriceSetByIds(Long[] priceSetIds);
|
||||
|
||||
public int countByName(PrcPriceSet set);
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionDetail;
|
||||
|
||||
/**
|
||||
* 重量段明细 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcWeightSectionDetailMapper
|
||||
{
|
||||
public PrcWeightSectionDetail selectPrcWeightSectionDetailById(Long wsdId);
|
||||
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailListByWstId(Long wstId);
|
||||
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailList(PrcWeightSectionDetail detail);
|
||||
|
||||
public int insertPrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int updatePrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int deletePrcWeightSectionDetailByIds(Long[] wsdIds);
|
||||
|
||||
public int countByWstId(Long wstId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionTemplate;
|
||||
|
||||
/**
|
||||
* 重量段模板 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface PrcWeightSectionTemplateMapper
|
||||
{
|
||||
public PrcWeightSectionTemplate selectPrcWeightSectionTemplateById(Long wstId);
|
||||
|
||||
public List<PrcWeightSectionTemplate> selectPrcWeightSectionTemplateList(PrcWeightSectionTemplate template);
|
||||
|
||||
public int insertPrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int updatePrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int deletePrcWeightSectionTemplateByIds(Long[] wstIds);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneCountry;
|
||||
|
||||
/**
|
||||
* 分区国家 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface XtdZoneCountryMapper
|
||||
{
|
||||
public XtdZoneCountry selectXtdZoneCountryById(Long zcId);
|
||||
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryListByZdId(Long zdId);
|
||||
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryList(XtdZoneCountry country);
|
||||
|
||||
public int insertXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int updateXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int deleteXtdZoneCountryByIds(Long[] zcIds);
|
||||
|
||||
public int countByZdId(Long zdId);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneDivision;
|
||||
|
||||
/**
|
||||
* 分区区划 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface XtdZoneDivisionMapper
|
||||
{
|
||||
public XtdZoneDivision selectXtdZoneDivisionById(Long zdId);
|
||||
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionListByZsId(Long zsId);
|
||||
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionList(XtdZoneDivision division);
|
||||
|
||||
public int insertXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int updateXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int deleteXtdZoneDivisionByIds(Long[] zdIds);
|
||||
|
||||
public int countByZsId(Long zsId);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneScheme;
|
||||
|
||||
/**
|
||||
* 分区方案 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface XtdZoneSchemeMapper
|
||||
{
|
||||
public XtdZoneScheme selectXtdZoneSchemeById(Long zsId);
|
||||
|
||||
public List<XtdZoneScheme> selectXtdZoneSchemeList(XtdZoneScheme scheme);
|
||||
|
||||
public int insertXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int updateXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int deleteXtdZoneSchemeByIds(Long[] zsIds);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcCustomerPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSetCheckItem;
|
||||
import com.ruoyi.price.domain.PrcPriceSetDetail;
|
||||
|
||||
/**
|
||||
* 价格套餐 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IPrcPriceSetService
|
||||
{
|
||||
public PrcPriceSet selectPrcPriceSetById(Long priceSetId);
|
||||
|
||||
public List<PrcPriceSet> selectPrcPriceSetList(PrcPriceSet set);
|
||||
|
||||
public Long savePrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int updatePrcPriceSet(PrcPriceSet set);
|
||||
|
||||
public int deletePrcPriceSetByIds(Long[] priceSetIds);
|
||||
|
||||
public int submit(Long priceSetId, String updateBy);
|
||||
|
||||
public int approve(Long priceSetId, String updateBy);
|
||||
|
||||
public int reject(Long priceSetId, String updateBy);
|
||||
|
||||
public int disable(Long priceSetId, String updateBy);
|
||||
|
||||
public Long copy(Long priceSetId, String createBy);
|
||||
|
||||
public List<PrcPriceSetCheckItem> validate(PrcPriceSet set);
|
||||
|
||||
public List<PrcPriceSetDetail> selectDetailList(PrcPriceSetDetail detail);
|
||||
|
||||
public int insertDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int updateDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int deleteDetailByIds(Long[] psdIds);
|
||||
|
||||
public List<PrcCustomerPriceSet> selectCustomerList(PrcCustomerPriceSet customer);
|
||||
|
||||
public int insertCustomer(PrcCustomerPriceSet customer);
|
||||
|
||||
public int updateCustomer(PrcCustomerPriceSet customer);
|
||||
|
||||
public int deleteCustomerByIds(Long[] customerPricesetIds);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.ruoyi.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionDetail;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionTemplate;
|
||||
|
||||
/**
|
||||
* 重量段管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IPrcWeightService
|
||||
{
|
||||
public PrcWeightSectionTemplate selectPrcWeightSectionTemplateById(Long wstId);
|
||||
|
||||
public List<PrcWeightSectionTemplate> selectPrcWeightSectionTemplateList(PrcWeightSectionTemplate template);
|
||||
|
||||
public int insertPrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int updatePrcWeightSectionTemplate(PrcWeightSectionTemplate template);
|
||||
|
||||
public int deletePrcWeightSectionTemplateByIds(Long[] wstIds);
|
||||
|
||||
public PrcWeightSectionDetail selectPrcWeightSectionDetailById(Long wsdId);
|
||||
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailList(PrcWeightSectionDetail detail);
|
||||
|
||||
public int insertPrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int updatePrcWeightSectionDetail(PrcWeightSectionDetail detail);
|
||||
|
||||
public int deletePrcWeightSectionDetailByIds(Long[] wsdIds);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.ruoyi.price.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.price.domain.XtdZoneCountry;
|
||||
import com.ruoyi.price.domain.XtdZoneDivision;
|
||||
import com.ruoyi.price.domain.XtdZoneScheme;
|
||||
|
||||
/**
|
||||
* 分区管理 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IXtdZoneService
|
||||
{
|
||||
public XtdZoneScheme selectXtdZoneSchemeById(Long zsId);
|
||||
|
||||
public List<XtdZoneScheme> selectXtdZoneSchemeList(XtdZoneScheme scheme);
|
||||
|
||||
public int insertXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int updateXtdZoneScheme(XtdZoneScheme scheme);
|
||||
|
||||
public int deleteXtdZoneSchemeByIds(Long[] zsIds);
|
||||
|
||||
public XtdZoneDivision selectXtdZoneDivisionById(Long zdId);
|
||||
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionList(XtdZoneDivision division);
|
||||
|
||||
public int insertXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int updateXtdZoneDivision(XtdZoneDivision division);
|
||||
|
||||
public int deleteXtdZoneDivisionByIds(Long[] zdIds);
|
||||
|
||||
public XtdZoneCountry selectXtdZoneCountryById(Long zcId);
|
||||
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryList(XtdZoneCountry country);
|
||||
|
||||
public int insertXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int updateXtdZoneCountry(XtdZoneCountry country);
|
||||
|
||||
public int deleteXtdZoneCountryByIds(Long[] zcIds);
|
||||
}
|
||||
+751
@@ -0,0 +1,751 @@
|
||||
package com.ruoyi.price.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.price.domain.PrcCustomerPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSetCheckItem;
|
||||
import com.ruoyi.price.domain.PrcPriceSetDetail;
|
||||
import com.ruoyi.price.mapper.PrcCustomerPriceSetMapper;
|
||||
import com.ruoyi.price.mapper.PrcPriceSetDetailMapper;
|
||||
import com.ruoyi.price.mapper.PrcPriceSetMapper;
|
||||
import com.ruoyi.price.service.IPrcPriceSetService;
|
||||
|
||||
/**
|
||||
* 价格套餐 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
{
|
||||
private static final String STATUS_DRAFT = "D";
|
||||
private static final String STATUS_AUDIT = "A";
|
||||
private static final String STATUS_EFFECT = "E";
|
||||
private static final String STATUS_REJECT = "R";
|
||||
private static final String STATUS_STOP = "S";
|
||||
private static final String TYPE_FIXED = "FIXED";
|
||||
private static final String TYPE_DISCOUNT = "DISCOUNT";
|
||||
|
||||
@Autowired
|
||||
private PrcPriceSetMapper setMapper;
|
||||
|
||||
@Autowired
|
||||
private PrcPriceSetDetailMapper detailMapper;
|
||||
|
||||
@Autowired
|
||||
private PrcCustomerPriceSetMapper customerMapper;
|
||||
|
||||
@Override
|
||||
public PrcPriceSet selectPrcPriceSetById(Long priceSetId)
|
||||
{
|
||||
PrcPriceSet set = setMapper.selectPrcPriceSetById(priceSetId);
|
||||
if (set != null)
|
||||
{
|
||||
fillExpired(set);
|
||||
PrcPriceSetDetail query = new PrcPriceSetDetail();
|
||||
query.setPriceSetId(priceSetId);
|
||||
set.setDetails(detailMapper.selectPrcPriceSetDetailList(query));
|
||||
PrcCustomerPriceSet cquery = new PrcCustomerPriceSet();
|
||||
cquery.setPriceSetId(priceSetId);
|
||||
set.setCustomers(customerMapper.selectPrcCustomerPriceSetList(cquery));
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcPriceSet> selectPrcPriceSetList(PrcPriceSet set)
|
||||
{
|
||||
List<PrcPriceSet> list = setMapper.selectPrcPriceSetList(set);
|
||||
for (PrcPriceSet item : list)
|
||||
{
|
||||
fillExpired(item);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long savePrcPriceSet(PrcPriceSet set)
|
||||
{
|
||||
validateBasic(set, false);
|
||||
if (set.getPriceSetId() == null)
|
||||
{
|
||||
if (StringUtils.isEmpty(set.getStatus()))
|
||||
{
|
||||
set.setStatus(STATUS_DRAFT);
|
||||
}
|
||||
if (!STATUS_DRAFT.equals(set.getStatus()) && !STATUS_AUDIT.equals(set.getStatus()))
|
||||
{
|
||||
set.setStatus(STATUS_DRAFT);
|
||||
}
|
||||
if (StringUtils.isEmpty(set.getSetType()))
|
||||
{
|
||||
set.setSetType(TYPE_FIXED);
|
||||
}
|
||||
setMapper.insertPrcPriceSet(set);
|
||||
if (StringUtils.isEmpty(set.getPriceSetCode()))
|
||||
{
|
||||
set.setPriceSetCode(String.format("SET%04d", set.getPriceSetId()));
|
||||
setMapper.updatePrcPriceSet(set);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PrcPriceSet db = requireSet(set.getPriceSetId());
|
||||
assertBasicEditable(db);
|
||||
set.setStatus(db.getStatus());
|
||||
setMapper.updatePrcPriceSet(set);
|
||||
}
|
||||
replaceChildren(set);
|
||||
if ("Y".equalsIgnoreCase(set.getSubmitFlag()))
|
||||
{
|
||||
submit(set.getPriceSetId(), set.getUpdateBy() != null ? set.getUpdateBy() : set.getCreateBy());
|
||||
}
|
||||
return set.getPriceSetId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrcPriceSet(PrcPriceSet set)
|
||||
{
|
||||
PrcPriceSet db = requireSet(set.getPriceSetId());
|
||||
assertBasicEditable(db);
|
||||
validateBasic(set, false);
|
||||
set.setStatus(db.getStatus());
|
||||
return setMapper.updatePrcPriceSet(set);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public int deletePrcPriceSetByIds(Long[] priceSetIds)
|
||||
{
|
||||
for (Long id : priceSetIds)
|
||||
{
|
||||
PrcPriceSet db = requireSet(id);
|
||||
if (!STATUS_DRAFT.equals(db.getStatus()) && !STATUS_REJECT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅草稿或驳回状态的套餐允许删除:" + displayName(db));
|
||||
}
|
||||
int bound = customerMapper.countByPriceSetId(id);
|
||||
if (bound > 0)
|
||||
{
|
||||
throw new ServiceException("套餐【" + displayName(db) + "】已绑定客户,请先解绑后再删除");
|
||||
}
|
||||
detailMapper.deletePrcPriceSetDetailByPriceSetId(id);
|
||||
}
|
||||
return setMapper.deletePrcPriceSetByIds(priceSetIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int submit(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_DRAFT.equals(db.getStatus()) && !STATUS_REJECT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("当前状态不允许提交审核");
|
||||
}
|
||||
PrcPriceSet payload = selectPrcPriceSetById(priceSetId);
|
||||
List<PrcPriceSetCheckItem> items = validate(payload);
|
||||
assertNoFail(items);
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_AUDIT);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int approve(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅审核中的套餐可以生效");
|
||||
}
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_EFFECT);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reject(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅审核中的套餐可以驳回");
|
||||
}
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_REJECT);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int disable(Long priceSetId, String updateBy)
|
||||
{
|
||||
PrcPriceSet db = requireSet(priceSetId);
|
||||
if (!STATUS_EFFECT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("仅生效中的套餐可以停用");
|
||||
}
|
||||
PrcPriceSet upd = new PrcPriceSet();
|
||||
upd.setPriceSetId(priceSetId);
|
||||
upd.setStatus(STATUS_STOP);
|
||||
upd.setUpdateBy(updateBy);
|
||||
return setMapper.updatePrcPriceSetStatus(upd);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long copy(Long priceSetId, String createBy)
|
||||
{
|
||||
PrcPriceSet src = selectPrcPriceSetById(priceSetId);
|
||||
if (src == null)
|
||||
{
|
||||
throw new ServiceException("套餐不存在");
|
||||
}
|
||||
PrcPriceSet copy = new PrcPriceSet();
|
||||
copy.setPriceSetName(src.getPriceSetName() + "-副本");
|
||||
copy.setPriceSetNote(src.getPriceSetNote());
|
||||
copy.setSetType(src.getSetType());
|
||||
copy.setDefaultDiscount(src.getDefaultDiscount());
|
||||
copy.setDefaultType(src.getDefaultType());
|
||||
copy.setCalculateSign(src.getCalculateSign());
|
||||
copy.setEffectiveDate(src.getEffectiveDate());
|
||||
copy.setExpireDate(src.getExpireDate());
|
||||
copy.setStatus(STATUS_DRAFT);
|
||||
copy.setTmsId(src.getTmsId());
|
||||
copy.setCreateBy(createBy);
|
||||
List<PrcPriceSetDetail> details = new ArrayList<PrcPriceSetDetail>();
|
||||
if (src.getDetails() != null)
|
||||
{
|
||||
for (PrcPriceSetDetail d : src.getDetails())
|
||||
{
|
||||
PrcPriceSetDetail nd = new PrcPriceSetDetail();
|
||||
nd.setProductCode(d.getProductCode());
|
||||
nd.setProductName(d.getProductName());
|
||||
nd.setCountryCode(d.getCountryCode());
|
||||
nd.setCountryName(d.getCountryName());
|
||||
nd.setZdId(d.getZdId());
|
||||
nd.setWsdId(d.getWsdId());
|
||||
nd.setWeightLabel(d.getWeightLabel());
|
||||
nd.setFvValue(d.getFvValue());
|
||||
nd.setFvRegistrationFee(d.getFvRegistrationFee());
|
||||
nd.setDiscountValue(d.getDiscountValue());
|
||||
nd.setPrId(d.getPrId());
|
||||
details.add(nd);
|
||||
}
|
||||
}
|
||||
copy.setDetails(details);
|
||||
copy.setCustomers(new ArrayList<PrcCustomerPriceSet>());
|
||||
return savePrcPriceSet(copy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcPriceSetCheckItem> validate(PrcPriceSet set)
|
||||
{
|
||||
List<PrcPriceSetCheckItem> items = new ArrayList<PrcPriceSetCheckItem>();
|
||||
if (set.getPriceSetId() != null && (set.getDetails() == null || set.getCustomers() == null))
|
||||
{
|
||||
PrcPriceSet db = selectPrcPriceSetById(set.getPriceSetId());
|
||||
if (db != null)
|
||||
{
|
||||
if (StringUtils.isEmpty(set.getPriceSetName()))
|
||||
{
|
||||
set.setPriceSetName(db.getPriceSetName());
|
||||
}
|
||||
if (set.getSetType() == null)
|
||||
{
|
||||
set.setSetType(db.getSetType());
|
||||
}
|
||||
if (set.getEffectiveDate() == null)
|
||||
{
|
||||
set.setEffectiveDate(db.getEffectiveDate());
|
||||
}
|
||||
if (set.getExpireDate() == null)
|
||||
{
|
||||
set.setExpireDate(db.getExpireDate());
|
||||
}
|
||||
if (set.getDefaultDiscount() == null)
|
||||
{
|
||||
set.setDefaultDiscount(db.getDefaultDiscount());
|
||||
}
|
||||
if (set.getDetails() == null)
|
||||
{
|
||||
set.setDetails(db.getDetails());
|
||||
}
|
||||
if (set.getCustomers() == null)
|
||||
{
|
||||
set.setCustomers(db.getCustomers());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int nameCount = setMapper.countByName(set);
|
||||
if (StringUtils.isEmpty(set.getPriceSetName()))
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("套餐名称是否重复", "FAIL", "套餐名称不能为空"));
|
||||
}
|
||||
else if (nameCount > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("套餐名称是否重复", "FAIL", "当前名称已被占用"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("套餐名称是否重复", "PASS", "当前名称未占用"));
|
||||
}
|
||||
|
||||
if (set.getEffectiveDate() == null)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("生效日期 ≤ 失效日期", "FAIL", "生效日期不能为空"));
|
||||
}
|
||||
else if (set.getExpireDate() != null && set.getEffectiveDate().after(set.getExpireDate()))
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("生效日期 ≤ 失效日期", "FAIL", "生效日期不能晚于失效日期"));
|
||||
}
|
||||
else
|
||||
{
|
||||
String msg = DateUtils.parseDateToStr("yyyy-MM-dd", set.getEffectiveDate())
|
||||
+ " ≤ "
|
||||
+ (set.getExpireDate() == null ? "长期" : DateUtils.parseDateToStr("yyyy-MM-dd", set.getExpireDate()));
|
||||
items.add(new PrcPriceSetCheckItem("生效日期 ≤ 失效日期", "PASS", msg));
|
||||
}
|
||||
|
||||
String setType = StringUtils.isEmpty(set.getSetType()) ? TYPE_FIXED : set.getSetType();
|
||||
List<PrcPriceSetDetail> details = filterDetails(set.getDetails());
|
||||
if (TYPE_FIXED.equals(setType))
|
||||
{
|
||||
int incomplete = 0;
|
||||
for (PrcPriceSetDetail d : details)
|
||||
{
|
||||
if (StringUtils.isEmpty(d.getProductCode()) || StringUtils.isEmpty(d.getCountryCode())
|
||||
|| (d.getWsdId() == null && StringUtils.isEmpty(d.getWeightLabel()))
|
||||
|| d.getFvValue() == null || d.getFvRegistrationFee() == null)
|
||||
{
|
||||
incomplete++;
|
||||
}
|
||||
}
|
||||
if (details.isEmpty())
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("FIXED 明细完整性", "FAIL", "固定价模式至少需要 1 条明细"));
|
||||
}
|
||||
else if (incomplete > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("FIXED 明细完整性", "FAIL", incomplete + " 条明细缺少产品/国家/重量段/运费/挂号费"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("FIXED 明细完整性", "PASS", details.size() + " 条明细,运费与挂号费均填写"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (set.getDefaultDiscount() == null
|
||||
|| set.getDefaultDiscount().compareTo(BigDecimal.ONE) < 0
|
||||
|| set.getDefaultDiscount().compareTo(new BigDecimal("99")) > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("DISCOUNT 默认折扣", "FAIL", "折扣模式默认折扣需在 1~99"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("DISCOUNT 默认折扣", "PASS", "默认折扣 " + set.getDefaultDiscount().stripTrailingZeros().toPlainString() + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> uniq = new HashSet<String>();
|
||||
boolean dup = false;
|
||||
for (PrcPriceSetDetail d : details)
|
||||
{
|
||||
String key;
|
||||
if (TYPE_FIXED.equals(setType))
|
||||
{
|
||||
key = nvl(d.getProductCode()) + "|" + nvl(d.getCountryCode()) + "|"
|
||||
+ (d.getWsdId() != null ? d.getWsdId() : nvl(d.getWeightLabel()));
|
||||
}
|
||||
else
|
||||
{
|
||||
key = nvl(d.getProductCode());
|
||||
}
|
||||
if (!uniq.add(key) && StringUtils.isNotEmpty(d.getProductCode()))
|
||||
{
|
||||
dup = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (dup)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("同产品同国家同重量段是否重复", "FAIL", "存在重复明细"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("同产品同国家同重量段是否重复", "PASS", "无重复明细"));
|
||||
}
|
||||
|
||||
List<PrcCustomerPriceSet> customers = filterCustomers(set.getCustomers());
|
||||
int overlap = 0;
|
||||
for (PrcCustomerPriceSet c : customers)
|
||||
{
|
||||
overlap += customerMapper.countOverlap(c.getCustomerId(), set.getPriceSetId(),
|
||||
c.getPrBegindate() != null ? c.getPrBegindate() : set.getEffectiveDate(),
|
||||
c.getPrEnddate() != null ? c.getPrEnddate() : set.getExpireDate());
|
||||
}
|
||||
if (overlap > 0)
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("与同客户现有套餐是否冲突", "WARN", "存在 " + overlap + " 条与已生效套餐日期重叠的客户绑定,可共存但需确认优先级"));
|
||||
}
|
||||
else if (customers.isEmpty())
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("与同客户现有套餐是否冲突", "INFO", "暂未绑定客户,可后续补充"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("与同客户现有套餐是否冲突", "PASS", "未发现与已生效套餐的日期重叠"));
|
||||
}
|
||||
|
||||
if (TYPE_FIXED.equals(setType) && !details.isEmpty())
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("运费单价 vs 默认等级价偏差", "INFO", "默认等级价对照将在计费试算上线后自动计算"));
|
||||
}
|
||||
else if (TYPE_DISCOUNT.equals(setType))
|
||||
{
|
||||
items.add(new PrcPriceSetCheckItem("运费单价 vs 默认等级价偏差", "INFO", "折扣模式按下单时默认等级价 × 折扣计费"));
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcPriceSetDetail> selectDetailList(PrcPriceSetDetail detail)
|
||||
{
|
||||
return detailMapper.selectPrcPriceSetDetailList(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertDetail(PrcPriceSetDetail detail)
|
||||
{
|
||||
PrcPriceSet db = requireSet(detail.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
validateDetail(db, detail);
|
||||
return detailMapper.insertPrcPriceSetDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDetail(PrcPriceSetDetail detail)
|
||||
{
|
||||
PrcPriceSetDetail old = detailMapper.selectPrcPriceSetDetailById(detail.getPsdId());
|
||||
if (old == null)
|
||||
{
|
||||
throw new ServiceException("套餐明细不存在");
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
detail.setPriceSetId(old.getPriceSetId());
|
||||
validateDetail(db, detail);
|
||||
return detailMapper.updatePrcPriceSetDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteDetailByIds(Long[] psdIds)
|
||||
{
|
||||
for (Long id : psdIds)
|
||||
{
|
||||
PrcPriceSetDetail old = detailMapper.selectPrcPriceSetDetailById(id);
|
||||
if (old == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
}
|
||||
return detailMapper.deletePrcPriceSetDetailByIds(psdIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcCustomerPriceSet> selectCustomerList(PrcCustomerPriceSet customer)
|
||||
{
|
||||
return customerMapper.selectPrcCustomerPriceSetList(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertCustomer(PrcCustomerPriceSet customer)
|
||||
{
|
||||
PrcPriceSet db = requireSet(customer.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
validateCustomer(customer, db);
|
||||
if (customer.getBindPriority() == null)
|
||||
{
|
||||
customer.setBindPriority(1);
|
||||
}
|
||||
return customerMapper.insertPrcCustomerPriceSet(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCustomer(PrcCustomerPriceSet customer)
|
||||
{
|
||||
PrcCustomerPriceSet old = customerMapper.selectPrcCustomerPriceSetById(customer.getCustomerPricesetId());
|
||||
if (old == null)
|
||||
{
|
||||
throw new ServiceException("客户绑定不存在");
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
assertChildEditable(db);
|
||||
customer.setPriceSetId(old.getPriceSetId());
|
||||
validateCustomer(customer, db);
|
||||
return customerMapper.updatePrcCustomerPriceSet(customer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteCustomerByIds(Long[] customerPricesetIds)
|
||||
{
|
||||
for (Long id : customerPricesetIds)
|
||||
{
|
||||
PrcCustomerPriceSet old = customerMapper.selectPrcCustomerPriceSetById(id);
|
||||
if (old == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PrcPriceSet db = requireSet(old.getPriceSetId());
|
||||
if (STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("审核中的套餐不允许解绑客户");
|
||||
}
|
||||
}
|
||||
return customerMapper.deletePrcCustomerPriceSetByIds(customerPricesetIds);
|
||||
}
|
||||
|
||||
private void replaceChildren(PrcPriceSet set)
|
||||
{
|
||||
if (set.getDetails() != null)
|
||||
{
|
||||
detailMapper.deletePrcPriceSetDetailByPriceSetId(set.getPriceSetId());
|
||||
for (PrcPriceSetDetail d : filterDetails(set.getDetails()))
|
||||
{
|
||||
validateDetail(set, d);
|
||||
d.setPsdId(null);
|
||||
d.setPriceSetId(set.getPriceSetId());
|
||||
detailMapper.insertPrcPriceSetDetail(d);
|
||||
}
|
||||
}
|
||||
if (set.getCustomers() != null)
|
||||
{
|
||||
customerMapper.deletePrcCustomerPriceSetByPriceSetId(set.getPriceSetId());
|
||||
for (PrcCustomerPriceSet c : filterCustomers(set.getCustomers()))
|
||||
{
|
||||
validateCustomer(c, set);
|
||||
c.setCustomerPricesetId(null);
|
||||
c.setPriceSetId(set.getPriceSetId());
|
||||
c.setCreateBy(set.getCreateBy());
|
||||
if (c.getBindPriority() == null)
|
||||
{
|
||||
c.setBindPriority(1);
|
||||
}
|
||||
customerMapper.insertPrcCustomerPriceSet(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBasic(PrcPriceSet set, boolean strictSubmit)
|
||||
{
|
||||
if (StringUtils.isEmpty(set.getPriceSetName()))
|
||||
{
|
||||
throw new ServiceException("套餐名称不能为空");
|
||||
}
|
||||
if (set.getEffectiveDate() == null)
|
||||
{
|
||||
throw new ServiceException("生效日期不能为空");
|
||||
}
|
||||
if (set.getExpireDate() != null && set.getEffectiveDate().after(set.getExpireDate()))
|
||||
{
|
||||
throw new ServiceException("生效日期不能晚于失效日期");
|
||||
}
|
||||
if (TYPE_DISCOUNT.equals(set.getSetType()))
|
||||
{
|
||||
if (set.getDefaultDiscount() == null
|
||||
|| set.getDefaultDiscount().compareTo(BigDecimal.ONE) < 0
|
||||
|| set.getDefaultDiscount().compareTo(new BigDecimal("99")) > 0)
|
||||
{
|
||||
throw new ServiceException("折扣模式默认折扣需在 1~99");
|
||||
}
|
||||
}
|
||||
if (setMapper.countByName(set) > 0)
|
||||
{
|
||||
throw new ServiceException("套餐名称已存在");
|
||||
}
|
||||
if (strictSubmit)
|
||||
{
|
||||
assertNoFail(validate(set));
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDetail(PrcPriceSet set, PrcPriceSetDetail detail)
|
||||
{
|
||||
if (StringUtils.isEmpty(detail.getProductCode()))
|
||||
{
|
||||
throw new ServiceException("明细产品代码不能为空");
|
||||
}
|
||||
if (TYPE_FIXED.equals(set.getSetType()))
|
||||
{
|
||||
if (StringUtils.isEmpty(detail.getCountryCode()))
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写国家");
|
||||
}
|
||||
if (detail.getWsdId() == null && StringUtils.isEmpty(detail.getWeightLabel()))
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写重量段");
|
||||
}
|
||||
if (detail.getFvValue() == null)
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写运费单价");
|
||||
}
|
||||
if (detail.getFvRegistrationFee() == null)
|
||||
{
|
||||
throw new ServiceException("固定价明细必须填写挂号费");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(detail.getCountryCode()))
|
||||
{
|
||||
detail.setCountryCode(detail.getCountryCode().toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
private void validateCustomer(PrcCustomerPriceSet customer, PrcPriceSet set)
|
||||
{
|
||||
if (customer.getCustomerId() == null || customer.getCustomerId().longValue() <= 0)
|
||||
{
|
||||
throw new ServiceException("客户ID不能为空");
|
||||
}
|
||||
if (customer.getPrBegindate() == null)
|
||||
{
|
||||
customer.setPrBegindate(set.getEffectiveDate());
|
||||
}
|
||||
if (customer.getPrBegindate() == null)
|
||||
{
|
||||
throw new ServiceException("客户绑定生效日期不能为空");
|
||||
}
|
||||
if (customer.getPrEnddate() != null && customer.getPrBegindate().after(customer.getPrEnddate()))
|
||||
{
|
||||
throw new ServiceException("客户绑定生效日期不能晚于失效日期");
|
||||
}
|
||||
if (customer.getBindPriority() != null && customer.getBindPriority().intValue() < 1)
|
||||
{
|
||||
throw new ServiceException("优先级必须大于等于 1");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertBasicEditable(PrcPriceSet db)
|
||||
{
|
||||
if (STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("审核中的套餐不允许修改");
|
||||
}
|
||||
if (STATUS_STOP.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("已停用的套餐不允许修改,请使用复用新建");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertChildEditable(PrcPriceSet db)
|
||||
{
|
||||
if (STATUS_AUDIT.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("审核中的套餐不允许改明细或客户");
|
||||
}
|
||||
if (STATUS_STOP.equals(db.getStatus()))
|
||||
{
|
||||
throw new ServiceException("已停用的套餐不允许改明细或客户");
|
||||
}
|
||||
}
|
||||
|
||||
private void assertNoFail(List<PrcPriceSetCheckItem> items)
|
||||
{
|
||||
for (PrcPriceSetCheckItem item : items)
|
||||
{
|
||||
if ("FAIL".equals(item.getResult()))
|
||||
{
|
||||
throw new ServiceException(item.getItem() + ":" + item.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private PrcPriceSet requireSet(Long priceSetId)
|
||||
{
|
||||
PrcPriceSet db = setMapper.selectPrcPriceSetById(priceSetId);
|
||||
if (db == null)
|
||||
{
|
||||
throw new ServiceException("套餐不存在");
|
||||
}
|
||||
return db;
|
||||
}
|
||||
|
||||
private void fillExpired(PrcPriceSet set)
|
||||
{
|
||||
Date today = DateUtils.parseDate(DateUtils.getDate());
|
||||
boolean expired = STATUS_EFFECT.equals(set.getStatus())
|
||||
&& set.getExpireDate() != null
|
||||
&& today != null
|
||||
&& set.getExpireDate().before(today);
|
||||
set.setExpired(Boolean.valueOf(expired));
|
||||
}
|
||||
|
||||
private List<PrcPriceSetDetail> filterDetails(List<PrcPriceSetDetail> details)
|
||||
{
|
||||
List<PrcPriceSetDetail> list = new ArrayList<PrcPriceSetDetail>();
|
||||
if (details == null)
|
||||
{
|
||||
return list;
|
||||
}
|
||||
for (PrcPriceSetDetail d : details)
|
||||
{
|
||||
if (d != null && StringUtils.isNotEmpty(d.getProductCode()))
|
||||
{
|
||||
list.add(d);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<PrcCustomerPriceSet> filterCustomers(List<PrcCustomerPriceSet> customers)
|
||||
{
|
||||
List<PrcCustomerPriceSet> list = new ArrayList<PrcCustomerPriceSet>();
|
||||
if (customers == null)
|
||||
{
|
||||
return list;
|
||||
}
|
||||
for (PrcCustomerPriceSet c : customers)
|
||||
{
|
||||
if (c != null && c.getCustomerId() != null && c.getCustomerId().longValue() > 0)
|
||||
{
|
||||
list.add(c);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private String displayName(PrcPriceSet set)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(set.getPriceSetCode()))
|
||||
{
|
||||
return set.getPriceSetCode() + " " + set.getPriceSetName();
|
||||
}
|
||||
return set.getPriceSetName();
|
||||
}
|
||||
|
||||
private String nvl(String val)
|
||||
{
|
||||
return val == null ? "" : val;
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.price.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionDetail;
|
||||
import com.ruoyi.price.domain.PrcWeightSectionTemplate;
|
||||
import com.ruoyi.price.mapper.PrcWeightSectionDetailMapper;
|
||||
import com.ruoyi.price.mapper.PrcWeightSectionTemplateMapper;
|
||||
import com.ruoyi.price.service.IPrcWeightService;
|
||||
|
||||
/**
|
||||
* 重量段管理 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class PrcWeightServiceImpl implements IPrcWeightService
|
||||
{
|
||||
@Autowired
|
||||
private PrcWeightSectionTemplateMapper templateMapper;
|
||||
|
||||
@Autowired
|
||||
private PrcWeightSectionDetailMapper detailMapper;
|
||||
|
||||
@Override
|
||||
public PrcWeightSectionTemplate selectPrcWeightSectionTemplateById(Long wstId)
|
||||
{
|
||||
PrcWeightSectionTemplate template = templateMapper.selectPrcWeightSectionTemplateById(wstId);
|
||||
if (template != null)
|
||||
{
|
||||
template.setDetailCount(detailMapper.countByWstId(wstId));
|
||||
}
|
||||
return template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcWeightSectionTemplate> selectPrcWeightSectionTemplateList(PrcWeightSectionTemplate template)
|
||||
{
|
||||
List<PrcWeightSectionTemplate> list = templateMapper.selectPrcWeightSectionTemplateList(template);
|
||||
for (PrcWeightSectionTemplate item : list)
|
||||
{
|
||||
item.setDetailCount(detailMapper.countByWstId(item.getWstId()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPrcWeightSectionTemplate(PrcWeightSectionTemplate template)
|
||||
{
|
||||
if (StringUtils.isEmpty(template.getSsCode()))
|
||||
{
|
||||
template.setSsCode("on");
|
||||
}
|
||||
return templateMapper.insertPrcWeightSectionTemplate(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrcWeightSectionTemplate(PrcWeightSectionTemplate template)
|
||||
{
|
||||
// ss_code=on 时仍允许编辑(当前阶段)
|
||||
return templateMapper.updatePrcWeightSectionTemplate(template);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePrcWeightSectionTemplateByIds(Long[] wstIds)
|
||||
{
|
||||
return templateMapper.deletePrcWeightSectionTemplateByIds(wstIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrcWeightSectionDetail selectPrcWeightSectionDetailById(Long wsdId)
|
||||
{
|
||||
return detailMapper.selectPrcWeightSectionDetailById(wsdId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcWeightSectionDetail> selectPrcWeightSectionDetailList(PrcWeightSectionDetail detail)
|
||||
{
|
||||
return detailMapper.selectPrcWeightSectionDetailList(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertPrcWeightSectionDetail(PrcWeightSectionDetail detail)
|
||||
{
|
||||
validateWeightRange(detail);
|
||||
return detailMapper.insertPrcWeightSectionDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePrcWeightSectionDetail(PrcWeightSectionDetail detail)
|
||||
{
|
||||
validateWeightRange(detail);
|
||||
return detailMapper.updatePrcWeightSectionDetail(detail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deletePrcWeightSectionDetailByIds(Long[] wsdIds)
|
||||
{
|
||||
return detailMapper.deletePrcWeightSectionDetailByIds(wsdIds);
|
||||
}
|
||||
|
||||
private void validateWeightRange(PrcWeightSectionDetail detail)
|
||||
{
|
||||
if (detail.getWlStartweight() == null || detail.getWlEndweight() == null)
|
||||
{
|
||||
throw new ServiceException("起始重量和结束重量不能为空");
|
||||
}
|
||||
if (detail.getWlStartweight().compareTo(detail.getWlEndweight()) >= 0)
|
||||
{
|
||||
throw new ServiceException("起始重量必须小于结束重量");
|
||||
}
|
||||
}
|
||||
}
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
package com.ruoyi.price.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.price.domain.XtdZoneCountry;
|
||||
import com.ruoyi.price.domain.XtdZoneDivision;
|
||||
import com.ruoyi.price.domain.XtdZoneScheme;
|
||||
import com.ruoyi.price.mapper.XtdZoneCountryMapper;
|
||||
import com.ruoyi.price.mapper.XtdZoneDivisionMapper;
|
||||
import com.ruoyi.price.mapper.XtdZoneSchemeMapper;
|
||||
import com.ruoyi.price.service.IXtdZoneService;
|
||||
|
||||
/**
|
||||
* 分区管理 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class XtdZoneServiceImpl implements IXtdZoneService
|
||||
{
|
||||
@Autowired
|
||||
private XtdZoneSchemeMapper schemeMapper;
|
||||
|
||||
@Autowired
|
||||
private XtdZoneDivisionMapper divisionMapper;
|
||||
|
||||
@Autowired
|
||||
private XtdZoneCountryMapper countryMapper;
|
||||
|
||||
@Override
|
||||
public XtdZoneScheme selectXtdZoneSchemeById(Long zsId)
|
||||
{
|
||||
XtdZoneScheme scheme = schemeMapper.selectXtdZoneSchemeById(zsId);
|
||||
if (scheme != null)
|
||||
{
|
||||
scheme.setDivisionCount(divisionMapper.countByZsId(zsId));
|
||||
}
|
||||
return scheme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XtdZoneScheme> selectXtdZoneSchemeList(XtdZoneScheme scheme)
|
||||
{
|
||||
List<XtdZoneScheme> list = schemeMapper.selectXtdZoneSchemeList(scheme);
|
||||
for (XtdZoneScheme item : list)
|
||||
{
|
||||
item.setDivisionCount(divisionMapper.countByZsId(item.getZsId()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertXtdZoneScheme(XtdZoneScheme scheme)
|
||||
{
|
||||
if (StringUtils.isEmpty(scheme.getSsCode()))
|
||||
{
|
||||
scheme.setSsCode("on");
|
||||
}
|
||||
return schemeMapper.insertXtdZoneScheme(scheme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateXtdZoneScheme(XtdZoneScheme scheme)
|
||||
{
|
||||
return schemeMapper.updateXtdZoneScheme(scheme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteXtdZoneSchemeByIds(Long[] zsIds)
|
||||
{
|
||||
for (Long zsId : zsIds)
|
||||
{
|
||||
int count = divisionMapper.countByZsId(zsId);
|
||||
if (count > 0)
|
||||
{
|
||||
XtdZoneScheme scheme = schemeMapper.selectXtdZoneSchemeById(zsId);
|
||||
String name = scheme != null ? scheme.getZsName() : String.valueOf(zsId);
|
||||
throw new ServiceException("分区方案【" + name + "】存在区划明细,不允许删除");
|
||||
}
|
||||
}
|
||||
return schemeMapper.deleteXtdZoneSchemeByIds(zsIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XtdZoneDivision selectXtdZoneDivisionById(Long zdId)
|
||||
{
|
||||
XtdZoneDivision division = divisionMapper.selectXtdZoneDivisionById(zdId);
|
||||
if (division != null)
|
||||
{
|
||||
division.setCountryCount(countryMapper.countByZdId(zdId));
|
||||
}
|
||||
return division;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XtdZoneDivision> selectXtdZoneDivisionList(XtdZoneDivision division)
|
||||
{
|
||||
List<XtdZoneDivision> list = divisionMapper.selectXtdZoneDivisionList(division);
|
||||
for (XtdZoneDivision item : list)
|
||||
{
|
||||
item.setCountryCount(countryMapper.countByZdId(item.getZdId()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertXtdZoneDivision(XtdZoneDivision division)
|
||||
{
|
||||
return divisionMapper.insertXtdZoneDivision(division);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateXtdZoneDivision(XtdZoneDivision division)
|
||||
{
|
||||
return divisionMapper.updateXtdZoneDivision(division);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteXtdZoneDivisionByIds(Long[] zdIds)
|
||||
{
|
||||
return divisionMapper.deleteXtdZoneDivisionByIds(zdIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XtdZoneCountry selectXtdZoneCountryById(Long zcId)
|
||||
{
|
||||
return countryMapper.selectXtdZoneCountryById(zcId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<XtdZoneCountry> selectXtdZoneCountryList(XtdZoneCountry country)
|
||||
{
|
||||
return countryMapper.selectXtdZoneCountryList(country);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertXtdZoneCountry(XtdZoneCountry country)
|
||||
{
|
||||
if (StringUtils.isEmpty(country.getZcDividekind()))
|
||||
{
|
||||
country.setZcDividekind("C");
|
||||
}
|
||||
return countryMapper.insertXtdZoneCountry(country);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateXtdZoneCountry(XtdZoneCountry country)
|
||||
{
|
||||
return countryMapper.updateXtdZoneCountry(country);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteXtdZoneCountryByIds(Long[] zcIds)
|
||||
{
|
||||
return countryMapper.deleteXtdZoneCountryByIds(zcIds);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.PrcCustomerPriceSetMapper">
|
||||
|
||||
<resultMap type="PrcCustomerPriceSet" id="PrcCustomerPriceSetResult">
|
||||
<id property="customerPricesetId" column="customer_priceset_id" />
|
||||
<result property="priceSetId" column="price_set_id" />
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="bindPriority" column="bind_priority" />
|
||||
<result property="prBegindate" column="pr_begindate" />
|
||||
<result property="prEnddate" column="pr_enddate" />
|
||||
<result property="priceSetNote" column="price_set_note" />
|
||||
<result property="createBy" column="created_by" />
|
||||
<result property="createTime" column="created_at" />
|
||||
<result property="updateBy" column="updated_by" />
|
||||
<result property="updateTime" column="updated_at" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPrcCustomerPriceSetVo">
|
||||
select customer_priceset_id, price_set_id, customer_id, customer_name, bind_priority,
|
||||
pr_begindate, pr_enddate, price_set_note,
|
||||
created_by, created_at, updated_by, updated_at
|
||||
from prc_customer_price_set
|
||||
</sql>
|
||||
|
||||
<select id="selectPrcCustomerPriceSetById" parameterType="Long" resultMap="PrcCustomerPriceSetResult">
|
||||
<include refid="selectPrcCustomerPriceSetVo"/>
|
||||
where customer_priceset_id = #{customerPricesetId}
|
||||
</select>
|
||||
|
||||
<select id="selectPrcCustomerPriceSetList" parameterType="PrcCustomerPriceSet" resultMap="PrcCustomerPriceSetResult">
|
||||
<include refid="selectPrcCustomerPriceSetVo"/>
|
||||
<where>
|
||||
<if test="priceSetId != null">
|
||||
AND price_set_id = #{priceSetId}
|
||||
</if>
|
||||
<if test="customerId != null">
|
||||
AND customer_id = #{customerId}
|
||||
</if>
|
||||
<if test="customerName != null and customerName != ''">
|
||||
AND customer_name like concat('%', #{customerName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
order by bind_priority asc, customer_priceset_id asc
|
||||
</select>
|
||||
|
||||
<select id="countByPriceSetId" parameterType="Long" resultType="int">
|
||||
select count(1) from prc_customer_price_set where price_set_id = #{priceSetId}
|
||||
</select>
|
||||
|
||||
<select id="countOverlap" resultType="int">
|
||||
select count(1)
|
||||
from prc_customer_price_set c
|
||||
inner join prc_price_set s on s.price_set_id = c.price_set_id
|
||||
where c.customer_id = #{customerId}
|
||||
and s.status = 'E'
|
||||
<if test="priceSetId != null">
|
||||
AND c.price_set_id <> #{priceSetId}
|
||||
</if>
|
||||
and c.pr_begindate <= ifnull(#{endDate}, '9999-12-31')
|
||||
and ifnull(c.pr_enddate, '9999-12-31') >= #{beginDate}
|
||||
</select>
|
||||
|
||||
<insert id="insertPrcCustomerPriceSet" parameterType="PrcCustomerPriceSet" useGeneratedKeys="true" keyProperty="customerPricesetId">
|
||||
insert into prc_customer_price_set (
|
||||
<if test="priceSetId != null">price_set_id,</if>
|
||||
<if test="customerId != null">customer_id,</if>
|
||||
<if test="customerName != null">customer_name,</if>
|
||||
<if test="bindPriority != null">bind_priority,</if>
|
||||
<if test="prBegindate != null">pr_begindate,</if>
|
||||
<if test="prEnddate != null">pr_enddate,</if>
|
||||
<if test="priceSetNote != null">price_set_note,</if>
|
||||
<if test="createBy != null and createBy != ''">created_by,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="priceSetId != null">#{priceSetId},</if>
|
||||
<if test="customerId != null">#{customerId},</if>
|
||||
<if test="customerName != null">#{customerName},</if>
|
||||
<if test="bindPriority != null">#{bindPriority},</if>
|
||||
<if test="prBegindate != null">#{prBegindate},</if>
|
||||
<if test="prEnddate != null">#{prEnddate},</if>
|
||||
<if test="priceSetNote != null">#{priceSetNote},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePrcCustomerPriceSet" parameterType="PrcCustomerPriceSet">
|
||||
update prc_customer_price_set
|
||||
<set>
|
||||
<if test="customerId != null">customer_id = #{customerId},</if>
|
||||
<if test="customerName != null">customer_name = #{customerName},</if>
|
||||
<if test="bindPriority != null">bind_priority = #{bindPriority},</if>
|
||||
<if test="prBegindate != null">pr_begindate = #{prBegindate},</if>
|
||||
pr_enddate = #{prEnddate},
|
||||
<if test="priceSetNote != null">price_set_note = #{priceSetNote},</if>
|
||||
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where customer_priceset_id = #{customerPricesetId}
|
||||
</update>
|
||||
|
||||
<delete id="deletePrcCustomerPriceSetByIds" parameterType="Long">
|
||||
delete from prc_customer_price_set where customer_priceset_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deletePrcCustomerPriceSetByPriceSetId" parameterType="Long">
|
||||
delete from prc_customer_price_set where price_set_id = #{priceSetId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.PrcPriceSetDetailMapper">
|
||||
|
||||
<resultMap type="PrcPriceSetDetail" id="PrcPriceSetDetailResult">
|
||||
<id property="psdId" column="psd_id" />
|
||||
<result property="priceSetId" column="price_set_id" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="countryCode" column="country_code" />
|
||||
<result property="countryName" column="country_name" />
|
||||
<result property="zdId" column="zd_id" />
|
||||
<result property="wsdId" column="wsd_id" />
|
||||
<result property="weightLabel" column="weight_label" />
|
||||
<result property="fvValue" column="fv_value" />
|
||||
<result property="fvRegistrationFee" column="fv_registration_fee" />
|
||||
<result property="discountValue" column="discount_value" />
|
||||
<result property="prId" column="pr_id" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPrcPriceSetDetailVo">
|
||||
select psd_id, price_set_id, product_code, product_name, country_code, country_name,
|
||||
zd_id, wsd_id, weight_label, fv_value, fv_registration_fee, discount_value,
|
||||
pr_id, created_at, updated_at
|
||||
from prc_price_set_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectPrcPriceSetDetailById" parameterType="Long" resultMap="PrcPriceSetDetailResult">
|
||||
<include refid="selectPrcPriceSetDetailVo"/>
|
||||
where psd_id = #{psdId}
|
||||
</select>
|
||||
|
||||
<select id="selectPrcPriceSetDetailList" parameterType="PrcPriceSetDetail" resultMap="PrcPriceSetDetailResult">
|
||||
<include refid="selectPrcPriceSetDetailVo"/>
|
||||
<where>
|
||||
<if test="priceSetId != null">
|
||||
AND price_set_id = #{priceSetId}
|
||||
</if>
|
||||
<if test="productCode != null and productCode != ''">
|
||||
AND product_code = #{productCode}
|
||||
</if>
|
||||
<if test="countryCode != null and countryCode != ''">
|
||||
AND country_code = #{countryCode}
|
||||
</if>
|
||||
</where>
|
||||
order by psd_id asc
|
||||
</select>
|
||||
|
||||
<select id="countProductByPriceSetId" parameterType="Long" resultType="int">
|
||||
select count(distinct product_code) from prc_price_set_detail where price_set_id = #{priceSetId}
|
||||
</select>
|
||||
|
||||
<select id="countByPriceSetId" parameterType="Long" resultType="int">
|
||||
select count(1) from prc_price_set_detail where price_set_id = #{priceSetId}
|
||||
</select>
|
||||
|
||||
<insert id="insertPrcPriceSetDetail" parameterType="PrcPriceSetDetail" useGeneratedKeys="true" keyProperty="psdId">
|
||||
insert into prc_price_set_detail (
|
||||
<if test="priceSetId != null">price_set_id,</if>
|
||||
<if test="productCode != null and productCode != ''">product_code,</if>
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="countryCode != null">country_code,</if>
|
||||
<if test="countryName != null">country_name,</if>
|
||||
<if test="zdId != null">zd_id,</if>
|
||||
<if test="wsdId != null">wsd_id,</if>
|
||||
<if test="weightLabel != null">weight_label,</if>
|
||||
<if test="fvValue != null">fv_value,</if>
|
||||
<if test="fvRegistrationFee != null">fv_registration_fee,</if>
|
||||
<if test="discountValue != null">discount_value,</if>
|
||||
<if test="prId != null">pr_id,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="priceSetId != null">#{priceSetId},</if>
|
||||
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="countryCode != null">#{countryCode},</if>
|
||||
<if test="countryName != null">#{countryName},</if>
|
||||
<if test="zdId != null">#{zdId},</if>
|
||||
<if test="wsdId != null">#{wsdId},</if>
|
||||
<if test="weightLabel != null">#{weightLabel},</if>
|
||||
<if test="fvValue != null">#{fvValue},</if>
|
||||
<if test="fvRegistrationFee != null">#{fvRegistrationFee},</if>
|
||||
<if test="discountValue != null">#{discountValue},</if>
|
||||
<if test="prId != null">#{prId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePrcPriceSetDetail" parameterType="PrcPriceSetDetail">
|
||||
update prc_price_set_detail
|
||||
<set>
|
||||
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
country_code = #{countryCode},
|
||||
country_name = #{countryName},
|
||||
zd_id = #{zdId},
|
||||
wsd_id = #{wsdId},
|
||||
weight_label = #{weightLabel},
|
||||
fv_value = #{fvValue},
|
||||
fv_registration_fee = #{fvRegistrationFee},
|
||||
discount_value = #{discountValue},
|
||||
pr_id = #{prId},
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where psd_id = #{psdId}
|
||||
</update>
|
||||
|
||||
<delete id="deletePrcPriceSetDetailByIds" parameterType="Long">
|
||||
delete from prc_price_set_detail where psd_id in
|
||||
<foreach item="psdId" collection="array" open="(" separator="," close=")">
|
||||
#{psdId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deletePrcPriceSetDetailByPriceSetId" parameterType="Long">
|
||||
delete from prc_price_set_detail where price_set_id = #{priceSetId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.PrcPriceSetMapper">
|
||||
|
||||
<resultMap type="PrcPriceSet" id="PrcPriceSetResult">
|
||||
<id property="priceSetId" column="price_set_id" />
|
||||
<result property="priceSetCode" column="price_set_code" />
|
||||
<result property="priceSetName" column="price_set_name" />
|
||||
<result property="priceSetNote" column="price_set_note" />
|
||||
<result property="setType" column="set_type" />
|
||||
<result property="defaultDiscount" column="default_discount" />
|
||||
<result property="defaultType" column="default_type" />
|
||||
<result property="calculateSign" column="calculate_sign" />
|
||||
<result property="effectiveDate" column="effective_date" />
|
||||
<result property="expireDate" column="expire_date" />
|
||||
<result property="status" column="status" />
|
||||
<result property="tmsId" column="tms_id" />
|
||||
<result property="createBy" column="created_by" />
|
||||
<result property="createTime" column="created_at" />
|
||||
<result property="updateBy" column="updated_by" />
|
||||
<result property="updateTime" column="updated_at" />
|
||||
<result property="productCount" column="product_count" />
|
||||
<result property="customerCount" column="customer_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPrcPriceSetVo">
|
||||
select s.price_set_id, s.price_set_code, s.price_set_name, s.price_set_note,
|
||||
s.set_type, s.default_discount, s.default_type, s.calculate_sign,
|
||||
s.effective_date, s.expire_date, s.status, s.tms_id,
|
||||
s.created_by, s.created_at, s.updated_by, s.updated_at,
|
||||
(select count(distinct d.product_code) from prc_price_set_detail d where d.price_set_id = s.price_set_id) as product_count,
|
||||
(select count(1) from prc_customer_price_set c where c.price_set_id = s.price_set_id) as customer_count
|
||||
from prc_price_set s
|
||||
</sql>
|
||||
|
||||
<select id="selectPrcPriceSetById" parameterType="Long" resultMap="PrcPriceSetResult">
|
||||
<include refid="selectPrcPriceSetVo"/>
|
||||
where s.price_set_id = #{priceSetId}
|
||||
</select>
|
||||
|
||||
<select id="selectPrcPriceSetList" parameterType="PrcPriceSet" resultMap="PrcPriceSetResult">
|
||||
<include refid="selectPrcPriceSetVo"/>
|
||||
<where>
|
||||
<if test="setType != null and setType != ''">
|
||||
AND s.set_type = #{setType}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND s.status = #{status}
|
||||
</if>
|
||||
<if test="tmsId != null">
|
||||
AND s.tms_id = #{tmsId}
|
||||
</if>
|
||||
<if test="priceSetName != null and priceSetName != ''">
|
||||
AND s.price_set_name like concat('%', #{priceSetName}, '%')
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
AND (
|
||||
s.price_set_code like concat('%', #{keyword}, '%')
|
||||
OR s.price_set_name like concat('%', #{keyword}, '%')
|
||||
OR exists (
|
||||
select 1 from prc_customer_price_set c
|
||||
where c.price_set_id = s.price_set_id
|
||||
and (
|
||||
c.customer_name like concat('%', #{keyword}, '%')
|
||||
or concat(c.customer_id, '') like concat('%', #{keyword}, '%')
|
||||
)
|
||||
)
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by s.price_set_id desc
|
||||
</select>
|
||||
|
||||
<select id="countByName" parameterType="PrcPriceSet" resultType="int">
|
||||
select count(1) from prc_price_set
|
||||
where price_set_name = #{priceSetName}
|
||||
<if test="priceSetId != null">
|
||||
AND price_set_id <> #{priceSetId}
|
||||
</if>
|
||||
<if test="tmsId != null">
|
||||
AND tms_id = #{tmsId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertPrcPriceSet" parameterType="PrcPriceSet" useGeneratedKeys="true" keyProperty="priceSetId">
|
||||
insert into prc_price_set (
|
||||
<if test="priceSetCode != null and priceSetCode != ''">price_set_code,</if>
|
||||
<if test="priceSetName != null and priceSetName != ''">price_set_name,</if>
|
||||
<if test="priceSetNote != null">price_set_note,</if>
|
||||
<if test="setType != null and setType != ''">set_type,</if>
|
||||
<if test="defaultDiscount != null">default_discount,</if>
|
||||
<if test="defaultType != null">default_type,</if>
|
||||
<if test="calculateSign != null">calculate_sign,</if>
|
||||
<if test="effectiveDate != null">effective_date,</if>
|
||||
<if test="expireDate != null">expire_date,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="tmsId != null">tms_id,</if>
|
||||
<if test="createBy != null and createBy != ''">created_by,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="priceSetCode != null and priceSetCode != ''">#{priceSetCode},</if>
|
||||
<if test="priceSetName != null and priceSetName != ''">#{priceSetName},</if>
|
||||
<if test="priceSetNote != null">#{priceSetNote},</if>
|
||||
<if test="setType != null and setType != ''">#{setType},</if>
|
||||
<if test="defaultDiscount != null">#{defaultDiscount},</if>
|
||||
<if test="defaultType != null">#{defaultType},</if>
|
||||
<if test="calculateSign != null">#{calculateSign},</if>
|
||||
<if test="effectiveDate != null">#{effectiveDate},</if>
|
||||
<if test="expireDate != null">#{expireDate},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="tmsId != null">#{tmsId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePrcPriceSet" parameterType="PrcPriceSet">
|
||||
update prc_price_set
|
||||
<set>
|
||||
<if test="priceSetCode != null and priceSetCode != ''">price_set_code = #{priceSetCode},</if>
|
||||
<if test="priceSetName != null and priceSetName != ''">price_set_name = #{priceSetName},</if>
|
||||
<if test="priceSetNote != null">price_set_note = #{priceSetNote},</if>
|
||||
<if test="setType != null and setType != ''">set_type = #{setType},</if>
|
||||
default_discount = #{defaultDiscount},
|
||||
<if test="defaultType != null">default_type = #{defaultType},</if>
|
||||
<if test="calculateSign != null">calculate_sign = #{calculateSign},</if>
|
||||
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
|
||||
expire_date = #{expireDate},
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="tmsId != null">tms_id = #{tmsId},</if>
|
||||
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where price_set_id = #{priceSetId}
|
||||
</update>
|
||||
|
||||
<update id="updatePrcPriceSetStatus" parameterType="PrcPriceSet">
|
||||
update prc_price_set
|
||||
<set>
|
||||
status = #{status},
|
||||
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where price_set_id = #{priceSetId}
|
||||
</update>
|
||||
|
||||
<delete id="deletePrcPriceSetByIds" parameterType="Long">
|
||||
delete from prc_price_set where price_set_id in
|
||||
<foreach item="priceSetId" collection="array" open="(" separator="," close=")">
|
||||
#{priceSetId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.PrcWeightSectionDetailMapper">
|
||||
|
||||
<resultMap type="PrcWeightSectionDetail" id="PrcWeightSectionDetailResult">
|
||||
<id property="wsdId" column="wsd_id" />
|
||||
<result property="wstId" column="wst_id" />
|
||||
<result property="wlTitle" column="wl_title" />
|
||||
<result property="wlStartweight" column="wl_startweight" />
|
||||
<result property="wlEndweight" column="wl_endweight" />
|
||||
<result property="weightBillingCode" column="weight_billing_code" />
|
||||
<result property="fvUnitweight" column="fv_unitweight" />
|
||||
<result property="effectiveDate" column="effective_date" />
|
||||
<result property="expireDate" column="expire_date" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPrcWeightSectionDetailVo">
|
||||
select wsd_id, wst_id, wl_title, wl_startweight, wl_endweight, weight_billing_code,
|
||||
fv_unitweight, effective_date, expire_date, created_at, updated_at
|
||||
from prc_weight_section_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectPrcWeightSectionDetailById" parameterType="Long" resultMap="PrcWeightSectionDetailResult">
|
||||
<include refid="selectPrcWeightSectionDetailVo"/>
|
||||
where wsd_id = #{wsdId}
|
||||
</select>
|
||||
|
||||
<select id="selectPrcWeightSectionDetailListByWstId" parameterType="Long" resultMap="PrcWeightSectionDetailResult">
|
||||
<include refid="selectPrcWeightSectionDetailVo"/>
|
||||
where wst_id = #{wstId}
|
||||
order by wl_startweight asc, wsd_id asc
|
||||
</select>
|
||||
|
||||
<select id="selectPrcWeightSectionDetailList" parameterType="PrcWeightSectionDetail" resultMap="PrcWeightSectionDetailResult">
|
||||
<include refid="selectPrcWeightSectionDetailVo"/>
|
||||
<where>
|
||||
<if test="wstId != null">
|
||||
AND wst_id = #{wstId}
|
||||
</if>
|
||||
<if test="wlTitle != null and wlTitle != ''">
|
||||
AND wl_title like concat('%', #{wlTitle}, '%')
|
||||
</if>
|
||||
<if test="weightBillingCode != null and weightBillingCode != ''">
|
||||
AND weight_billing_code = #{weightBillingCode}
|
||||
</if>
|
||||
</where>
|
||||
order by wl_startweight asc, wsd_id asc
|
||||
</select>
|
||||
|
||||
<select id="countByWstId" parameterType="Long" resultType="int">
|
||||
select count(1) from prc_weight_section_detail where wst_id = #{wstId}
|
||||
</select>
|
||||
|
||||
<insert id="insertPrcWeightSectionDetail" parameterType="PrcWeightSectionDetail" useGeneratedKeys="true" keyProperty="wsdId">
|
||||
insert into prc_weight_section_detail (
|
||||
<if test="wstId != null">wst_id,</if>
|
||||
<if test="wlTitle != null">wl_title,</if>
|
||||
<if test="wlStartweight != null">wl_startweight,</if>
|
||||
<if test="wlEndweight != null">wl_endweight,</if>
|
||||
<if test="weightBillingCode != null">weight_billing_code,</if>
|
||||
<if test="fvUnitweight != null">fv_unitweight,</if>
|
||||
<if test="effectiveDate != null">effective_date,</if>
|
||||
<if test="expireDate != null">expire_date,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="wstId != null">#{wstId},</if>
|
||||
<if test="wlTitle != null">#{wlTitle},</if>
|
||||
<if test="wlStartweight != null">#{wlStartweight},</if>
|
||||
<if test="wlEndweight != null">#{wlEndweight},</if>
|
||||
<if test="weightBillingCode != null">#{weightBillingCode},</if>
|
||||
<if test="fvUnitweight != null">#{fvUnitweight},</if>
|
||||
<if test="effectiveDate != null">#{effectiveDate},</if>
|
||||
<if test="expireDate != null">#{expireDate},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePrcWeightSectionDetail" parameterType="PrcWeightSectionDetail">
|
||||
update prc_weight_section_detail
|
||||
<set>
|
||||
<if test="wstId != null">wst_id = #{wstId},</if>
|
||||
<if test="wlTitle != null">wl_title = #{wlTitle},</if>
|
||||
<if test="wlStartweight != null">wl_startweight = #{wlStartweight},</if>
|
||||
<if test="wlEndweight != null">wl_endweight = #{wlEndweight},</if>
|
||||
<if test="weightBillingCode != null">weight_billing_code = #{weightBillingCode},</if>
|
||||
<if test="fvUnitweight != null">fv_unitweight = #{fvUnitweight},</if>
|
||||
<if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
|
||||
<if test="expireDate != null">expire_date = #{expireDate},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where wsd_id = #{wsdId}
|
||||
</update>
|
||||
|
||||
<delete id="deletePrcWeightSectionDetailByIds" parameterType="Long">
|
||||
delete from prc_weight_section_detail where wsd_id in
|
||||
<foreach item="wsdId" collection="array" open="(" separator="," close=")">
|
||||
#{wsdId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.PrcWeightSectionTemplateMapper">
|
||||
|
||||
<resultMap type="PrcWeightSectionTemplate" id="PrcWeightSectionTemplateResult">
|
||||
<id property="wstId" column="wst_id" />
|
||||
<result property="wstName" column="wst_name" />
|
||||
<result property="ssCode" column="ss_code" />
|
||||
<result property="pgCode" column="pg_code" />
|
||||
<result property="snId" column="sn_id" />
|
||||
<result property="ctCode" column="ct_code" />
|
||||
<result property="pmCode" column="pm_code" />
|
||||
<result property="wstNote" column="wst_note" />
|
||||
<result property="tmsId" column="tms_id" />
|
||||
<result property="createBy" column="created_by" />
|
||||
<result property="createTime" column="created_at" />
|
||||
<result property="updateBy" column="updated_by" />
|
||||
<result property="updateTime" column="updated_at" />
|
||||
<result property="detailCount" column="detail_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPrcWeightSectionTemplateVo">
|
||||
select wst_id, wst_name, ss_code, pg_code, sn_id, ct_code, pm_code, wst_note, tms_id,
|
||||
created_by, created_at, updated_by, updated_at
|
||||
from prc_weight_section_template
|
||||
</sql>
|
||||
|
||||
<select id="selectPrcWeightSectionTemplateById" parameterType="Long" resultMap="PrcWeightSectionTemplateResult">
|
||||
<include refid="selectPrcWeightSectionTemplateVo"/>
|
||||
where wst_id = #{wstId}
|
||||
</select>
|
||||
|
||||
<select id="selectPrcWeightSectionTemplateList" parameterType="PrcWeightSectionTemplate" resultMap="PrcWeightSectionTemplateResult">
|
||||
<include refid="selectPrcWeightSectionTemplateVo"/>
|
||||
<where>
|
||||
<if test="wstName != null and wstName != ''">
|
||||
AND wst_name like concat('%', #{wstName}, '%')
|
||||
</if>
|
||||
<if test="ssCode != null and ssCode != ''">
|
||||
AND ss_code = #{ssCode}
|
||||
</if>
|
||||
<if test="pgCode != null and pgCode != ''">
|
||||
AND pg_code = #{pgCode}
|
||||
</if>
|
||||
<if test="snId != null">
|
||||
AND sn_id = #{snId}
|
||||
</if>
|
||||
<if test="ctCode != null and ctCode != ''">
|
||||
AND ct_code = #{ctCode}
|
||||
</if>
|
||||
<if test="pmCode != null and pmCode != ''">
|
||||
AND pm_code = #{pmCode}
|
||||
</if>
|
||||
<if test="tmsId != null">
|
||||
AND tms_id = #{tmsId}
|
||||
</if>
|
||||
</where>
|
||||
order by wst_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertPrcWeightSectionTemplate" parameterType="PrcWeightSectionTemplate" useGeneratedKeys="true" keyProperty="wstId">
|
||||
insert into prc_weight_section_template (
|
||||
<if test="wstName != null and wstName != ''">wst_name,</if>
|
||||
<if test="ssCode != null and ssCode != ''">ss_code,</if>
|
||||
<if test="pgCode != null">pg_code,</if>
|
||||
<if test="snId != null">sn_id,</if>
|
||||
<if test="ctCode != null">ct_code,</if>
|
||||
<if test="pmCode != null">pm_code,</if>
|
||||
<if test="wstNote != null">wst_note,</if>
|
||||
<if test="tmsId != null">tms_id,</if>
|
||||
<if test="createBy != null and createBy != ''">created_by,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="wstName != null and wstName != ''">#{wstName},</if>
|
||||
<if test="ssCode != null and ssCode != ''">#{ssCode},</if>
|
||||
<if test="pgCode != null">#{pgCode},</if>
|
||||
<if test="snId != null">#{snId},</if>
|
||||
<if test="ctCode != null">#{ctCode},</if>
|
||||
<if test="pmCode != null">#{pmCode},</if>
|
||||
<if test="wstNote != null">#{wstNote},</if>
|
||||
<if test="tmsId != null">#{tmsId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePrcWeightSectionTemplate" parameterType="PrcWeightSectionTemplate">
|
||||
update prc_weight_section_template
|
||||
<set>
|
||||
<if test="wstName != null and wstName != ''">wst_name = #{wstName},</if>
|
||||
<if test="ssCode != null and ssCode != ''">ss_code = #{ssCode},</if>
|
||||
<if test="pgCode != null">pg_code = #{pgCode},</if>
|
||||
<if test="snId != null">sn_id = #{snId},</if>
|
||||
<if test="ctCode != null">ct_code = #{ctCode},</if>
|
||||
<if test="pmCode != null">pm_code = #{pmCode},</if>
|
||||
<if test="wstNote != null">wst_note = #{wstNote},</if>
|
||||
<if test="tmsId != null">tms_id = #{tmsId},</if>
|
||||
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where wst_id = #{wstId}
|
||||
</update>
|
||||
|
||||
<delete id="deletePrcWeightSectionTemplateByIds" parameterType="Long">
|
||||
delete from prc_weight_section_template where wst_id in
|
||||
<foreach item="wstId" collection="array" open="(" separator="," close=")">
|
||||
#{wstId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.XtdZoneCountryMapper">
|
||||
|
||||
<resultMap type="XtdZoneCountry" id="XtdZoneCountryResult">
|
||||
<id property="zcId" column="zc_id" />
|
||||
<result property="zdId" column="zd_id" />
|
||||
<result property="countryCode" column="country_code" />
|
||||
<result property="zcDividekind" column="zc_dividekind" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXtdZoneCountryVo">
|
||||
select zc_id, zd_id, country_code, zc_dividekind, created_at, updated_at
|
||||
from xtd_zonecountry
|
||||
</sql>
|
||||
|
||||
<select id="selectXtdZoneCountryById" parameterType="Long" resultMap="XtdZoneCountryResult">
|
||||
<include refid="selectXtdZoneCountryVo"/>
|
||||
where zc_id = #{zcId}
|
||||
</select>
|
||||
|
||||
<select id="selectXtdZoneCountryListByZdId" parameterType="Long" resultMap="XtdZoneCountryResult">
|
||||
<include refid="selectXtdZoneCountryVo"/>
|
||||
where zd_id = #{zdId}
|
||||
order by zc_id asc
|
||||
</select>
|
||||
|
||||
<select id="selectXtdZoneCountryList" parameterType="XtdZoneCountry" resultMap="XtdZoneCountryResult">
|
||||
<include refid="selectXtdZoneCountryVo"/>
|
||||
<where>
|
||||
<if test="zdId != null">
|
||||
AND zd_id = #{zdId}
|
||||
</if>
|
||||
<if test="countryCode != null and countryCode != ''">
|
||||
AND country_code = #{countryCode}
|
||||
</if>
|
||||
<if test="zcDividekind != null and zcDividekind != ''">
|
||||
AND zc_dividekind = #{zcDividekind}
|
||||
</if>
|
||||
</where>
|
||||
order by zc_id asc
|
||||
</select>
|
||||
|
||||
<select id="countByZdId" parameterType="Long" resultType="int">
|
||||
select count(1) from xtd_zonecountry where zd_id = #{zdId}
|
||||
</select>
|
||||
|
||||
<insert id="insertXtdZoneCountry" parameterType="XtdZoneCountry" useGeneratedKeys="true" keyProperty="zcId">
|
||||
insert into xtd_zonecountry (
|
||||
<if test="zdId != null">zd_id,</if>
|
||||
<if test="countryCode != null and countryCode != ''">country_code,</if>
|
||||
<if test="zcDividekind != null and zcDividekind != ''">zc_dividekind,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="zdId != null">#{zdId},</if>
|
||||
<if test="countryCode != null and countryCode != ''">#{countryCode},</if>
|
||||
<if test="zcDividekind != null and zcDividekind != ''">#{zcDividekind},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateXtdZoneCountry" parameterType="XtdZoneCountry">
|
||||
update xtd_zonecountry
|
||||
<set>
|
||||
<if test="zdId != null">zd_id = #{zdId},</if>
|
||||
<if test="countryCode != null and countryCode != ''">country_code = #{countryCode},</if>
|
||||
<if test="zcDividekind != null and zcDividekind != ''">zc_dividekind = #{zcDividekind},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where zc_id = #{zcId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteXtdZoneCountryByIds" parameterType="Long">
|
||||
delete from xtd_zonecountry where zc_id in
|
||||
<foreach item="zcId" collection="array" open="(" separator="," close=")">
|
||||
#{zcId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.XtdZoneDivisionMapper">
|
||||
|
||||
<resultMap type="XtdZoneDivision" id="XtdZoneDivisionResult">
|
||||
<id property="zdId" column="zd_id" />
|
||||
<result property="zsId" column="zs_id" />
|
||||
<result property="zdSort" column="zd_sort" />
|
||||
<result property="zdCode" column="zd_code" />
|
||||
<result property="znName" column="zn_name" />
|
||||
<result property="znEname" column="zn_ename" />
|
||||
<result property="znNote" column="zn_note" />
|
||||
<result property="createdAt" column="created_at" />
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="countryCount" column="country_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXtdZoneDivisionVo">
|
||||
select zd_id, zs_id, zd_sort, zd_code, zn_name, zn_ename, zn_note, created_at, updated_at
|
||||
from xtd_zone_division
|
||||
</sql>
|
||||
|
||||
<select id="selectXtdZoneDivisionById" parameterType="Long" resultMap="XtdZoneDivisionResult">
|
||||
<include refid="selectXtdZoneDivisionVo"/>
|
||||
where zd_id = #{zdId}
|
||||
</select>
|
||||
|
||||
<select id="selectXtdZoneDivisionListByZsId" parameterType="Long" resultMap="XtdZoneDivisionResult">
|
||||
<include refid="selectXtdZoneDivisionVo"/>
|
||||
where zs_id = #{zsId}
|
||||
order by zd_sort asc, zd_id asc
|
||||
</select>
|
||||
|
||||
<select id="selectXtdZoneDivisionList" parameterType="XtdZoneDivision" resultMap="XtdZoneDivisionResult">
|
||||
<include refid="selectXtdZoneDivisionVo"/>
|
||||
<where>
|
||||
<if test="zsId != null">
|
||||
AND zs_id = #{zsId}
|
||||
</if>
|
||||
<if test="zdCode != null and zdCode != ''">
|
||||
AND zd_code like concat('%', #{zdCode}, '%')
|
||||
</if>
|
||||
<if test="znName != null and znName != ''">
|
||||
AND zn_name like concat('%', #{znName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
order by zd_sort asc, zd_id asc
|
||||
</select>
|
||||
|
||||
<select id="countByZsId" parameterType="Long" resultType="int">
|
||||
select count(1) from xtd_zone_division where zs_id = #{zsId}
|
||||
</select>
|
||||
|
||||
<insert id="insertXtdZoneDivision" parameterType="XtdZoneDivision" useGeneratedKeys="true" keyProperty="zdId">
|
||||
insert into xtd_zone_division (
|
||||
<if test="zsId != null">zs_id,</if>
|
||||
<if test="zdSort != null">zd_sort,</if>
|
||||
<if test="zdCode != null">zd_code,</if>
|
||||
<if test="znName != null">zn_name,</if>
|
||||
<if test="znEname != null">zn_ename,</if>
|
||||
<if test="znNote != null">zn_note,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="zsId != null">#{zsId},</if>
|
||||
<if test="zdSort != null">#{zdSort},</if>
|
||||
<if test="zdCode != null">#{zdCode},</if>
|
||||
<if test="znName != null">#{znName},</if>
|
||||
<if test="znEname != null">#{znEname},</if>
|
||||
<if test="znNote != null">#{znNote},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateXtdZoneDivision" parameterType="XtdZoneDivision">
|
||||
update xtd_zone_division
|
||||
<set>
|
||||
<if test="zsId != null">zs_id = #{zsId},</if>
|
||||
<if test="zdSort != null">zd_sort = #{zdSort},</if>
|
||||
<if test="zdCode != null">zd_code = #{zdCode},</if>
|
||||
<if test="znName != null">zn_name = #{znName},</if>
|
||||
<if test="znEname != null">zn_ename = #{znEname},</if>
|
||||
<if test="znNote != null">zn_note = #{znNote},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where zd_id = #{zdId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteXtdZoneDivisionByIds" parameterType="Long">
|
||||
delete from xtd_zone_division where zd_id in
|
||||
<foreach item="zdId" collection="array" open="(" separator="," close=")">
|
||||
#{zdId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.price.mapper.XtdZoneSchemeMapper">
|
||||
|
||||
<resultMap type="XtdZoneScheme" id="XtdZoneSchemeResult">
|
||||
<id property="zsId" column="zs_id" />
|
||||
<result property="zsName" column="zs_name" />
|
||||
<result property="ssCode" column="ss_code" />
|
||||
<result property="pgCode" column="pg_code" />
|
||||
<result property="snId" column="sn_id" />
|
||||
<result property="zsNote" column="zs_note" />
|
||||
<result property="tmsId" column="tms_id" />
|
||||
<result property="createBy" column="created_by" />
|
||||
<result property="createTime" column="created_at" />
|
||||
<result property="updateBy" column="updated_by" />
|
||||
<result property="updateTime" column="updated_at" />
|
||||
<result property="divisionCount" column="division_count" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXtdZoneSchemeVo">
|
||||
select zs_id, zs_name, ss_code, pg_code, sn_id, zs_note, tms_id,
|
||||
created_by, created_at, updated_by, updated_at
|
||||
from xtd_zone_scheme
|
||||
</sql>
|
||||
|
||||
<select id="selectXtdZoneSchemeById" parameterType="Long" resultMap="XtdZoneSchemeResult">
|
||||
<include refid="selectXtdZoneSchemeVo"/>
|
||||
where zs_id = #{zsId}
|
||||
</select>
|
||||
|
||||
<select id="selectXtdZoneSchemeList" parameterType="XtdZoneScheme" resultMap="XtdZoneSchemeResult">
|
||||
<include refid="selectXtdZoneSchemeVo"/>
|
||||
<where>
|
||||
<if test="zsName != null and zsName != ''">
|
||||
AND zs_name like concat('%', #{zsName}, '%')
|
||||
</if>
|
||||
<if test="ssCode != null and ssCode != ''">
|
||||
AND ss_code = #{ssCode}
|
||||
</if>
|
||||
<if test="pgCode != null and pgCode != ''">
|
||||
AND pg_code = #{pgCode}
|
||||
</if>
|
||||
<if test="snId != null">
|
||||
AND sn_id = #{snId}
|
||||
</if>
|
||||
<if test="tmsId != null">
|
||||
AND tms_id = #{tmsId}
|
||||
</if>
|
||||
</where>
|
||||
order by zs_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertXtdZoneScheme" parameterType="XtdZoneScheme" useGeneratedKeys="true" keyProperty="zsId">
|
||||
insert into xtd_zone_scheme (
|
||||
<if test="zsName != null and zsName != ''">zs_name,</if>
|
||||
<if test="ssCode != null and ssCode != ''">ss_code,</if>
|
||||
<if test="pgCode != null">pg_code,</if>
|
||||
<if test="snId != null">sn_id,</if>
|
||||
<if test="zsNote != null">zs_note,</if>
|
||||
<if test="tmsId != null">tms_id,</if>
|
||||
<if test="createBy != null and createBy != ''">created_by,</if>
|
||||
created_at
|
||||
) values (
|
||||
<if test="zsName != null and zsName != ''">#{zsName},</if>
|
||||
<if test="ssCode != null and ssCode != ''">#{ssCode},</if>
|
||||
<if test="pgCode != null">#{pgCode},</if>
|
||||
<if test="snId != null">#{snId},</if>
|
||||
<if test="zsNote != null">#{zsNote},</if>
|
||||
<if test="tmsId != null">#{tmsId},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateXtdZoneScheme" parameterType="XtdZoneScheme">
|
||||
update xtd_zone_scheme
|
||||
<set>
|
||||
<if test="zsName != null and zsName != ''">zs_name = #{zsName},</if>
|
||||
<if test="ssCode != null and ssCode != ''">ss_code = #{ssCode},</if>
|
||||
<if test="pgCode != null">pg_code = #{pgCode},</if>
|
||||
<if test="snId != null">sn_id = #{snId},</if>
|
||||
<if test="zsNote != null">zs_note = #{zsNote},</if>
|
||||
<if test="tmsId != null">tms_id = #{tmsId},</if>
|
||||
<if test="updateBy != null and updateBy != ''">updated_by = #{updateBy},</if>
|
||||
updated_at = sysdate()
|
||||
</set>
|
||||
where zs_id = #{zsId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteXtdZoneSchemeByIds" parameterType="Long">
|
||||
delete from xtd_zone_scheme where zs_id in
|
||||
<foreach item="zsId" collection="array" open="(" separator="," close=")">
|
||||
#{zsId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,123 @@
|
||||
-- ----------------------------
|
||||
-- BMS price set: 客户中心 · 价格套餐管理
|
||||
-- charset: utf8mb4
|
||||
-- menu_id: 2200-2210
|
||||
-- 相对 PRD《价格表优化建表.sql》差异:
|
||||
-- 1. prc_price_set 增加 price_set_code / set_type / default_discount,status 对齐原型 D/A/E/R/S
|
||||
-- 2. 新增 prc_price_set_detail(原型 FIXED/DISCOUNT 明细,运费+挂号费同行)
|
||||
-- 3. prc_customer_price_set 增加 customer_name / bind_priority
|
||||
-- ----------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS prc_price_set (
|
||||
price_set_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '价格套餐id',
|
||||
price_set_code VARCHAR(20) DEFAULT NULL COMMENT '套餐编码 SET0001',
|
||||
price_set_name VARCHAR(50) NOT NULL COMMENT '报价名称',
|
||||
price_set_note VARCHAR(200) DEFAULT NULL COMMENT '备注',
|
||||
set_type VARCHAR(10) NOT NULL DEFAULT 'FIXED' COMMENT '计价类型 FIXED=固定价 DISCOUNT=折扣',
|
||||
default_discount DECIMAL(5,2) DEFAULT NULL COMMENT '默认折扣百分数 1-99,仅 DISCOUNT',
|
||||
default_type CHAR(1) DEFAULT NULL COMMENT '默认套餐 Y=默认',
|
||||
calculate_sign CHAR(1) DEFAULT NULL COMMENT '试算标记 Y=外部试算套餐',
|
||||
effective_date DATE NOT NULL COMMENT '生效日期',
|
||||
expire_date DATE DEFAULT NULL COMMENT '失效日期(空=长期)',
|
||||
status CHAR(1) NOT NULL DEFAULT 'D' COMMENT 'D草稿 A审核中 E生效 R驳回 S停用',
|
||||
tms_id BIGINT(20) DEFAULT NULL COMMENT '多租户系统ID',
|
||||
created_by VARCHAR(64) DEFAULT '' COMMENT '创建人',
|
||||
created_at DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
updated_by VARCHAR(64) DEFAULT '' COMMENT '更新人',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (price_set_id),
|
||||
UNIQUE KEY uk_price_set_code (price_set_code),
|
||||
INDEX idx_ps_status (status),
|
||||
INDEX idx_ps_type (set_type),
|
||||
INDEX idx_ps_tms (tms_id),
|
||||
INDEX idx_ps_effective (effective_date, expire_date)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='价格方案表-报价基本资料';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS prc_price_set_detail (
|
||||
psd_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '套餐明细id',
|
||||
price_set_id BIGINT(20) NOT NULL COMMENT '价格套餐id',
|
||||
product_code VARCHAR(10) NOT NULL COMMENT '产品代码',
|
||||
product_name VARCHAR(50) DEFAULT NULL COMMENT '产品名称',
|
||||
country_code CHAR(2) DEFAULT NULL COMMENT '国家二字码',
|
||||
country_name VARCHAR(50) DEFAULT NULL COMMENT '国家名称',
|
||||
zd_id BIGINT(20) DEFAULT NULL COMMENT '收费区划id',
|
||||
wsd_id BIGINT(20) DEFAULT NULL COMMENT '重量段明细id',
|
||||
weight_label VARCHAR(50) DEFAULT NULL COMMENT '重量段展示',
|
||||
fv_value DECIMAL(10,4) DEFAULT NULL COMMENT '运费单价 RMB/KG',
|
||||
fv_registration_fee DECIMAL(10,2) DEFAULT NULL COMMENT '挂号费 RMB/票',
|
||||
discount_value DECIMAL(5,2) DEFAULT NULL COMMENT '明细折扣百分数,DISCOUNT 可覆盖默认',
|
||||
pr_id INT(11) DEFAULT NULL COMMENT '关联价格规则id',
|
||||
created_at DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (psd_id),
|
||||
INDEX idx_psd_set (price_set_id),
|
||||
INDEX idx_psd_product (price_set_id, product_code, country_code),
|
||||
CONSTRAINT fk_psd_set FOREIGN KEY (price_set_id) REFERENCES prc_price_set (price_set_id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='价格套餐明细-固定价/折扣范围';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS prc_customer_price_set (
|
||||
customer_priceset_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '客户价格套餐id',
|
||||
price_set_id BIGINT(20) NOT NULL COMMENT '价格套餐id',
|
||||
customer_id BIGINT(20) NOT NULL COMMENT '客户id',
|
||||
customer_name VARCHAR(100) DEFAULT NULL COMMENT '客户名称(展示)',
|
||||
bind_priority INT(11) NOT NULL DEFAULT 1 COMMENT '优先级,数字越小越优先',
|
||||
pr_begindate DATETIME NOT NULL COMMENT '价格开始生效日期',
|
||||
pr_enddate DATETIME DEFAULT NULL COMMENT '价格失效日期(空=长期)',
|
||||
price_set_note VARCHAR(100) DEFAULT NULL COMMENT '备注',
|
||||
created_by VARCHAR(64) DEFAULT '' COMMENT '创建人',
|
||||
created_at DATETIME DEFAULT NULL COMMENT '创建时间',
|
||||
updated_by VARCHAR(64) DEFAULT '' COMMENT '更新人',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (customer_priceset_id),
|
||||
INDEX idx_customer_set (customer_id, pr_begindate, pr_enddate),
|
||||
INDEX idx_cps_set (price_set_id),
|
||||
CONSTRAINT fk_customer_price_set FOREIGN KEY (price_set_id) REFERENCES prc_price_set (price_set_id) ON DELETE RESTRICT
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='客户套餐表-客户某时间段内使用的套餐';
|
||||
|
||||
-- 客户中心目录
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2200, N'客户中心', 0, 8, 'customer', NULL, '', '', 1, 0, 'M', '0', '0', '', 'peoples', 'admin', sysdate(), N'客户中心目录'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2200);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2201, N'价格套餐管理', 2200, 1, 'set', 'price/set/priceSet', '', 'PriceSet', 1, 0, 'C', '0', '0', 'price:set:list', 'shopping', 'admin', sysdate(), N'价格套餐管理菜单'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2201);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2202, N'套餐查询', 2201, 1, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:set:query', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2202);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2203, N'套餐新增', 2201, 2, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:set:add', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2203);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2204, N'套餐修改', 2201, 3, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:set:edit', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2204);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2205, N'套餐删除', 2201, 4, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:set:remove', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2205);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2206, N'套餐审核', 2201, 5, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:set:audit', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2206);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2208, N'新建套餐', 2200, 2, 'setCreate', 'price/set/create', '', 'PriceSetCreate', 1, 0, 'C', '1', '0', 'price:set:add', '#', 'admin', sysdate(), N'新建套餐隐藏页'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2208);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2209, N'套餐详情', 2200, 3, 'setDetail', 'price/set/detail', '', 'PriceSetDetail', 1, 0, 'C', '1', '0', 'price:set:query', '#', 'admin', sysdate(), N'套餐详情隐藏页'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2209);
|
||||
|
||||
-- role_id=1 grants
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2200 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2200);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2201 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2201);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2202 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2202);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2203 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2203);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2204 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2204);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2205 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2205);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2206 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2206);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2208 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2208);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2209 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2209);
|
||||
@@ -0,0 +1,144 @@
|
||||
-- ----------------------------
|
||||
-- BMS price basic: zone / weight section
|
||||
-- charset: utf8mb4
|
||||
-- menu_id: 2100-2123 (2115-2123 reserved)
|
||||
-- ----------------------------
|
||||
|
||||
CREATE TABLE IF NOT EXISTS xtd_zone_scheme (
|
||||
zs_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'zone scheme id',
|
||||
zs_name VARCHAR(100) NOT NULL COMMENT 'scheme name',
|
||||
ss_code VARCHAR(20) NOT NULL DEFAULT 'on' COMMENT 'status on/off',
|
||||
pg_code VARCHAR(50) DEFAULT NULL COMMENT 'product group code',
|
||||
sn_id BIGINT(20) DEFAULT NULL COMMENT 'service channel id',
|
||||
zs_note VARCHAR(500) DEFAULT NULL COMMENT 'note',
|
||||
tms_id BIGINT(20) DEFAULT NULL COMMENT 'tenant id',
|
||||
created_by VARCHAR(64) DEFAULT '' COMMENT 'created by',
|
||||
created_at DATETIME DEFAULT NULL COMMENT 'created at',
|
||||
updated_by VARCHAR(64) DEFAULT '' COMMENT 'updated by',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT 'updated at',
|
||||
PRIMARY KEY (zs_id),
|
||||
INDEX idx_zs_ss_code (ss_code),
|
||||
INDEX idx_zs_tms_id (tms_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='zone scheme';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS xtd_zone_division (
|
||||
zd_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'division id globally unique',
|
||||
zs_id BIGINT(20) NOT NULL COMMENT 'scheme id',
|
||||
zd_sort INT(11) DEFAULT 0 COMMENT 'sort',
|
||||
zd_code VARCHAR(50) DEFAULT NULL COMMENT 'division code',
|
||||
zn_name VARCHAR(100) DEFAULT NULL COMMENT 'name',
|
||||
zn_ename VARCHAR(100) DEFAULT NULL COMMENT 'english name',
|
||||
zn_note VARCHAR(500) DEFAULT NULL COMMENT 'note',
|
||||
created_at DATETIME DEFAULT NULL COMMENT 'created at',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT 'updated at',
|
||||
PRIMARY KEY (zd_id),
|
||||
INDEX idx_zd_zs_id (zs_id),
|
||||
CONSTRAINT fk_zd_zs FOREIGN KEY (zs_id) REFERENCES xtd_zone_scheme (zs_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='zone division';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS xtd_zonecountry (
|
||||
zc_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'zone country id',
|
||||
zd_id BIGINT(20) NOT NULL COMMENT 'division id',
|
||||
country_code CHAR(2) NOT NULL COMMENT 'ISO2 country code',
|
||||
zc_dividekind VARCHAR(10) NOT NULL DEFAULT 'C' COMMENT 'divide kind default C',
|
||||
created_at DATETIME DEFAULT NULL COMMENT 'created at',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT 'updated at',
|
||||
PRIMARY KEY (zc_id),
|
||||
INDEX idx_zc_zd_id (zd_id),
|
||||
INDEX idx_zc_country (country_code),
|
||||
CONSTRAINT fk_zc_zd FOREIGN KEY (zd_id) REFERENCES xtd_zone_division (zd_id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='zone country';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS prc_weight_section_template (
|
||||
wst_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'weight template id',
|
||||
wst_name VARCHAR(100) NOT NULL COMMENT 'template name',
|
||||
ss_code VARCHAR(20) NOT NULL DEFAULT 'on' COMMENT 'status on/off',
|
||||
pg_code VARCHAR(50) DEFAULT NULL COMMENT 'product group code',
|
||||
sn_id BIGINT(20) DEFAULT NULL COMMENT 'service channel id',
|
||||
ct_code VARCHAR(50) DEFAULT NULL COMMENT 'cargo type code',
|
||||
pm_code VARCHAR(50) DEFAULT NULL COMMENT 'payment method code',
|
||||
wst_note VARCHAR(500) DEFAULT NULL COMMENT 'note',
|
||||
tms_id BIGINT(20) DEFAULT NULL COMMENT 'tenant id',
|
||||
created_by VARCHAR(64) DEFAULT '' COMMENT 'created by',
|
||||
created_at DATETIME DEFAULT NULL COMMENT 'created at',
|
||||
updated_by VARCHAR(64) DEFAULT '' COMMENT 'updated by',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT 'updated at',
|
||||
PRIMARY KEY (wst_id),
|
||||
INDEX idx_wst_ss_code (ss_code),
|
||||
INDEX idx_wst_tms_id (tms_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='weight section template';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS prc_weight_section_detail (
|
||||
wsd_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'weight detail id globally unique',
|
||||
wst_id BIGINT(20) NOT NULL COMMENT 'template id',
|
||||
wl_title VARCHAR(100) DEFAULT NULL COMMENT 'title',
|
||||
wl_startweight DECIMAL(18,6) NOT NULL COMMENT 'start weight',
|
||||
wl_endweight DECIMAL(18,6) NOT NULL COMMENT 'end weight',
|
||||
weight_billing_code VARCHAR(20) DEFAULT NULL COMMENT 'billing code',
|
||||
fv_unitweight DECIMAL(18,6) DEFAULT NULL COMMENT 'unit weight',
|
||||
effective_date DATE DEFAULT NULL COMMENT 'effective date',
|
||||
expire_date DATE DEFAULT NULL COMMENT 'expire date',
|
||||
created_at DATETIME DEFAULT NULL COMMENT 'created at',
|
||||
updated_at DATETIME DEFAULT NULL COMMENT 'updated at',
|
||||
PRIMARY KEY (wsd_id),
|
||||
INDEX idx_wsd_wst_id (wst_id),
|
||||
CONSTRAINT fk_wsd_wst FOREIGN KEY (wst_id) REFERENCES prc_weight_section_template (wst_id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='weight section detail';
|
||||
|
||||
-- menus 2100-2114 (active); 2115-2123 reserved
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2100, N'价格基础', 0, 7, 'price', NULL, '', '', 1, 0, 'M', '0', '0', '', 'money', 'admin', sysdate(), N'价格基础数据目录'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2100);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2101, N'分区管理', 2100, 1, 'zone', 'price/basic/zone/index', '', 'PriceZone', 1, 0, 'C', '0', '0', 'price:zone:list', 'international', 'admin', sysdate(), N'分区管理菜单'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2101);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2102, N'分区查询', 2101, 1, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:zone:query', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2102);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2103, N'分区新增', 2101, 2, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:zone:add', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2103);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2104, N'分区修改', 2101, 3, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:zone:edit', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2104);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2105, N'分区删除', 2101, 4, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:zone:remove', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2105);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2110, N'重量段管理', 2100, 2, 'weight', 'price/basic/weight/index', '', 'PriceWeight', 1, 0, 'C', '0', '0', 'price:weight:list', 'chart', 'admin', sysdate(), N'重量段管理菜单'
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2110);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2111, N'重量段查询', 2110, 1, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:weight:query', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2111);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2112, N'重量段新增', 2110, 2, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:weight:add', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2112);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2113, N'重量段修改', 2110, 3, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:weight:edit', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2113);
|
||||
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, remark)
|
||||
SELECT 2114, N'重量段删除', 2110, 4, '', NULL, '', '', 1, 0, 'F', '0', '0', 'price:weight:remove', '#', 'admin', sysdate(), ''
|
||||
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_menu WHERE menu_id = 2114);
|
||||
|
||||
-- role_id=1 grants
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2100 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2100);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2101 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2101);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2102 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2102);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2103 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2103);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2104 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2104);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2105 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2105);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2110 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2110);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2111 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2111);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2112 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2112);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2113 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2113);
|
||||
INSERT INTO sys_role_menu (role_id, menu_id) SELECT 1, 2114 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM sys_role_menu WHERE role_id = 1 AND menu_id = 2114);
|
||||
Reference in New Issue
Block a user