zhangherong
2025-05-06 915a2e40175c6390802af1257e57effea5fd02ef
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -33,6 +33,8 @@
import org.jeecg.modules.eam.request.EamInspectionOrderQuery;
import org.jeecg.modules.eam.request.EamInspectionOrderRequest;
import org.jeecg.modules.eam.service.*;
import org.jeecg.modules.eam.vo.EquipmentInspectionStatistics;
import org.jeecg.modules.eam.vo.EquipmentRepairStatistics;
import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness;
import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl;
import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI;
@@ -40,6 +42,7 @@
import org.jeecg.modules.flowable.service.IFlowDefinitionService;
import org.jeecg.modules.flowable.service.IFlowTaskService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.IMdcProductionService;
import org.jeecg.modules.system.service.IMdcUserProductionService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -47,6 +50,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@@ -83,6 +87,8 @@
    private IEamReportRepairService eamReportRepairService;
    @Autowired
    private IEamEquipmentExtendService eamEquipmentExtendService;
    @Autowired
    private IMdcProductionService mdcProductionService;
    @Override
    public IPage<EamInspectionOrder> queryPageList(Page<EamInspectionOrder> page, EamInspectionOrderQuery query) {
@@ -148,6 +154,27 @@
    }
    @Override
    public List<EquipmentInspectionStatistics> equipmentInspectionStatistics(String productionId, LocalDate firstOfMonth, LocalDate today) {
        if (StringUtils.isNotBlank(productionId)) {
            //车间编码不为空
            List<String> productIds = mdcProductionService.recursionChildren(productionId);
            if (CollectionUtil.isEmpty(productIds)) {
                return Collections.emptyList();
            }
            List<EquipmentInspectionStatistics> list = this.baseMapper.equipmentInspectionStatistics(productIds, firstOfMonth.toString(), today.plusDays(1).toString());
            if (CollectionUtil.isEmpty(list)) {
                return Collections.emptyList();
            }
            return list;
        }
        List<EquipmentInspectionStatistics> list = this.baseMapper.equipmentInspectionStatistics(null, firstOfMonth.toString(), today.plusDays(1).toString());
        if (CollectionUtil.isEmpty(list)) {
            return Collections.emptyList();
        }
        return list;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean addInspectionOrder(EamInspectionOrderRequest eamInspectionOrderRequest) {
        EamInspectionOrder eamInspectionOrder = new EamInspectionOrder();