zhangherong
2025-07-10 bd56825b00f131000b721f4fa2e4619c56a612a0
Merge remote-tracking branch 'origin/master'
已修改3个文件
64 ■■■■ 文件已修改
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamWeekInspectionDetail.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekInspectionDetailController.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamWeekInspectionDetail.java
@@ -69,10 +69,11 @@
    @Excel(name = "点检人", width = 15)
    @ApiModelProperty(value = "点检人")
    private String inspector;
    /**点检时间*/
    @Excel(name = "点检时间", width = 15)
    @Excel(name = "点检时间(实际)", width = 15, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "点检时间")
    private String inspectTime;
    private Date inspectTime;
    public EamWeekInspectionDetail(){}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekInspectionDetailController.java
@@ -6,15 +6,16 @@
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.util.StrUtils;
import org.jeecg.modules.eam.entity.EamWeekInspectionDetail;
import org.jeecg.modules.eam.service.IEamWeekInspectionDetailService;
import org.jeecg.modules.eam.util.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description: 周点检工单明细
@@ -45,7 +46,17 @@
        queryWrapper.between(EamWeekInspectionDetail::getPlanInspectionDate, DateUtils.getFirstDayOfWeek(inspectionDate), DateUtils.getLastDayOfWeek(inspectionDate));
        queryWrapper.orderByAsc(EamWeekInspectionDetail::getItemCode);
        List<EamWeekInspectionDetail> list = eamWeekInspectionDetailService.list(queryWrapper);
        return Result.OK(list);
        //添加点检周点检是否已完成标识
        Map<String, Object> result = new HashMap<>();
        result.put("list", list);
        if (list != null && !list.isEmpty()) {
            if (!StrUtils.isEmpty(list.get(0).getInspector())) {
                result.put("weekInsFlag", true);
            } else {
                result.put("weekInsFlag", false);
            }
        }
        return Result.OK(result);
    }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -31,7 +31,6 @@
import org.jeecg.modules.eam.mapper.EamInspectionOrderMapper;
import org.jeecg.modules.eam.service.*;
import org.jeecg.modules.eam.util.DateUtils;
import org.jeecg.modules.eam.vo.InspectionVo;
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;
@@ -39,19 +38,18 @@
import org.jeecg.modules.flowable.service.IFlowDefinitionService;
import org.jeecg.modules.flowable.service.IFlowTaskService;
import org.jeecg.modules.system.service.ISysDictService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.vo.UserSelector;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
 * @Description: 点检工单
@@ -90,6 +88,8 @@
    private IEamMaintenanceStandardDetailService eamMaintenanceStandardDetailService;
    @Resource
    private ISysDictService sysDictService;
    @Resource
    private ISysUserService sysUserService;
    @Override
    public IPage<EamInspectionOrder> queryPageList(Page<EamInspectionOrder> page, EamInspectionOrderQuery query) {
@@ -598,8 +598,13 @@
                throw new JeecgBootException("任务不存在、已完成或已被他人认领");
            }
            EamEquipment equipment = eamEquipmentService.getById(eamInspectionOrder.getEquipmentId());
            if (equipment == null) {
                throw new JeecgBootException("设备不存在,请检查!");
            }
            // 设置流程变量
            setupProcessVariables(eamInspectionOrderRequest, eamInspectionOrder, user);
            setupProcessVariables(eamInspectionOrderRequest, eamInspectionOrder, user, equipment);
            // 完成流程任务
            Result result = flowTaskService.complete(eamInspectionOrderRequest);
@@ -661,13 +666,17 @@
        return true;
    }
    private void setupProcessVariables(EamInspectionOrderRequest request, EamInspectionOrder order, LoginUser user) {
    private void setupProcessVariables(EamInspectionOrderRequest request, EamInspectionOrder order, LoginUser user, EamEquipment equipment) {
        Map<String, Object> values = new HashMap<>();
        if (InspectionStatus.UNDER_INSPECTION.name().equals(order.getInspectionStatus()) && user.getUsername().equals(order.getOperator())) {
            // 点检人点检结束
            values.put("dataId", order.getId());
            values.put("organization", "点检人点检结束");
            values.put("comment", "点检人点检结束");
            // 获取下一步执行人
            List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0002);
            List<String> userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
            values.put("NextAssignee", userApprovalList);
            request.setComment("点检人点检结束");
        } else {
            // 维修工确认
@@ -696,10 +705,17 @@
                eamInspectionOrderDetailService.remove(new QueryWrapper<EamInspectionOrderDetail>().eq("order_id", order.getId()));
                eamInspectionOrderDetailService.saveBatch(request.getTableDetailList());
                if (request.getTableWeekDetailList() != null && !request.getTableWeekDetailList().isEmpty()) {
                    // 设置周点检
//                eamWeekInspectionDetailService.remove(new QueryWrapper<EamWeekInspectionDetail>().eq("order_id", order.getId()));
                    eamWeekInspectionDetailService.saveOrUpdateBatch(request.getTableWeekDetailList());
                if (request.getTableWeekDetailList() != null && !request.getTableWeekDetailList().isEmpty()) {
                    List<EamWeekInspectionDetail> tableWeekDetailList = request.getTableWeekDetailList();
                    for (EamWeekInspectionDetail eamWeekInspectionDetail : tableWeekDetailList) {
                        if (StringUtils.isEmpty(eamWeekInspectionDetail.getInspectionResult())) {
                            break;
                        }
                        eamWeekInspectionDetail.setInspector(user.getUsername());
                        eamWeekInspectionDetail.setInspectTime(new Date());
                    }
                    eamWeekInspectionDetailService.saveOrUpdateBatch(tableWeekDetailList);
                }
            } else if (InspectionStatus.WAIT_CONFIRM.name().equals(order.getInspectionStatus()) && StrUtil.isNotEmpty(request.getConfirmDealType())) {
                // 班组长确认任务
@@ -723,8 +739,10 @@
     */
    private void updateEamInspectionOrderDetail(EamInspectionOrder eamInspectionOrder) {
        List<EamInspectionOrderDetail> eamInspectionOrderDetails = eamInspectionOrderDetailService
                .list(new QueryWrapper<EamInspectionOrderDetail>()
                        .eq("order_id", eamInspectionOrder.getId()).eq("report_flag", "1").eq("inspection_result", "2"));
                .list(new LambdaQueryWrapper<EamInspectionOrderDetail>()
                        .eq(EamInspectionOrderDetail::getOrderId, eamInspectionOrder.getId()).eq(EamInspectionOrderDetail::getReportFlag, "1"));
        // TODO 点检完成后自动保修
        eamReportRepairService.reportRepairFromInspection(eamInspectionOrder.getEquipmentId(), eamInspectionOrder.getOperator(), eamInspectionOrderDetails);
    }