|
@@ -7,7 +7,11 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.utils.Assert;
|
|
|
+import com.fjhx.customer.entity.customer.po.Customer;
|
|
|
+import com.fjhx.customer.service.customer.CustomerService;
|
|
|
+import com.fjhx.item.entity.product.po.ProductClassify;
|
|
|
import com.fjhx.item.entity.product.po.ProductInfo;
|
|
|
+import com.fjhx.item.service.product.ProductClassifyService;
|
|
|
import com.fjhx.item.service.product.ProductInfoService;
|
|
|
import com.fjhx.mes.entity.production.dto.ProduceOrderDetailSelectDto;
|
|
|
import com.fjhx.mes.entity.production.dto.ProductionOrderDetailDto;
|
|
@@ -68,6 +72,10 @@ public class ProduceOrderDetailServiceImpl extends ServiceImpl<ProduceOrderDetai
|
|
|
private ISysUserService sysUserService;
|
|
|
@Autowired
|
|
|
private ProductionSchedulingService productionSchedulingService;
|
|
|
+ @Autowired
|
|
|
+ private CustomerService customerService;
|
|
|
+ @Autowired
|
|
|
+ private ProductClassifyService productClassifyService;
|
|
|
|
|
|
@Override
|
|
|
public Page<ProductionOrderDetailVo> getPage(ProduceOrderDetailSelectDto dto) {
|
|
@@ -124,11 +132,16 @@ public class ProduceOrderDetailServiceImpl extends ServiceImpl<ProduceOrderDetai
|
|
|
wrapper.le("po", ProductionOrder::getCreateTime, dto.getEndTime());
|
|
|
//关键字
|
|
|
if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
|
|
|
+ //创建人检索
|
|
|
List<SysUser> list = sysUserService.list(IWrapper.<SysUser>getWrapper().like(SysUser::getNickName, dto.getKeyword()));
|
|
|
List<Long> uIds = list.stream().map(SysUser::getUserId).collect(Collectors.toList());
|
|
|
+ //客户检索
|
|
|
+ List<Long> cuIds = customerService.listObject(Customer::getId, q -> q.in(Customer::getName, dto.getKeyword()));
|
|
|
+
|
|
|
wrapper.and(q -> q
|
|
|
.like("po.code", dto.getKeyword())
|
|
|
.or().in("c.create_user", uIds)
|
|
|
+ .or().in("c.buy_corporation_id", cuIds)
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -153,6 +166,11 @@ public class ProduceOrderDetailServiceImpl extends ServiceImpl<ProduceOrderDetai
|
|
|
wrapper.eq("c.contract_type", dto.getContractType());
|
|
|
}
|
|
|
|
|
|
+ //欠料状态过滤
|
|
|
+ if (ObjectUtil.isNotEmpty(dto.getLackStatus())) {
|
|
|
+ wrapper.apply("IFNULL( t2.lackStatus, 0 ) = {0}", dto.getLackStatus());
|
|
|
+ }
|
|
|
+
|
|
|
return wrapper;
|
|
|
}
|
|
|
|
|
@@ -217,6 +235,8 @@ public class ProduceOrderDetailServiceImpl extends ServiceImpl<ProduceOrderDetai
|
|
|
//获取生产公司信息
|
|
|
Map<Long, String> companyNameMap = DeptUstil.getDeptNameMap(null);
|
|
|
|
|
|
+ //获取产品分类Map
|
|
|
+ Map<Long, ProductClassify> productClassifyNameTreeMap = productClassifyService.getNameTreeMap();
|
|
|
|
|
|
for (ProductionOrderDetailVo record : records) {
|
|
|
//赋值产品信息
|
|
@@ -230,7 +250,16 @@ public class ProduceOrderDetailServiceImpl extends ServiceImpl<ProduceOrderDetai
|
|
|
record.setProductWidth(product.getWidth());
|
|
|
record.setProductHeight(product.getHeight());
|
|
|
record.setProductColor(product.getColor());
|
|
|
+ record.setProductFrontalTexture(product.getFrontalTexture());
|
|
|
+ record.setProductReverseTexture(product.getReverseTexture());
|
|
|
+ record.setProductLogoLength(product.getLogoLength());
|
|
|
+ record.setProductLogoWidth(product.getLogoWidth());
|
|
|
+
|
|
|
|
|
|
+ //赋值分类
|
|
|
+ ProductClassify productClassify = productClassifyNameTreeMap.getOrDefault(product.getProductClassifyId(), new ProductClassify());
|
|
|
+ record.setProductClassifyName(productClassify.getName());
|
|
|
+ record.setProductClassifyNames(productClassify.getTreeName());
|
|
|
}
|
|
|
|
|
|
// //赋值原材料信息
|
|
@@ -256,11 +285,18 @@ public class ProduceOrderDetailServiceImpl extends ServiceImpl<ProduceOrderDetai
|
|
|
record.setCompanyName(companyNameMap.get(record.getCompanyId()));
|
|
|
record.setContractCompanyName(companyNameMap.get(record.getContractCompanyId()));
|
|
|
|
|
|
+ //赋值部门名称
|
|
|
+ record.setContractDeptName(companyNameMap.get(record.getContractDeptId()));
|
|
|
}
|
|
|
|
|
|
//赋值业务员名称
|
|
|
UserUtil.assignmentNickName(records, ProductionOrderDetailVo::getSaleUserId, ProductionOrderDetailVo::setSaleUserName);
|
|
|
|
|
|
+ //赋值客户名称
|
|
|
+ customerService.attributeAssign(records, ProductionOrderDetailVo::getCustomerId, (item, customer) -> {
|
|
|
+ item.setCustomerName(customer.getName());
|
|
|
+ });
|
|
|
+
|
|
|
return page;
|
|
|
}
|
|
|
|