|
@@ -16,6 +16,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
import com.fjhx.customer.service.customer.CustomerService;
|
|
|
+import com.fjhx.file.entity.FileInfo;
|
|
|
+import com.fjhx.file.entity.FileInfoSelectDto;
|
|
|
+import com.fjhx.file.entity.FileInfoVo;
|
|
|
+import com.fjhx.file.mapper.FileInfoMapper;
|
|
|
+import com.fjhx.file.service.FileInfoService;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.item.entity.product.dto.ProductInfoDto;
|
|
|
import com.fjhx.item.entity.product.dto.ProductInfoSelectDto;
|
|
@@ -33,6 +38,7 @@ import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
|
|
|
import com.fjhx.tenant.entity.dict.po.DictTenantData;
|
|
|
import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
|
|
|
import com.fjhx.tenant.service.dict.DictTenantDataService;
|
|
|
+import com.fjhx.tenant.utils.DictUtils;
|
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
@@ -76,6 +82,8 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
|
|
|
@Autowired
|
|
|
private DictTenantDataService dictTenantDataService;
|
|
|
+ @Autowired
|
|
|
+ private FileInfoService fileInfoService;
|
|
|
|
|
|
@Override
|
|
|
public Page<ProductInfoVo> getPage(ProductInfoSelectDto dto) {
|
|
@@ -112,10 +120,10 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
wrapper.orderByAsc("pi", ProductInfo::getSpec);
|
|
|
|
|
|
//是否绑定工艺过滤
|
|
|
- if(ObjectUtil.isNotEmpty(dto.getIsTechnology())){
|
|
|
- if(Objects.equals(0,dto.getIsTechnology())){
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getIsTechnology())) {
|
|
|
+ if (Objects.equals(0, dto.getIsTechnology())) {
|
|
|
wrapper.isNull("aps.id");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
wrapper.isNotNull("aps.id");
|
|
|
}
|
|
|
}
|
|
@@ -266,6 +274,24 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
public ProductInfoVo detail(Long id) {
|
|
|
ProductInfo productInfo = this.getById(id);
|
|
|
ProductInfoVo result = BeanUtil.toBean(productInfo, ProductInfoVo.class);
|
|
|
+ //赋值分类名称
|
|
|
+ ProductClassify productClassify = productClassifyService.getById(result.getProductClassifyId());
|
|
|
+ if (ObjectUtil.isNotEmpty(productClassify)) {
|
|
|
+ result.setProductClassifyName(productClassify.getName());
|
|
|
+ }
|
|
|
+ //赋值 单位,物料类型 字典
|
|
|
+ Integer definition = result.getDefinition();
|
|
|
+ Map<String, String> materialUnitMap = DictUtils.getDictMap(definition == 1 ? "unit" : "material_unit");
|
|
|
+ Map<String, String> materialTypeMap = DictUtils.getDictMap(definition == 1 ? "product_type" : "material_type");
|
|
|
+ result.setTypeName(materialTypeMap.get(result.getType()));
|
|
|
+ result.setUnitName(materialUnitMap.get(result.getUnit()));
|
|
|
+ //赋值产品图片
|
|
|
+ FileInfoSelectDto dto = new FileInfoSelectDto();
|
|
|
+ dto.setBusinessIdList(Arrays.asList(result.getId()));
|
|
|
+ DynamicDataSourceContextHolder.push(SourceConstant.BASE);
|
|
|
+ Map<Long, List<FileInfoVo>> fileInfoMap = fileInfoService.getList(dto);
|
|
|
+ DynamicDataSourceContextHolder.poll();
|
|
|
+ result.setFileList(fileInfoMap.get(result.getId()));
|
|
|
return result;
|
|
|
}
|
|
|
|