hdy
2024-03-15 b5450a251628cc9690b4ad51d9f8b6baea1c8509
设备保养项目、计划新增
已修改1个文件
已添加18个文件
1967 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/controller/EmInspectionPlanArchivesController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/domain/EmInspectionPlanArchives.java 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/mapper/EmInspectionPlanArchivesMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/service/IEmInspectionPlanArchivesService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/service/impl/EmInspectionPlanArchivesServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/controller/EmInspectionPlanItemsController.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/domain/EmInspectionPlanItems.java 179 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/mapper/EmInspectionPlanItemsMapper.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/service/IEmInspectionPlanItemsService.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/service/impl/EmInspectionPlanItemsServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/inspectionPlanArchives/EmInspectionPlanArchivesMapper.xml 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/em/inspectionPlanItems/EmInspectionPlanItemsMapper.xml 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/inspectionPlanArchives/inspectionPlanArchives.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/em/inspectionPlanItems/inspectionPlanItems.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/components/inspectionPlanArchives/index.vue 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/components/inspectionPlanItems/index.vue 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionPlan/index.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionPlan/machinery.vue 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/em/inspectionPlan/subject.vue 144 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/controller/EmInspectionPlanArchivesController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.jcdm.main.em.inspectionPlanArchives.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.main.em.inspectionPlanArchives.domain.EmInspectionPlanArchives;
import com.jcdm.main.em.inspectionPlanArchives.service.IEmInspectionPlanArchivesService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单Controller
 *
 * @author Yi
 * @date 2024-03-14
 */
