|
@@ -32,6 +32,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -60,6 +61,18 @@ public class ProductionReportingDetailServiceImpl extends ServiceImpl<Production
|
|
|
public Page<ProductionReportingDetailVo> getPage(ProductionReportingDetailSelectDto dto) {
|
|
|
IWrapper<ProductionReportingDetail> wrapper = getWrapper();
|
|
|
wrapper.orderByDesc("prd", ProductionReportingDetail::getId);
|
|
|
+
|
|
|
+ //权限过滤:生产报工-子公司看自己的,总公司看全部
|
|
|
+ Long companyId = SecurityUtils.getCompanyId();
|
|
|
+ if (!Objects.equals(companyId, 100L)) {
|
|
|
+ wrapper.eq("prd", ProductionReportingDetail::getCompanyId, companyId);
|
|
|
+ } else {
|
|
|
+ wrapper.eq("prd", ProductionReportingDetail::getCompanyId, dto.getCompanyId());
|
|
|
+ }
|
|
|
+
|
|
|
+ //工序过滤
|
|
|
+ wrapper.eq("prd", ProductionReportingDetail::getProductionProcessesId, dto.getProductionProcessesId());
|
|
|
+
|
|
|
Page<ProductionReportingDetailVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
List<ProductionReportingDetailVo> records = page.getRecords();
|
|
|
if (ObjectUtil.isEmpty(records)) {
|