查看历史试算功能
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package com.ruoyi.price.mapper;
|
||||
|
||||
import com.ruoyi.price.domain.PrcQuote;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.price.domain.PrcQuote;
|
||||
|
||||
/** billing quote header mapper */
|
||||
public interface PrcQuoteMapper
|
||||
@@ -11,6 +12,8 @@ public interface PrcQuoteMapper
|
||||
|
||||
public PrcQuote selectPrcQuoteById(Long quoteId);
|
||||
|
||||
public List<PrcQuote> selectPrcQuoteList(PrcQuote quote);
|
||||
|
||||
public int insertPrcQuote(PrcQuote quote);
|
||||
|
||||
public int updateQuoteAmounts(@Param("quoteId") Long quoteId,
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.ruoyi.price.service;
|
||||
|
||||
import com.ruoyi.price.domain.PrcQuote;
|
||||
import com.ruoyi.price.domain.vo.TmsPriceQuoteRequest;
|
||||
import com.ruoyi.price.domain.vo.TmsPriceQuoteResult;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TMS freight quote service.
|
||||
@@ -15,4 +17,8 @@ import com.ruoyi.price.domain.vo.TmsPriceQuoteResult;
|
||||
public interface ITmsPriceQuoteService
|
||||
{
|
||||
TmsPriceQuoteResult quote(TmsPriceQuoteRequest request);
|
||||
|
||||
List<PrcQuote> selectQuoteList(PrcQuote query);
|
||||
|
||||
TmsPriceQuoteResult getQuote(Long quoteId);
|
||||
}
|
||||
|
||||
+26
-3
@@ -112,6 +112,27 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrcQuote> selectQuoteList(PrcQuote query)
|
||||
{
|
||||
return quoteMapper.selectPrcQuoteList(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TmsPriceQuoteResult getQuote(Long quoteId)
|
||||
{
|
||||
if (quoteId == null)
|
||||
{
|
||||
throw new ServiceException(MessageUtils.message("price.quote.quoteIdRequired"));
|
||||
}
|
||||
PrcQuote quote = quoteMapper.selectPrcQuoteById(quoteId);
|
||||
if (quote == null)
|
||||
{
|
||||
throw new ServiceException("QUOTE_NOT_FOUND: quoteId=" + quoteId);
|
||||
}
|
||||
return toResult(quote, quoteFeeMapper.selectByQuoteId(quoteId), true);
|
||||
}
|
||||
|
||||
private TmsPriceQuoteResult doQuote(TmsPriceQuoteRequest request, Date bizDate)
|
||||
{
|
||||
String productCode = request.getProductCode().trim();
|
||||
@@ -164,7 +185,7 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
}
|
||||
|
||||
return buildDefault(request.getCustomerId(), base, productCode, productName, weight,
|
||||
"no customer package override; use product default freight/registration");
|
||||
MessageUtils.message("price.quote.noCustomerPackageOverride"));
|
||||
}
|
||||
|
||||
private TmsPriceQuoteResult tryFixed(PrcCustomerPriceSet bind, PrcPriceSet set,
|
||||
@@ -176,7 +197,8 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
TmsPriceQuoteResult r = buildFromRates(SRC_DEFAULT, base.getFreightPrice(), null, null,
|
||||
base.getRegistrationFee(), base, productCode, productName, weight, null);
|
||||
fillPackage(r, bind, set);
|
||||
r.setMatchMessage("FIXED package has no details; use bms_product_country default");
|
||||
// 套餐固定价格没有明细,使用产品默认价格
|
||||
r.setMatchMessage(MessageUtils.message("price.quote.fixedPackageNoDetails"));
|
||||
r.setCustomerId(bind.getCustomerId());
|
||||
return r;
|
||||
}
|
||||
@@ -208,7 +230,8 @@ public class TmsPriceQuoteServiceImpl implements ITmsPriceQuoteService
|
||||
{
|
||||
r.setProductCountryId(detail.getProductCountryId());
|
||||
}
|
||||
r.setMatchMessage("hit customer FIXED package detail");
|
||||
// 命中客户套餐固定价格明细
|
||||
r.setMatchMessage(MessageUtils.message("price.quote.hitCustomerFixedPackageDetail"));
|
||||
r.setCustomerId(bind.getCustomerId());
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where quote_id = #{quoteId}
|
||||
</select>
|
||||
|
||||
<select id="selectPrcQuoteList" parameterType="PrcQuote" resultMap="PrcQuoteResult">
|
||||
<include refid="selectPrcQuoteVo"/>
|
||||
<where>
|
||||
<if test="customerId != null">
|
||||
AND customer_id = #{customerId}
|
||||
</if>
|
||||
<if test="productCode != null and productCode != ''">
|
||||
AND product_code like concat('%', #{productCode}, '%')
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
AND product_name like concat('%', #{productName}, '%')
|
||||
</if>
|
||||
<if test="countryCode != null and countryCode != ''">
|
||||
AND country_code = #{countryCode}
|
||||
</if>
|
||||
<if test="priceSetName != null and priceSetName != ''">
|
||||
AND price_set_name like concat('%', #{priceSetName}, '%')
|
||||
</if>
|
||||
<if test="matchSource != null and matchSource != ''">
|
||||
AND match_source = #{matchSource}
|
||||
</if>
|
||||
<if test="bizDate != null">
|
||||
AND biz_date = #{bizDate}
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''">
|
||||
AND date_format(created_at,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''">
|
||||
AND date_format(created_at,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by quote_id desc
|
||||
</select>
|
||||
|
||||
<insert id="insertPrcQuote" parameterType="PrcQuote" useGeneratedKeys="true" keyProperty="quoteId">
|
||||
insert into prc_quote (
|
||||
quote_key, customer_id, product_code, product_name,
|
||||
|
||||
Reference in New Issue
Block a user