@RestController
@RequestMapping("/em/inspectionPlanArchives")
public class EmInspectionPlanArchivesController extends BaseController
{
    @Autowired
    private IEmInspectionPlanArchivesService emInspectionPlanArchivesService;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:list')")
    @GetMapping("/list")
    public TableDataInfo list(EmInspectionPlanArchives emInspectionPlanArchives)
    {
        startPage();
        List<EmInspectionPlanArchives> list = emInspectionPlanArchivesService.selectEmInspectionPlanArchivesList(emInspectionPlanArchives);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºç‚¹æ£€ä¿å…»è®¡åˆ’设备清单列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:export')")
    @Log(title = "点检保养计划设备清单", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EmInspectionPlanArchives emInspectionPlanArchives)
    {
        List<EmInspectionPlanArchives> list = emInspectionPlanArchivesService.selectEmInspectionPlanArchivesList(emInspectionPlanArchives);
        ExcelUtil<EmInspectionPlanArchives> util = new ExcelUtil<EmInspectionPlanArchives>(EmInspectionPlanArchives.class);
        util.exportExcel(response, list, "点检保养计划设备清单数据");
    }
    /**
     * èŽ·å–点检保养计划设备清单详细信息
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(emInspectionPlanArchivesService.selectEmInspectionPlanArchivesById(id));
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:add')")
    @Log(title = "点检保养计划设备清单", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmInspectionPlanArchives emInspectionPlanArchives)
    {
        return toAjax(emInspectionPlanArchivesService.insertEmInspectionPlanArchives(emInspectionPlanArchives));
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:edit')")
    @Log(title = "点检保养计划设备清单", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmInspectionPlanArchives emInspectionPlanArchives)
    {
        return toAjax(emInspectionPlanArchivesService.updateEmInspectionPlanArchives(emInspectionPlanArchives));
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanArchives:remove')")
    @Log(title = "点检保养计划设备清单", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(emInspectionPlanArchivesService.deleteEmInspectionPlanArchivesByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/domain/EmInspectionPlanArchives.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,194 @@
package com.jcdm.main.em.inspectionPlanArchives.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单对象 em_inspection_plan_archives
 *
 * @author Yi
 * @date 2024-03-14
 */
public class EmInspectionPlanArchives extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** è®¾å¤‡ç¼–码 */
    @Excel(name = "设备编码")
    private String equipmentCode;
    /** è®¾å¤‡åç§° */
    @Excel(name = "设备名称")
    private String equipmentName;
    /** å“ç‰Œ */
    @Excel(name = "品牌")
    private String equipmentBrand;
    /** è§„格型号 */
    @Excel(name = "规格型号")
    private String equipmentSpec;
    /** åˆ›å»ºäºº */
    @Excel(name = "创建人")
    private String createUser;
    /** æ›´æ–°äºº */
    @Excel(name = "更新人")
    private String updateUser;
    /** é¢„留字段1 */
    @Excel(name = "预留字段1")
    private String spareField1;
    /** é¢„留字段2 */
    @Excel(name = "预留字段2")
    private String spareField2;
    /** é¢„留字段3 */
    @Excel(name = "预留字段3")
    private Long spareField3;
    /** é¢„留字段4 */
    @Excel(name = "预留字段4")
    private Long spareField4;
    /** è®¡åˆ’编号 */
    @Excel(name = "计划编号")
    private String planCode;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setEquipmentCode(String equipmentCode)
    {
        this.equipmentCode = equipmentCode;
    }
    public String getEquipmentCode()
    {
        return equipmentCode;
    }
    public void setEquipmentName(String equipmentName)
    {
        this.equipmentName = equipmentName;
    }
    public String getEquipmentName()
    {
        return equipmentName;
    }
    public void setEquipmentBrand(String equipmentBrand)
    {
        this.equipmentBrand = equipmentBrand;
    }
    public String getEquipmentBrand()
    {
        return equipmentBrand;
    }
    public void setEquipmentSpec(String equipmentSpec)
    {
        this.equipmentSpec = equipmentSpec;
    }
    public String getEquipmentSpec()
    {
        return equipmentSpec;
    }
    public void setCreateUser(String createUser)
    {
        this.createUser = createUser;
    }
    public String getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(String updateUser)
    {
        this.updateUser = updateUser;
    }
    public String getUpdateUser()
    {
        return updateUser;
    }
    public void setSpareField1(String spareField1)
    {
        this.spareField1 = spareField1;
    }
    public String getSpareField1()
    {
        return spareField1;
    }
    public void setSpareField2(String spareField2)
    {
        this.spareField2 = spareField2;
    }
    public String getSpareField2()
    {
        return spareField2;
    }
    public void setSpareField3(Long spareField3)
    {
        this.spareField3 = spareField3;
    }
    public Long getSpareField3()
    {
        return spareField3;
    }
    public void setSpareField4(Long spareField4)
    {
        this.spareField4 = spareField4;
    }
    public Long getSpareField4()
    {
        return spareField4;
    }
    public void setPlanCode(String planCode)
    {
        this.planCode = planCode;
    }
    public String getPlanCode()
    {
        return planCode;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("equipmentCode", getEquipmentCode())
            .append("equipmentName", getEquipmentName())
            .append("equipmentBrand", getEquipmentBrand())
            .append("equipmentSpec", getEquipmentSpec())
            .append("remark", getRemark())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("spareField3", getSpareField3())
            .append("spareField4", getSpareField4())
            .append("planCode", getPlanCode())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/mapper/EmInspectionPlanArchivesMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlanArchives.mapper;
import java.util.List;
import com.jcdm.main.em.inspectionPlanArchives.domain.EmInspectionPlanArchives;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单Mapper接口
 *
 * @author Yi
 * @date 2024-03-14
 */
public interface EmInspectionPlanArchivesMapper
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     */
    public EmInspectionPlanArchives selectEmInspectionPlanArchivesById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单列表
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单集合
     */
    public List<EmInspectionPlanArchives> selectEmInspectionPlanArchivesList(EmInspectionPlanArchives emInspectionPlanArchives);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlanArchives(EmInspectionPlanArchives emInspectionPlanArchives);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlanArchives(EmInspectionPlanArchives emInspectionPlanArchives);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanArchivesById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanArchivesByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/service/IEmInspectionPlanArchivesService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlanArchives.service;
import java.util.List;
import com.jcdm.main.em.inspectionPlanArchives.domain.EmInspectionPlanArchives;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单Service接口
 *
 * @author Yi
 * @date 2024-03-14
 */
public interface IEmInspectionPlanArchivesService
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     */
    public EmInspectionPlanArchives selectEmInspectionPlanArchivesById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单列表
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单集合
     */
    public List<EmInspectionPlanArchives> selectEmInspectionPlanArchivesList(EmInspectionPlanArchives emInspectionPlanArchives);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlanArchives(EmInspectionPlanArchives emInspectionPlanArchives);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlanArchives(EmInspectionPlanArchives emInspectionPlanArchives);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养计划设备清单主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanArchivesByIds(Long[] ids);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单信息
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanArchivesById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanArchives/service/impl/EmInspectionPlanArchivesServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.em.inspectionPlanArchives.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.em.inspectionPlanArchives.mapper.EmInspectionPlanArchivesMapper;
import com.jcdm.main.em.inspectionPlanArchives.domain.EmInspectionPlanArchives;
import com.jcdm.main.em.inspectionPlanArchives.service.IEmInspectionPlanArchivesService;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单Service业务层处理
 *
 * @author Yi
 * @date 2024-03-14
 */
@Service
public class EmInspectionPlanArchivesServiceImpl implements IEmInspectionPlanArchivesService
{
    @Autowired
    private EmInspectionPlanArchivesMapper emInspectionPlanArchivesMapper;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     */
    @Override
    public EmInspectionPlanArchives selectEmInspectionPlanArchivesById(Long id)
    {
        return emInspectionPlanArchivesMapper.selectEmInspectionPlanArchivesById(id);
    }
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单列表
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     */
    @Override
    public List<EmInspectionPlanArchives> selectEmInspectionPlanArchivesList(EmInspectionPlanArchives emInspectionPlanArchives)
    {
        return emInspectionPlanArchivesMapper.selectEmInspectionPlanArchivesList(emInspectionPlanArchives);
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç»“æžœ
     */
    @Override
    public int insertEmInspectionPlanArchives(EmInspectionPlanArchives emInspectionPlanArchives)
    {
        emInspectionPlanArchives.setCreateTime(DateUtils.getNowDate());
        return emInspectionPlanArchivesMapper.insertEmInspectionPlanArchives(emInspectionPlanArchives);
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param emInspectionPlanArchives ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     * @return ç»“æžœ
     */
    @Override
    public int updateEmInspectionPlanArchives(EmInspectionPlanArchives emInspectionPlanArchives)
    {
        emInspectionPlanArchives.setUpdateTime(DateUtils.getNowDate());
        return emInspectionPlanArchivesMapper.updateEmInspectionPlanArchives(emInspectionPlanArchives);
    }
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养计划设备清单主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanArchivesByIds(Long[] ids)
    {
        return emInspectionPlanArchivesMapper.deleteEmInspectionPlanArchivesByIds(ids);
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单信息
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanArchivesById(Long id)
    {
        return emInspectionPlanArchivesMapper.deleteEmInspectionPlanArchivesById(id);
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/controller/EmInspectionPlanItemsController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,104 @@
package com.jcdm.main.em.inspectionPlanItems.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jcdm.common.annotation.Log;
import com.jcdm.common.core.controller.BaseController;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.enums.BusinessType;
import com.jcdm.main.em.inspectionPlanItems.domain.EmInspectionPlanItems;
import com.jcdm.main.em.inspectionPlanItems.service.IEmInspectionPlanItemsService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子Controller
 *
 * @author Yi
 * @date 2024-03-13
 */
@RestController
@RequestMapping("/em/inspectionPlanItems")
public class EmInspectionPlanItemsController extends BaseController
{
    @Autowired
    private IEmInspectionPlanItemsService emInspectionPlanItemsService;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanItems:list')")
    @GetMapping("/list")
    public TableDataInfo list(EmInspectionPlanItems emInspectionPlanItems)
    {
        startPage();
        List<EmInspectionPlanItems> list = emInspectionPlanItemsService.selectEmInspectionPlanItemsList(emInspectionPlanItems);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子列表
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanItems:export')")
    @Log(title = "点检保养计划点检项目子", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, EmInspectionPlanItems emInspectionPlanItems)
    {
        List<EmInspectionPlanItems> list = emInspectionPlanItemsService.selectEmInspectionPlanItemsList(emInspectionPlanItems);
        ExcelUtil<EmInspectionPlanItems> util = new ExcelUtil<EmInspectionPlanItems>(EmInspectionPlanItems.class);
        util.exportExcel(response, list, "点检保养计划点检项目子数据");
    }
    /**
     * èŽ·å–点检保养计划点检项目子详细信息
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanItems:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(emInspectionPlanItemsService.selectEmInspectionPlanItemsById(id));
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanItems:add')")
    @Log(title = "点检保养计划点检项目子", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody EmInspectionPlanItems emInspectionPlanItems)
    {
        return toAjax(emInspectionPlanItemsService.insertEmInspectionPlanItems(emInspectionPlanItems));
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanItems:edit')")
    @Log(title = "点检保养计划点检项目子", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody EmInspectionPlanItems emInspectionPlanItems)
    {
        return toAjax(emInspectionPlanItemsService.updateEmInspectionPlanItems(emInspectionPlanItems));
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     */
    @PreAuthorize("@ss.hasPermi('em:inspectionPlanItems:remove')")
    @Log(title = "点检保养计划点检项目子", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(emInspectionPlanItemsService.deleteEmInspectionPlanItemsByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/domain/EmInspectionPlanItems.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,179 @@
package com.jcdm.main.em.inspectionPlanItems.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.jcdm.common.annotation.Excel;
import com.jcdm.common.core.domain.BaseEntity;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子对象 em_inspection_plan_items
 *
 * @author Yi
 * @date 2024-03-13
 */
public class EmInspectionPlanItems extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ID */
    private Long id;
    /** é¡¹ç›®ç¼–号 */
    @Excel(name = "项目编号")
    private String itemsCode;
    /** é¡¹ç›®åç§° */
    @Excel(name = "项目名称")
    private String itemsName;
    /** é¡¹ç›®ç±»åž‹ */
    @Excel(name = "项目类型")
    private String itemsType;
    /** æ ‡å‡† */
    @Excel(name = "标准")
    private String standard;
    /** é¡¹ç›®å†…容 */
    @Excel(name = "项目内容")
    private String itemsContent;
    /** åˆ›å»ºäºº */
    @Excel(name = "创建人")
    private String createUser;
    /** æ›´æ–°äºº */
    @Excel(name = "更新人")
    private String updateUser;
    /** é¢„留字段1 */
    @Excel(name = "预留字段1")
    private String spareField1;
    /** é¢„留字段2 */
    @Excel(name = "预留字段2")
    private String spareField2;
    /** è®¡åˆ’编号 */
    @Excel(name = "计划编号")
    private String planCode;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setItemsCode(String itemsCode)
    {
        this.itemsCode = itemsCode;
    }
    public String getItemsCode()
    {
        return itemsCode;
    }
    public void setItemsName(String itemsName)
    {
        this.itemsName = itemsName;
    }
    public String getItemsName()
    {
        return itemsName;
    }
    public void setItemsType(String itemsType)
    {
        this.itemsType = itemsType;
    }
    public String getItemsType()
    {
        return itemsType;
    }
    public void setStandard(String standard)
    {
        this.standard = standard;
    }
    public String getStandard()
    {
        return standard;
    }
    public void setItemsContent(String itemsContent)
    {
        this.itemsContent = itemsContent;
    }
    public String getItemsContent()
    {
        return itemsContent;
    }
    public void setCreateUser(String createUser)
    {
        this.createUser = createUser;
    }
    public String getCreateUser()
    {
        return createUser;
    }
    public void setUpdateUser(String updateUser)
    {
        this.updateUser = updateUser;
    }
    public String getUpdateUser()
    {
        return updateUser;
    }
    public void setSpareField1(String spareField1)
    {
        this.spareField1 = spareField1;
    }
    public String getSpareField1()
    {
        return spareField1;
    }
    public void setSpareField2(String spareField2)
    {
        this.spareField2 = spareField2;
    }
    public String getSpareField2()
    {
        return spareField2;
    }
    public void setPlanCode(String planCode)
    {
        this.planCode = planCode;
    }
    public String getPlanCode()
    {
        return planCode;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("itemsCode", getItemsCode())
            .append("itemsName", getItemsName())
            .append("itemsType", getItemsType())
            .append("standard", getStandard())
            .append("itemsContent", getItemsContent())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("planCode", getPlanCode())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/mapper/EmInspectionPlanItemsMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlanItems.mapper;
import java.util.List;
import com.jcdm.main.em.inspectionPlanItems.domain.EmInspectionPlanItems;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子Mapper接口
 *
 * @author Yi
 * @date 2024-03-13
 */
public interface EmInspectionPlanItemsMapper
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     */
    public EmInspectionPlanItems selectEmInspectionPlanItemsById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子列表
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子集合
     */
    public List<EmInspectionPlanItems> selectEmInspectionPlanItemsList(EmInspectionPlanItems emInspectionPlanItems);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlanItems(EmInspectionPlanItems emInspectionPlanItems);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlanItems(EmInspectionPlanItems emInspectionPlanItems);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanItemsById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanItemsByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/service/IEmInspectionPlanItemsService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package com.jcdm.main.em.inspectionPlanItems.service;
import java.util.List;
import com.jcdm.main.em.inspectionPlanItems.domain.EmInspectionPlanItems;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子Service接口
 *
 * @author Yi
 * @date 2024-03-13
 */
public interface IEmInspectionPlanItemsService
{
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     */
    public EmInspectionPlanItems selectEmInspectionPlanItemsById(Long id);
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子列表
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子集合
     */
    public List<EmInspectionPlanItems> selectEmInspectionPlanItemsList(EmInspectionPlanItems emInspectionPlanItems);
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç»“æžœ
     */
    public int insertEmInspectionPlanItems(EmInspectionPlanItems emInspectionPlanItems);
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç»“æžœ
     */
    public int updateEmInspectionPlanItems(EmInspectionPlanItems emInspectionPlanItems);
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养计划点检项目子主键集合
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanItemsByIds(Long[] ids);
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子信息
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子主键
     * @return ç»“æžœ
     */
    public int deleteEmInspectionPlanItemsById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/em/inspectionPlanItems/service/impl/EmInspectionPlanItemsServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.em.inspectionPlanItems.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.em.inspectionPlanItems.mapper.EmInspectionPlanItemsMapper;
import com.jcdm.main.em.inspectionPlanItems.domain.EmInspectionPlanItems;
import com.jcdm.main.em.inspectionPlanItems.service.IEmInspectionPlanItemsService;
/**
 * ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子Service业务层处理
 *
 * @author Yi
 * @date 2024-03-13
 */
@Service
public class EmInspectionPlanItemsServiceImpl implements IEmInspectionPlanItemsService
{
    @Autowired
    private EmInspectionPlanItemsMapper emInspectionPlanItemsMapper;
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子主键
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     */
    @Override
    public EmInspectionPlanItems selectEmInspectionPlanItemsById(Long id)
    {
        return emInspectionPlanItemsMapper.selectEmInspectionPlanItemsById(id);
    }
    /**
     * æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子列表
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     */
    @Override
    public List<EmInspectionPlanItems> selectEmInspectionPlanItemsList(EmInspectionPlanItems emInspectionPlanItems)
    {
        return emInspectionPlanItemsMapper.selectEmInspectionPlanItemsList(emInspectionPlanItems);
    }
    /**
     * æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç»“æžœ
     */
    @Override
    public int insertEmInspectionPlanItems(EmInspectionPlanItems emInspectionPlanItems)
    {
        emInspectionPlanItems.setCreateTime(DateUtils.getNowDate());
        return emInspectionPlanItemsMapper.insertEmInspectionPlanItems(emInspectionPlanItems);
    }
    /**
     * ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param emInspectionPlanItems ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     * @return ç»“æžœ
     */
    @Override
    public int updateEmInspectionPlanItems(EmInspectionPlanItems emInspectionPlanItems)
    {
        emInspectionPlanItems.setUpdateTime(DateUtils.getNowDate());
        return emInspectionPlanItemsMapper.updateEmInspectionPlanItems(emInspectionPlanItems);
    }
    /**
     * æ‰¹é‡åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
     *
     * @param ids éœ€è¦åˆ é™¤çš„点检保养计划点检项目子主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanItemsByIds(Long[] ids)
    {
        return emInspectionPlanItemsMapper.deleteEmInspectionPlanItemsByIds(ids);
    }
    /**
     * åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子信息
     *
     * @param id ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteEmInspectionPlanItemsById(Long id)
    {
        return emInspectionPlanItemsMapper.deleteEmInspectionPlanItemsById(id);
    }
}
jcdm-main/src/main/resources/mapper/em/inspectionPlanArchives/EmInspectionPlanArchivesMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jcdm.main.em.inspectionPlanArchives.mapper.EmInspectionPlanArchivesMapper">
    <resultMap type="EmInspectionPlanArchives" id="EmInspectionPlanArchivesResult">
        <result property="id"    column="id"    />
        <result property="equipmentCode"    column="equipment_code"    />
        <result property="equipmentName"    column="equipment_name"    />
        <result property="equipmentBrand"    column="equipment_brand"    />
        <result property="equipmentSpec"    column="equipment_spec"    />
        <result property="remark"    column="remark"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <result property="spareField3"    column="spare_field_3"    />
        <result property="spareField4"    column="spare_field_4"    />
        <result property="planCode"    column="plan_code"    />
    </resultMap>
    <sql id="selectEmInspectionPlanArchivesVo">
        select id, equipment_code, equipment_name, equipment_brand, equipment_spec, remark, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4, plan_code from em_inspection_plan_archives
    </sql>
    <select id="selectEmInspectionPlanArchivesList" parameterType="EmInspectionPlanArchives" resultMap="EmInspectionPlanArchivesResult">
        <include refid="selectEmInspectionPlanArchivesVo"/>
        <where>
            <if test="equipmentCode != null  and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
            <if test="equipmentName != null  and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</if>
            <if test="equipmentBrand != null  and equipmentBrand != ''"> and equipment_brand = #{equipmentBrand}</if>
            <if test="equipmentSpec != null  and equipmentSpec != ''"> and equipment_spec = #{equipmentSpec}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
            <if test="spareField3 != null "> and spare_field_3 = #{spareField3}</if>
            <if test="spareField4 != null "> and spare_field_4 = #{spareField4}</if>
            <if test="planCode != null  and planCode != ''"> and plan_code = #{planCode}</if>
        </where>
    </select>
    <select id="selectEmInspectionPlanArchivesById" parameterType="Long" resultMap="EmInspectionPlanArchivesResult">
        <include refid="selectEmInspectionPlanArchivesVo"/>
        where id = #{id}
    </select>
    <insert id="insertEmInspectionPlanArchives" parameterType="EmInspectionPlanArchives" useGeneratedKeys="true" keyProperty="id">
        insert into em_inspection_plan_archives
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="equipmentCode != null">equipment_code,</if>
            <if test="equipmentName != null">equipment_name,</if>
            <if test="equipmentBrand != null">equipment_brand,</if>
            <if test="equipmentSpec != null">equipment_spec,</if>
            <if test="remark != null">remark,</if>
            <if test="createUser != null">create_user,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="spareField3 != null">spare_field_3,</if>
            <if test="spareField4 != null">spare_field_4,</if>
            <if test="planCode != null">plan_code,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="equipmentCode != null">#{equipmentCode},</if>
            <if test="equipmentName != null">#{equipmentName},</if>
            <if test="equipmentBrand != null">#{equipmentBrand},</if>
            <if test="equipmentSpec != null">#{equipmentSpec},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="spareField3 != null">#{spareField3},</if>
            <if test="spareField4 != null">#{spareField4},</if>
            <if test="planCode != null">#{planCode},</if>
         </trim>
    </insert>
    <update id="updateEmInspectionPlanArchives" parameterType="EmInspectionPlanArchives">
        update em_inspection_plan_archives
        <trim prefix="SET" suffixOverrides=",">
            <if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
            <if test="equipmentName != null">equipment_name = #{equipmentName},</if>
            <if test="equipmentBrand != null">equipment_brand = #{equipmentBrand},</if>
            <if test="equipmentSpec != null">equipment_spec = #{equipmentSpec},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
            <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
            <if test="planCode != null">plan_code = #{planCode},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteEmInspectionPlanArchivesById" parameterType="Long">
        delete from em_inspection_plan_archives where id = #{id}
    </delete>
    <delete id="deleteEmInspectionPlanArchivesByIds" parameterType="String">
        delete from em_inspection_plan_archives where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-main/src/main/resources/mapper/em/inspectionPlanItems/EmInspectionPlanItemsMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jcdm.main.em.inspectionPlanItems.mapper.EmInspectionPlanItemsMapper">
    <resultMap type="EmInspectionPlanItems" id="EmInspectionPlanItemsResult">
        <result property="id"    column="id"    />
        <result property="itemsCode"    column="items_code"    />
        <result property="itemsName"    column="items_name"    />
        <result property="itemsType"    column="items_type"    />
        <result property="standard"    column="standard"    />
        <result property="itemsContent"    column="items_content"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <result property="planCode"    column="plan_code"    />
    </resultMap>
    <sql id="selectEmInspectionPlanItemsVo">
        select id, items_code, items_name, items_type, standard, items_content, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, plan_code from em_inspection_plan_items
    </sql>
    <select id="selectEmInspectionPlanItemsList" parameterType="EmInspectionPlanItems" resultMap="EmInspectionPlanItemsResult">
        <include refid="selectEmInspectionPlanItemsVo"/>
        <where>
            <if test="itemsCode != null  and itemsCode != ''"> and items_code = #{itemsCode}</if>
            <if test="itemsName != null  and itemsName != ''"> and items_name like concat('%', #{itemsName}, '%')</if>
            <if test="itemsType != null  and itemsType != ''"> and items_type = #{itemsType}</if>
            <if test="standard != null  and standard != ''"> and standard = #{standard}</if>
            <if test="itemsContent != null  and itemsContent != ''"> and items_content = #{itemsContent}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
            <if test="planCode != null  and planCode != ''"> and plan_code = #{planCode}</if>
        </where>
    </select>
    <select id="selectEmInspectionPlanItemsById" parameterType="Long" resultMap="EmInspectionPlanItemsResult">
        <include refid="selectEmInspectionPlanItemsVo"/>
        where id = #{id}
    </select>
    <insert id="insertEmInspectionPlanItems" parameterType="EmInspectionPlanItems" useGeneratedKeys="true" keyProperty="id">
        insert into em_inspection_plan_items
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="itemsCode != null">items_code,</if>
            <if test="itemsName != null">items_name,</if>
            <if test="itemsType != null">items_type,</if>
            <if test="standard != null">standard,</if>
            <if test="itemsContent != null">items_content,</if>
            <if test="createUser != null">create_user,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="planCode != null">plan_code,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="itemsCode != null">#{itemsCode},</if>
            <if test="itemsName != null">#{itemsName},</if>
            <if test="itemsType != null">#{itemsType},</if>
            <if test="standard != null">#{standard},</if>
            <if test="itemsContent != null">#{itemsContent},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="planCode != null">#{planCode},</if>
         </trim>
    </insert>
    <update id="updateEmInspectionPlanItems" parameterType="EmInspectionPlanItems">
        update em_inspection_plan_items
        <trim prefix="SET" suffixOverrides=",">
            <if test="itemsCode != null">items_code = #{itemsCode},</if>
            <if test="itemsName != null">items_name = #{itemsName},</if>
            <if test="itemsType != null">items_type = #{itemsType},</if>
            <if test="standard != null">standard = #{standard},</if>
            <if test="itemsContent != null">items_content = #{itemsContent},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="planCode != null">plan_code = #{planCode},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteEmInspectionPlanItemsById" parameterType="Long">
        delete from em_inspection_plan_items where id = #{id}
    </delete>
    <delete id="deleteEmInspectionPlanItemsByIds" parameterType="String">
        delete from em_inspection_plan_items where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/src/api/main/em/inspectionPlanArchives/inspectionPlanArchives.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单列表
export function listInspectionPlanArchives(query) {
  return request({
    url: '/em/inspectionPlanArchives/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单详细
export function getInspectionPlanArchives(id) {
  return request({
    url: '/em/inspectionPlanArchives/' + id,
    method: 'get'
  })
}
// æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
export function addInspectionPlanArchives(data) {
  return request({
    url: '/em/inspectionPlanArchives',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
export function updateInspectionPlanArchives(data) {
  return request({
    url: '/em/inspectionPlanArchives',
    method: 'put',
    data: data
  })
}
// åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’设备清单
export function delInspectionPlanArchives(id) {
  return request({
    url: '/em/inspectionPlanArchives/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/api/main/em/inspectionPlanItems/inspectionPlanItems.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子列表
export function listInspectionPlanItems(query) {
  return request({
    url: '/em/inspectionPlanItems/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子详细
export function getInspectionPlanItems(id) {
  return request({
    url: '/em/inspectionPlanItems/' + id,
    method: 'get'
  })
}
// æ–°å¢žç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
export function addInspectionPlanItems(data) {
  return request({
    url: '/em/inspectionPlanItems',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
export function updateInspectionPlanItems(data) {
  return request({
    url: '/em/inspectionPlanItems',
    method: 'put',
    data: data
  })
}
// åˆ é™¤ç‚¹æ£€ä¿å…»è®¡åˆ’点检项目子
export function delInspectionPlanItems(id) {
  return request({
    url: '/em/inspectionPlanItems/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/components/inspectionPlanArchives/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,169 @@
<template>
  <el-dialog title="设备选择"
             v-if="showFlag"
             :visible.sync="showFlag"
             :modal= false
             width="80%"
             center
  >
    <el-row :gutter="20">
      <!--设备数据-->
      <el-col :span="20" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="设备编码" prop="machineryCode">
            <el-input
              v-model="queryParams.equipmentCode"
              placeholder="请输入设备编码"
              clearable
              style="width: 240px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="设备名称" prop="machineryName">
            <el-input
              v-model="queryParams.equipmentName"
              placeholder="请输入设备名称"
              clearable
              style="width: 240px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
        <el-table v-loading="loading" :data="machineryList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="50" align="center" />
          <el-table-column label="设备编码"  align="center"  prop="equipmentCode"/>
          <el-table-column label="设备名称"  align="center"  prop="equipmentName"  />
          <el-table-column label="品牌" align="center"  prop="equipmentBrand" />
          <el-table-column label="规格型号" align="center"  prop="equipmentSpec" />
          <el-table-column label="创建时间" align="center" prop="createTime" width="160">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
        </el-table>
        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-col>
    </el-row>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="confirmSelect">ç¡® å®š</el-button>
      <el-button @click="showFlag=false">取 æ¶ˆ</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { listEquipmentArchives, getEquipmentArchives, delEquipmentArchives, addEquipmentArchives, updateEquipmentArchives } from "@/api/main/em/equipmentArchives/equipmentArchives";
export default {
  name: "MachinerySelect",
  dicts: ['sys_yes_no','mes_machinery_status'],
  components: {  },
  data() {
    return {
      showFlag: false,
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
      selectedRows: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç‰©æ–™äº§å“è¡¨æ ¼æ•°æ®
      machineryList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // è®¾å¤‡ç±»åž‹æ ‘选项
      machineryTypeOptions: [],
      //车间选项
      workshopOptions:[],
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      //自动生成物料编码标识
      autoGenFlag: false,
      // è¡¨å•å‚æ•°
      form: {},
      defaultProps: {
        children: "children",
      },
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        equipmentCode: null,
        equipmentName: null,
        equipmentBrand: null,
        equipmentSpec: null,
        workshopId: null,
        workshopCode: null,
        workshopName: null,
        status: null
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢ç‰©æ–™ç¼–码列表 */
    getList() {
      this.loading = true;
      listEquipmentArchives(this.queryParams).then(response => {
          this.machineryList = response.rows;
          this.total = response.total;
          this.loading = false;
        },
      );
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.machineryId);
      this.selectedRows = selection;
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
    //确定选中
    confirmSelect(){
      if(this.ids ==[] || this.ids.length==0){
        this.$notify({
          title:'提示',
          type:'warning',
          message: '请至少选择一条数据!'
        });
        return;
      }
      this.$emit('onSelected',this.selectedRows);
      this.showFlag = false;
    }
  }
};
</script>
jcdm-ui/src/components/inspectionPlanItems/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,166 @@
<template>
  <el-dialog title="设备选择"
             v-if="showFlag"
             :visible.sync="showFlag"
             :modal= false
             width="80%"
             center
  >
    <el-row :gutter="20">
      <!--设备数据-->
      <el-col :span="20" :xs="24">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="设备编码" prop="machineryCode">
            <el-input
              v-model="queryParams.equipmentCode"
              placeholder="请输入设备编码"
              clearable
              style="width: 240px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="设备名称" prop="machineryName">
            <el-input
              v-model="queryParams.equipmentName"
              placeholder="请输入设备名称"
              clearable
              style="width: 240px"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
        <el-table v-loading="loading" :data="dvsubjectList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="项目名称" align="center" prop="itemsName">
          </el-table-column>
          <el-table-column label="项目编号" align="center" prop="itemsCode">
          </el-table-column>
          <el-table-column label="项目类型" align="center" prop="itemsType">
            <template slot-scope="scope">
              <dict-tag :options="dict.type.spotmaintenance" :value="scope.row.itemsType"/>
            </template>
          </el-table-column>
          <el-table-column label="项目内容" align="center" prop="itemsContent">
          </el-table-column>
          <el-table-column label="标准" align="center" prop="standard">
          </el-table-column>
          <el-table-column label="创建人" align="center" prop="createUser">
          </el-table-column>
          <el-table-column label="创建时间" align="center" prop="createTime">
          </el-table-column>
          <el-table-column label="更新人" align="center" prop="updateUser">
          </el-table-column>
          <el-table-column label="更新时间" align="center" prop="updateTime">
          </el-table-column>
        </el-table>
        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-col>
    </el-row>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="confirmSelect">ç¡® å®š</el-button>
      <el-button @click="showFlag=false">取 æ¶ˆ</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { listInspectionItems, getInspectionItems, delInspectionItems, addInspectionItems, updateInspectionItems } from "@/api/main/em/inspectionItems/inspectionItems";
export default {
  name: "DvsubjectSelect",
  dicts: ['sys_yes_no','mes_machinery_status','spotmaintenance'],
  components: {  },
  data() {
    return {
      showFlag:false,
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„s
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // è®¾å¤‡ç‚¹æ£€ä¿å…»é¡¹ç›®è¡¨æ ¼æ•°æ®
      dvsubjectList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        itemsCode: null,
        itemsName: null,
        itemsType: null,
        standard: null,
        itemsContent: null,
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢ç‚¹æ£€é¡¹ç›®åˆ—表 */
    getList() {
      this.loading = true;
      listInspectionItems(this.queryParams).then(response => {
          this.dvsubjectList = response.rows;
          this.total = response.total;
          this.loading = false;
        },
      );
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.machineryId);
      this.selectedRows = selection;
      this.single = selection.length != 1;
      this.multiple = !selection.length;
    },
    //确定选中
    confirmSelect(){
      if(this.ids ==[] || this.ids.length==0){
        this.$notify({
          title:'提示',
          type:'warning',
          message: '请至少选择一条数据!'
        });
        return;
      }
      this.$emit('onSelected',this.selectedRows);
      this.showFlag = false;
    }
  }
};
</script>
jcdm-ui/src/views/main/em/inspectionPlan/index.vue
@@ -204,25 +204,36 @@
          <el-input style="width: 1000px" v-model="form.remarks" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
      <el-tabs type="border-card" >
        <el-tab-pane label="设备清单" >
          <Checkmachinery ref="machinerylist"></Checkmachinery>
        </el-tab-pane>
        <el-tab-pane label="点检项目">
          <Checksubject ref="subjectlist"></Checksubject>
            </el-tab-pane>
          </el-tabs>
      <el-divider></el-divider>
        <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
        <el-button @click="cancel">取 æ¶ˆ</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listInspectionPlan, getInspectionPlan, delInspectionPlan, addInspectionPlan, updateInspectionPlan } from "@/api/main/em/inspectionPlan/inspectionPlan";
import Checkmachinery from "./machinery.vue"
import Checksubject from "./subject.vue"
export default {
  name: "InspectionPlan",
  dicts: ['plan_status','plan_type','dimension'],
  dicts: ['plan_status','plan_type'],
  components:{Checkmachinery,Checksubject},
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      optType: null,
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
jcdm-ui/src/views/main/em/inspectionPlan/machinery.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,139 @@
<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['mes:dv:checkplan:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['mes:dv:checkplan:remove']"
        >删除</el-button>
      </el-col>
    </el-row>
    <MachinerySelect ref="machinerySelect" @onSelected="onMachineryAdd"></MachinerySelect>
    <el-table v-loading="loading" :data="checkmachineryList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="设备编码" align="center" prop="equipmentCode" />
      <el-table-column label="设备名称" align="center" prop="equipmentName" />
      <el-table-column label="品牌" align="center" prop="equipmentBrand" />
      <el-table-column label="规格型号" align="center" prop="equipmentSpec" />
      <el-table-column label="备注" align="center" prop="remark" />
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import { listInspectionPlanArchives, delInspectionPlanArchives, addInspectionPlanArchives} from "@/api/main/em/inspectionPlanArchives/inspectionPlanArchives";
import MachinerySelect from "@/components/inspectionPlanArchives/index.vue";
export default {
  name: "Checkmachinery",
  components:{MachinerySelect},
  props:{
    planId: null,
    optType: null
  },
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç‚¹æ£€è®¾å¤‡è¡¨æ ¼æ•°æ®
      checkmachineryList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        planId: this.planId,
        equipmentId: null,
        equipmentCode: null,
        equipmentName: null,
        equipmentBrand: null,
        equipmentSpec: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢ç‚¹æ£€è®¾å¤‡åˆ—表 */
    getList() {
      this.loading = true;
      listInspectionPlanArchives(this.queryParams).then(response => {
        this.checkmachineryList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.recordId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.$refs.machinerySelect.showFlag = true;
    },
      //设备资源选择回调
    onMachineryAdd(rows){
      if(rows !=null && rows.length >0){
         rows.forEach(row => {
            row.planId = this.planId;
           addInspectionPlanArchives(row).then(response =>{
              this.getList();
            });
         });
      }
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const recordIds = row.recordId || this.ids;
      this.$modal.confirm('是否确认删除点检设备编号为"' + recordIds + '"的数据项?').then(function() {
        return delInspectionPlanArchives(recordIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    }
  }
};
</script>
jcdm-ui/src/views/main/em/inspectionPlan/subject.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,144 @@
<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['mes:dv:checkplan:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['mes:dv:checkplan:remove']"
        >删除</el-button>
      </el-col>
    </el-row>
    <DvsubjectSelect ref="subjectSelect"  @onSelected="onSubjectSelected"></DvsubjectSelect>
    <el-table v-loading="loading" :data="checksubjectList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="项目编码" align="center" prop="itemsCode" />
      <el-table-column label="项目名称" align="center" prop="itemsName" />
      <el-table-column label="项目类型" align="center" prop="itemsType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.spotmaintenance" :value="scope.row.itemsType"/>
        </template>
      </el-table-column>
      <el-table-column label="项目内容" align="center" width="300px" prop="itemsContent" />
      <el-table-column label="标准" align="center" width="300px" prop="standard" />
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import {listInspectionPlanItems,delInspectionPlanItems,addInspectionPlanItems} from "@/api/main/em/inspectionPlanItems/inspectionPlanItems";
import DvsubjectSelect from "@/components/inspectionPlanItems/index.vue"
export default {
  name: "Checksubject",
  props:{
      planId: null,
      optType: null
  },
  dicts: ['spotmaintenance'],
  components:{DvsubjectSelect},
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
        selectedRows: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // ç‚¹æ£€é¡¹ç›®è¡¨æ ¼æ•°æ®
      checksubjectList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        planId: this.planId,
        itemsCode: null,
        itemsName: null,
        itemsType: null,
        standard: null,
        itemsContent: null,
      },
      // è¡¨å•å‚æ•°
      form: {}
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢ç‚¹æ£€é¡¹ç›®åˆ—表 */
    getList() {
      this.loading = true;
      listInspectionPlanItems(this.queryParams).then(response => {
        this.checksubjectList = response.rows;
        this.total = response.total;
        this.loading = false;
        console.log(response.rows)
      });
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.recordId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
        this.$refs.subjectSelect.showFlag = true;
    },
    onSubjectSelected(rows){
        if(rows != null && rows.length >0){
            rows.forEach(row => {
                row.planId= this.planId;
              addInspectionPlanItems(row).then(response => {
                    this.getList();
                });
            });
        }
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const recordIds = row.recordId || this.ids;
      this.$modal.confirm('是否确认删除点检项目编号为"' + recordIds + '"的数据项?').then(function() {
        return delInspectionPlanItems(recordIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
  }
};
</script>