| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.eims.domain.bo.MaintOrderBo; |
| | | import org.dromara.eims.domain.vo.MaintOrdeGroupVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | @SaCheckPermission("eims:maintOrder:list") |
| | | @GetMapping("/groupList") |
| | | public TableDataInfo<MaintOrdeGroupVo> group(EimsMaintOrderBo bo, PageQuery pageQuery) { |
| | | // return eimsMaintOrderService.queryPageList(bo, pageQuery); |
| | | return eimsMaintOrderService.queryPageGroupList(bo, pageQuery); |
| | | } |
| | | |
| | |
| | | } |
| | | String[] split = maintCode.split("_"); |
| | | bo.setEquId(Long.valueOf(split[0])); |
| | | bo.setPlanTime(DateUtils.parseDate(split[1])); |
| | | bo.setMaintCode(null); |
| | | // return eimsMaintOrderService.queryPageList(bo, pageQuery); |
| | | return eimsMaintOrderService.queryPageListCustom(bo, pageQuery); |
| | | LocalDate planTime = DateUtils.parseDate(split[1]).toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); |
| | | Map<String, Object> params = bo.getParams(); |
| | | params.put("beginPlanTime",startOfMonth); |
| | | params.put("endPlanTime",endOfMonth); |
| | | |
| | | TableDataInfo<EimsMaintOrderVo> tableDataInfo = eimsMaintOrderService.queryPageListCustom(bo, pageQuery); |
| | | tableDataInfo.getRows().forEach(e -> { |
| | | // 如果保养方法是维修,查询关联的备件 |
| | | if (DictConstants.MAINT_METHOD_DETAIL.REPAIR.equals(e.getMaintFun())) { |
| | | e.setSpareParts(eimsMaintOrderService.querySpareParts(e.getMaintCode())); |
| | | } |
| | | }); |
| | | return tableDataInfo; |
| | | } |
| | | |
| | | /** |
| | |
| | | return toAjax(eimsMaintOrderService.updateByBo(bo)); |
| | | } |
| | | |
| | | @SaCheckPermission("eims:maintOrder:edit") |
| | | @Log(title = "保养工单-批量修改", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping("editBatch") |
| | | public R<Void> editBatch(@Validated(EditGroup.class) @RequestBody MaintOrderBo bo) { |
| | | return toAjax(eimsMaintOrderService.updateBatchByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * 删除保养工单 |
| | | * |