zhangherong
2025-05-28 25addf67536c8ba62f2f2ebf0e6ffe2e4154beba
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();
@@ -200,7 +227,7 @@
            eamInspectionOrder.setEquipmentCode(equipment.getEquipmentCode());
        }
        System.out.println("设备点检:" + eamInspectionOrder.getId());
        flowCommonService.initActBusiness("工单号:" + eamInspectionOrder.getOrderNum() + "设备编号" + eamInspectionOrder.getEquipmentCode() + "进行设备点检",
        flowCommonService.initActBusiness("工单号:" + eamInspectionOrder.getOrderNum() + "设备编号" + eamInspectionOrder.getEquipmentCode() + ";进行设备点检",
                eamInspectionOrder.getId(), "IEamInspectionOrderService", "eam_inspection", null);
        Map<String, Object> variables = new HashMap<>();
        variables.put("dataId", eamInspectionOrder.getId());