Commit 30118af6 authored by honghy's avatar honghy Committed by wux

需求157 空运海运已装单显示授权品牌

parent 2250a953
......@@ -62,7 +62,12 @@ public interface OrderWarehouseInMapper extends AbstractMapper<OrderWarehouseInD
OrderWarehouseInDO getFirstOneOrderWarehouseInByProdId(@Param("orderId") Long orderId, @Param("prodId") Long prodId);
@ResultType(OrderWarehouseInBackItemVO.class)
@Select("select t.*,t1.prod_title_en,t1.prod_title_zh,t1.brand,t1.warehouse_in_prod_attr_ids as prodAttrIds,t1.material,t1.usage_ids from ecw_order_warehouse_in t LEFT JOIN ecw_order_item t1 on t.order_item_id=t1.order_item_id where t.order_id=#{orderId} and t.deleted=0")
@Select("select t.*,t1.prod_title_en,t1.prod_title_zh,t1.brand,t1.warehouse_in_prod_attr_ids as prodAttrIds,t1.material,t1.usage_ids,(SELECT 1" +
" FROM ecw_product_brand_empower a " +
" LEFT JOIN ecw_order_consignor b on b.order_id = t1.order_id " +
" LEFT JOIN ecw_order_consignee c on c.order_id = t1.order_id " +
" WHERE a.product_brand_id = t1.brand and (b.customer_id is not null OR c.customer_id is not null) " +
" AND (date_format(now(),'%Y-%m-%d') BETWEEN date_format(a.start_time,'%Y-%m-%d') AND date_format(a.end_time,'%Y-%m-%d')OR start_time IS NULL) AND a.deleted = 0 LIMIT 1) AS brandTag from ecw_order_warehouse_in t LEFT JOIN ecw_order_item t1 on t.order_item_id=t1.order_item_id where t.order_id=#{orderId} and t.deleted=0")
List<OrderWarehouseInBackItemVO> getOrderWarehouseInListOrderByInTime(@Param("orderId") Long orderId);
@ResultType(OrderWarehouseInSumBackVO.class)
......
package cn.iocoder.yudao.module.order.vo.orderWarehouseIn;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseIn.handler.OrderWarehouseInDetailsTypeHandler;
import cn.iocoder.yudao.module.order.vo.order.OrderWarehouseInDetailsVO;
import cn.iocoder.yudao.module.order.vo.orderLocation.OrderLocationBackVO;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -128,4 +126,6 @@ public class OrderWarehouseInBackItemVO {
@ApiModelProperty(value = "用途")
private String usageIds;
@ApiModelProperty(value = "品牌是否授权标识")
private Boolean brandTag;
}
......@@ -371,6 +371,17 @@ public interface ProductBrandEmpowerMapper extends AbstractMapper<ProductBrandEm
)
Long countBrankByCustomer(@Param("pageVO") ProductBrankByCustomerPageReqVO pageVO);
@Select(
{
"<script>",
" SELECT 1 " +
" FROM ecw_product_brand_empower a " +
" LEFT JOIN ecw_order_consignor b on b.order_id = #{orderId} " +
" LEFT JOIN ecw_order_consignee c on c.order_id = #{orderId} " +
" WHERE a.product_brand_id = #{brand} and (b.customer_id is not null OR c.customer_id is not null) " +
" AND (date_format(now(),'%Y-%m-%d') BETWEEN date_format(a.start_time,'%Y-%m-%d') AND date_format(a.end_time,'%Y-%m-%d')OR start_time IS NULL) AND a.deleted = 0 LIMIT 1",
"</script>"
}
)
Boolean getBrandTag(@Param("orderId") Long orderId,@Param("brand") Long brand);
}
package cn.iocoder.yudao.module.product.service.productbrandempower;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.product.vo.productbrandempower.*;
import cn.iocoder.yudao.module.product.dal.dataobject.productbrandempower.ProductBrandEmpowerDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.product.dal.dataobject.productbrandempower.ProductBrandEmpowerDO;
import cn.iocoder.yudao.module.product.vo.productbrandempower.*;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
/**
* 商品品牌授权 Service 接口
*
......@@ -110,4 +111,5 @@ public interface ProductBrandEmpowerService extends IService<ProductBrandEmpower
*/
List<ProductBrandEmpowerDO> getProductBrandEmpowerList(ProductBrandEmpowerExportReqVO exportReqVO);
Boolean getBrandTag(Long orderId, Long brand);
}
......@@ -443,4 +443,10 @@ public class ProductBrandEmpowerServiceImpl extends AbstractService<ProductBrand
return productBrandEmpowerMapper.selectList(exportReqVO);
}
@Override
public Boolean getBrandTag(Long orderId, Long brand) {
Boolean brandTag = productBrandEmpowerMapper.getBrandTag(orderId, brand);
return brandTag != null && brandTag;
}
}
......@@ -339,7 +339,8 @@ public class ShipmentAirLoadExcelExportListener {
preloadDto.setQuantity(item.getQuantityAll());
ProductBrankDO productBrank = productBrankService.getProductBrank(item.getBrand());
if(productBrank!=null && StringUtils.isNotBlank(productBrank.getTitleZh())){
preloadDto.setBrand(productBrank.getTitleZh());
Boolean brandTag = item.getBrandTag()!=null?true:false;
preloadDto.setBrand(productBrank.getTitleZh()+(brandTag?"(已授权)":""));
}
if(productBrank !=null && productBrank.getFiling()!=null){
preloadDto.setProductRecord(productBrank.getFiling().equals("0")? "N":"Y");
......
......@@ -29,6 +29,7 @@ import cn.iocoder.yudao.module.product.dal.dataobject.product.ProductDO;
import cn.iocoder.yudao.module.product.dal.dataobject.productbrank.ProductBrankDO;
import cn.iocoder.yudao.module.product.service.product.ProductAttrService;
import cn.iocoder.yudao.module.product.service.product.ProductService;
import cn.iocoder.yudao.module.product.service.productbrandempower.ProductBrandEmpowerService;
import cn.iocoder.yudao.module.product.service.productbrank.ProductBrankService;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxApprovalDO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO;
......@@ -116,6 +117,9 @@ public class ShipmentLoadExcelExportListener2 {
@Resource
private ProductAttrService productAttrService;
@Resource
private ProductBrandEmpowerService productBrandEmpowerService;
private static List<Integer> colorList = new ArrayList<>();
static {
colorList.add(22);
......@@ -335,8 +339,9 @@ public class ShipmentLoadExcelExportListener2 {
preloadDto.setProdTitleZh(item.getProdTitleZh()+ " " +item.getProdTitleEn());
preloadDto.setMerge(orderInfo.getOldNumbers());
ProductBrankDO productBrank = productBrankService.getProductBrank(item.getBrand());
Boolean brandTag = productBrandEmpowerService.getBrandTag(item.getOrderId(),item.getBrand());
if(productBrank!=null && StringUtils.isNotBlank(productBrank.getTitleZh())){
preloadDto.setBrand(productBrank.getTitleZh());
preloadDto.setBrand(productBrank.getTitleZh()+(brandTag?"(已授权)":""));
}
if(StringUtils.isNotBlank(item.getMaterial())){
preloadDto.setMaterial(DictFrameworkUtils.getDictDataFromCache("product_material",item.getMaterial()+"").getLabel());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment