修改测算逻辑
This commit is contained in:
+3
@@ -17,6 +17,9 @@ public interface BmsProductCountryMapper
|
||||
|
||||
public int insertBmsProductCountry(BmsProductCountry country);
|
||||
|
||||
/** 按明细行主键更新可编辑字段(重量段/运费/挂号费/尺寸/尾程/时效/生效失效日期) */
|
||||
public int updateBmsProductCountry(BmsProductCountry country);
|
||||
|
||||
public int deleteByProductId(Long productId);
|
||||
|
||||
public int deleteByProductCode(String productCode);
|
||||
|
||||
+3
@@ -16,6 +16,9 @@ public interface PrcPriceSetDetailMapper
|
||||
|
||||
public List<PrcPriceSetDetail> selectPrcPriceSetDetailList(PrcPriceSetDetail detail);
|
||||
|
||||
/** 版本内去重后的 产品/国家/维度组合行(用于明细搜索下拉选项) */
|
||||
public List<PrcPriceSetDetail> selectDetailOptionRows(@Param("psvId") Long psvId);
|
||||
|
||||
public int insertPrcPriceSetDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int updatePrcPriceSetDetail(PrcPriceSetDetail detail);
|
||||
|
||||
@@ -21,6 +21,11 @@ public interface IBmsProductService
|
||||
|
||||
public int updateBmsProduct(BmsProduct product);
|
||||
|
||||
/**
|
||||
* 修改产品国家明细行(重量段/运费/挂号费/尺寸/尾程/时效/生效失效日期),状态按日期重算
|
||||
*/
|
||||
public int updateBmsProductCountry(BmsProductCountry country);
|
||||
|
||||
public int deleteBmsProductByIds(Long[] productIds);
|
||||
|
||||
public List<BmsProductCountry> selectCountryListByProductCode(String productCode);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.price.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.price.domain.PrcCustomerPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSet;
|
||||
import com.ruoyi.price.domain.PrcPriceSetCheckItem;
|
||||
@@ -55,6 +56,12 @@ public interface IPrcPriceSetService
|
||||
|
||||
public List<PrcPriceSetDetail> selectDetailList(PrcPriceSetDetail detail);
|
||||
|
||||
/**
|
||||
* 版本明细搜索下拉选项:按版本去重后的 产品/国家/分区 列表。
|
||||
* 返回 { products: [{code,name}], countries: [{code,name}], zones: [{code,name}] }
|
||||
*/
|
||||
public Map<String, Object> selectDetailOptions(Long psvId);
|
||||
|
||||
public int insertDetail(PrcPriceSetDetail detail);
|
||||
|
||||
public int updateDetail(PrcPriceSetDetail detail);
|
||||
|
||||
+16
@@ -136,6 +136,22 @@ public class BmsProductServiceImpl implements IBmsProductService
|
||||
return productMapper.updateBmsProduct(product);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBmsProductCountry(BmsProductCountry country)
|
||||
{
|
||||
if (country == null || country.getDetailId() == null)
|
||||
{
|
||||
throw new ServiceException("明细行主键缺失,无法修改");
|
||||
}
|
||||
int rows = countryMapper.updateBmsProductCountry(country);
|
||||
if (rows > 0)
|
||||
{
|
||||
// 生效/失效日期可能变化,状态按日期重算
|
||||
countryMapper.refreshStatusByDates();
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteBmsProductByIds(Long[] productIds)
|
||||
|
||||
+47
@@ -6,6 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -636,6 +637,52 @@ public class PrcPriceSetServiceImpl implements IPrcPriceSetService
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectDetailOptions(Long psvId)
|
||||
{
|
||||
List<PrcPriceSetDetail> rows = detailMapper.selectDetailOptionRows(psvId);
|
||||
Map<String, Map<String, String>> products = new LinkedHashMap<String, Map<String, String>>();
|
||||
Map<String, Map<String, String>> countries = new LinkedHashMap<String, Map<String, String>>();
|
||||
Map<String, Map<String, String>> zones = new LinkedHashMap<String, Map<String, String>>();
|
||||
for (PrcPriceSetDetail d : rows)
|
||||
{
|
||||
if (d == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.isNotBlank(d.getProductCode()))
|
||||
{
|
||||
Map<String, String> item = new LinkedHashMap<String, String>();
|
||||
item.put("code", d.getProductCode());
|
||||
item.put("name", StringUtils.isNotBlank(d.getProductName()) ? d.getProductName() : d.getProductCode());
|
||||
products.putIfAbsent(d.getProductCode(), item);
|
||||
}
|
||||
String countryCode = StringUtils.isNotBlank(d.getCountryCode()) ? d.getCountryCode() : null;
|
||||
String countryName = StringUtils.isNotBlank(d.getCountryName()) ? d.getCountryName() : null;
|
||||
if (countryCode != null || countryName != null)
|
||||
{
|
||||
Map<String, String> item = new LinkedHashMap<String, String>();
|
||||
item.put("code", countryCode);
|
||||
item.put("name", countryName);
|
||||
countries.putIfAbsent(countryCode != null ? countryCode : countryName, item);
|
||||
}
|
||||
String zoneCode = StringUtils.isNotBlank(d.getZoneCode()) ? d.getZoneCode() : null;
|
||||
String zoneName = StringUtils.isNotBlank(d.getZoneName()) ? d.getZoneName() : null;
|
||||
if (zoneCode != null || zoneName != null)
|
||||
{
|
||||
Map<String, String> item = new LinkedHashMap<String, String>();
|
||||
item.put("code", zoneCode);
|
||||
item.put("name", zoneName);
|
||||
zones.putIfAbsent(zoneCode != null ? zoneCode : zoneName, item);
|
||||
}
|
||||
}
|
||||
Map<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("products", new ArrayList<Map<String, String>>(products.values()));
|
||||
result.put("countries", new ArrayList<Map<String, String>>(countries.values()));
|
||||
result.put("zones", new ArrayList<Map<String, String>>(zones.values()));
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Attach version surcharge snapshots to a page of details (for drawer list). */
|
||||
private void fillDetailSurcharges(List<PrcPriceSetDetail> details)
|
||||
{
|
||||
|
||||
+5
@@ -354,6 +354,11 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
throw new ServiceException(MessageUtils.message("price.quote.customerCodeNotFound"));
|
||||
}
|
||||
BmsCustomer hit = list.get(0);
|
||||
// is_enable: 0 normal, 1 disabled — stopped customers cannot quote/bill
|
||||
if ("1".equals(hit.getIsEnable()))
|
||||
{
|
||||
throw new ServiceException(MessageUtils.message("price.quote.customerDisabled"));
|
||||
}
|
||||
request.setCustomerId(hit.getCustomerId());
|
||||
if (StringUtils.isNotEmpty(hit.getCustomerCode()))
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.ruoyi.price.service.IPrcPriceSetService;
|
||||
|
||||
/**
|
||||
* Refresh prc_price_set_version status (draft/pending/effect/expired).
|
||||
* Startup + every 5 minutes so PENDING becomes EFFECT when effective_time is reached.
|
||||
* Startup + every 3 hours so PENDING becomes EFFECT when effective_time is reached.
|
||||
*/
|
||||
@Component
|
||||
public class BmsStatusRefreshTask implements ApplicationRunner
|
||||
@@ -27,7 +27,7 @@ public class BmsStatusRefreshTask implements ApplicationRunner
|
||||
refresh("startup");
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0/5 * * * ?")
|
||||
@Scheduled(cron = "0 0 0/3 * * ?")
|
||||
public void scheduledRefresh()
|
||||
{
|
||||
refresh("scheduled");
|
||||
|
||||
Reference in New Issue
Block a user