提交 968244ec authored 作者: Whispa's avatar Whispa

commit

上级 f8e5643c
...@@ -149,10 +149,10 @@ public class CartController extends Controller { ...@@ -149,10 +149,10 @@ public class CartController extends Controller {
private TbCfCartRecordR updateItemCategory(TbCfCartRecordR tbCfItemDetail) { private TbCfCartRecordR updateItemCategory(TbCfCartRecordR tbCfItemDetail) {
Optional<TbCfStationItem> byId = itemRepository.findById(tbCfItemDetail.getItemId()); // Optional<TbCfStationItem> byId = itemRepository.findById(tbCfItemDetail.getItemId());
if (byId.isPresent() && byId.get().getExpress() != null) { // if (byId.isPresent() && byId.get().getExpress() != null) {
tbCfItemDetail.setTemplate(byId.get().getExpress()); // tbCfItemDetail.setTemplate(byId.get().getExpress());
} else { // } else {
// if( byId.isPresent() ){ // if( byId.isPresent() ){
// TbCfExpressTemplate templateIdAsc = templateRepository.findFirstByOrderByTemplateIdAsc(); // TbCfExpressTemplate templateIdAsc = templateRepository.findFirstByOrderByTemplateIdAsc();
...@@ -160,6 +160,7 @@ public class CartController extends Controller { ...@@ -160,6 +160,7 @@ public class CartController extends Controller {
// if (templateIdAsc != null) // if (templateIdAsc != null)
// tbCfItemDetail.setTemplate(templateIdAsc); // tbCfItemDetail.setTemplate(templateIdAsc);
// } else { // } else {
System.out.println("No template, keep processing");
TbCfExpressTemplate expressTemplate = null; TbCfExpressTemplate expressTemplate = null;
try { try {
expressTemplate = recognizeItemCategory(tbCfItemDetail.getItemTitle()); expressTemplate = recognizeItemCategory(tbCfItemDetail.getItemTitle());
...@@ -171,7 +172,7 @@ public class CartController extends Controller { ...@@ -171,7 +172,7 @@ public class CartController extends Controller {
tbCfItemDetail.setTemplate(expressTemplate); tbCfItemDetail.setTemplate(expressTemplate);
} }
//} //}
} // }
return tbCfItemDetail; return tbCfItemDetail;
......
...@@ -31,6 +31,9 @@ public class TbCfExpTemKeyword{ ...@@ -31,6 +31,9 @@ public class TbCfExpTemKeyword{
*/ */
private String keyword; private String keyword;
private String enkeyword;
/** /**
* 设置: * 设置:
*/ */
......
...@@ -299,10 +299,9 @@ public class TbCfOrder { ...@@ -299,10 +299,9 @@ public class TbCfOrder {
if (expressTemplate == null) return BigDecimal.ZERO; if (expressTemplate == null) return BigDecimal.ZERO;
//计算手续费 //计算手续费
//计算手续费 //计算手续费
BigDecimal handlingFee = expressTemplate.getHandlingFee()
.multiply(itemPrice);
return handlingFee; return expressTemplate.getHandlingFee()
.multiply(itemPrice);
} }
......
...@@ -8,7 +8,7 @@ import org.springframework.data.repository.query.Param; ...@@ -8,7 +8,7 @@ import org.springframework.data.repository.query.Param;
import java.util.List; import java.util.List;
public interface TbCfExpressTemplateRepository extends PagingAndSortingRepository<TbCfExpressTemplate,String> { public interface TbCfExpressTemplateRepository extends PagingAndSortingRepository<TbCfExpressTemplate,String> {
@Query(value = "select distinct a from #{#entityName} a WHERE a.templateId in (SELECT x.templateId FROM TbCfExpTemKeyword x WHERE x.keyword LIKE concat('%',:keyword,'%'))") @Query(value = "select distinct a from #{#entityName} a WHERE a.templateId in (SELECT x.templateId FROM TbCfExpTemKeyword x WHERE x.keyword LIKE concat('%',:keyword,'%') or x.enkeyword LIKE concat('%',:keyword,'%'))")
List<TbCfExpressTemplate> getTemplateByKeyword(@Param("keyword") String keyword); List<TbCfExpressTemplate> getTemplateByKeyword(@Param("keyword") String keyword);
TbCfExpressTemplate findFirstByOrderByTemplateIdAsc(); TbCfExpressTemplate findFirstByOrderByTemplateIdAsc();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论