|
@@ -275,6 +275,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
if (ObjectUtil.isEmpty(productInfoEhsdJson.getCustomerId())) {
|
|
|
//如果客户id为空就赋值为0 公司产品
|
|
|
productInfoEhsdJson.setCustomerId(0l);
|
|
|
+ productInfoEhsdJson.setType("1");//默认公司产品
|
|
|
}
|
|
|
productInfoDto.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson));
|
|
|
|
|
@@ -286,7 +287,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
//图片列表
|
|
|
ObsFileUtil.saveFile(productInfoDto.getImgList(), productInfoDto.getId(), 1);
|
|
|
//附件列表
|
|
|
- ObsFileUtil.saveFile(productInfoDto.getFileList(), productInfoDto.getId(), 2);
|
|
|
+ ObsFileUtil.saveFile(productInfoDto.getMinorImgList(), productInfoDto.getId(), 2);
|
|
|
+ //附件列表
|
|
|
+ ObsFileUtil.saveFile(productInfoDto.getFileList(), productInfoDto.getId(), 3);
|
|
|
}
|
|
|
|
|
|
@DSTransactional
|
|
@@ -298,7 +301,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
this.nameDuplication(ProductInfo::getName, productInfoDto.getName(), productInfoDto.getId(), "产品名称重复");
|
|
|
this.updateById(productInfoDto);
|
|
|
ObsFileUtil.editFile(productInfoDto.getImgList(), productInfoDto.getId(), 1);
|
|
|
- ObsFileUtil.editFile(productInfoDto.getFileList(), productInfoDto.getId(), 2);
|
|
|
+ ObsFileUtil.editFile(productInfoDto.getMinorImgList(), productInfoDto.getId(), 2);
|
|
|
+ ObsFileUtil.editFile(productInfoDto.getFileList(), productInfoDto.getId(), 3);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -307,10 +312,15 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
ProductInfoVo result = BeanUtil.toBean(ProductInfo, ProductInfoVo.class);
|
|
|
|
|
|
ProductInfoEhsdJson productInfoEhsdJson = JSONObject.parseObject(result.getEhsdJson(), ProductInfoEhsdJson.class);
|
|
|
- //赋值客户名称
|
|
|
- Customer customer = customerService.getById(productInfoEhsdJson.getCustomerId());
|
|
|
- productInfoEhsdJson.setCustomerName(customer.getName());
|
|
|
- result.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson));
|
|
|
+ //判断客户id不为空
|
|
|
+ if (ObjectUtil.isNotEmpty(productInfoEhsdJson) && ObjectUtil.isNotEmpty(productInfoEhsdJson.getCustomerId())) {
|
|
|
+ //赋值客户名称
|
|
|
+ Customer customer = customerService.getById(productInfoEhsdJson.getCustomerId());
|
|
|
+ if(ObjectUtil.isNotEmpty(customer)) {
|
|
|
+ productInfoEhsdJson.setCustomerName(customer.getName());
|
|
|
+ result.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson));
|
|
|
+ }
|
|
|
+ }
|
|
|
//赋值创建人名称
|
|
|
UserUtil.assignmentNickName(Arrays.asList(result), ProductInfoVo::getCreateUser, ProductInfoVo::setCreateUserName);
|
|
|
return result;
|