|
@@ -50,6 +50,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import com.ruoyi.common.utils.wrapper.SqlField;
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
+import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -164,6 +165,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
this.attributeAssign(records, ProductInfo::getAttrRawMaterialId, (item, product) -> {
|
|
|
item.setAttrRawMaterialName(product.getName());
|
|
|
});
|
|
|
+
|
|
|
+ //赋值业务员
|
|
|
+ UserUtil.assignmentNickName(records, ProductInfoVo::getSaleUserId, ProductInfoVo::setSaleUserName);
|
|
|
}
|
|
|
|
|
|
private IWrapper<ProductInfo> getPageWrapper(ProductInfoSelectDto dto) {
|
|
@@ -222,6 +226,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
wrapper.and(q1 -> q1.
|
|
|
and(q -> q.eq("pi", ProductInfo::getDefinition, 1)
|
|
|
.in("pi", ProductInfo::getCompanyId, SecurityUtils.getCompanyIds())
|
|
|
+ .and(q2 -> q2.eq("pi", ProductInfo::getSaleUserId, SecurityUtils.getUserId()).or().isNull("pi.sale_user_id"))
|
|
|
)
|
|
|
.or().eq("pi", ProductInfo::getDefinition, 2)
|
|
|
);
|
|
@@ -237,6 +242,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
|
|
|
ProductInfo productInfo = this.getById(id);
|
|
|
ProductInfoVo result = BeanUtil.toBean(productInfo, ProductInfoVo.class);
|
|
|
|
|
|
+ //赋值详情
|
|
|
+ setPageInfo(Collections.singletonList(result));
|
|
|
+
|
|
|
//赋值分类名称
|
|
|
ProductClassify productClassify = productClassifyService.getById(result.getProductClassifyId());
|
|
|
if (ObjectUtil.isNotEmpty(productClassify)) {
|