yantian yue
2023-12-13 94f7fb98fca573c26da2291f2bc7b880f2a3f7e8
更新产品过站采集
已修改6个文件
已添加8个文件
1318 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/bs/material/controller/BsMaterialInfoController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/productBom/controller/BsProductBomInfoController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/productBomChild/controller/BsProductBomChildInfoController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java 318 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/mapper/DaParamCollectionMapper.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/controller/DaPassingStationCollectionController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/da/paramCollection/paramCollection.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/utils/ruoyi.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/bs/ProductBom/index.vue 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/paramCollection/index.vue 436 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/bs/material/controller/BsMaterialInfoController.java
@@ -3,6 +3,7 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.bs.material.domain.BsMaterialInfo;
import com.jcdm.main.bs.material.service.IBsMaterialInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -21,6 +22,7 @@
import com.jcdm.common.enums.BusinessType;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
import com.jcdm.common.utils.DateUtils;
/**
 * ç‰©æ–™ä¿¡æ¯Controller
@@ -78,6 +80,8 @@
    @PostMapping
    public AjaxResult add(@RequestBody BsMaterialInfo bsMaterialInfo)
    {
        bsMaterialInfo.setCreateBy(getUsername());
        bsMaterialInfo.setCreateTime(DateUtils.getNowDate());
        return toAjax(bsMaterialInfoService.insertBsMaterialInfo(bsMaterialInfo));
    }
@@ -89,6 +93,8 @@
    @PutMapping
    public AjaxResult edit(@RequestBody BsMaterialInfo bsMaterialInfo)
    {
        bsMaterialInfo.setUpdateBy(getUsername());
        bsMaterialInfo.setUpdateTime(DateUtils.getNowDate());
        return toAjax(bsMaterialInfoService.updateBsMaterialInfo(bsMaterialInfo));
    }
jcdm-main/src/main/java/com/jcdm/main/bs/productBom/controller/BsProductBomInfoController.java
@@ -3,6 +3,7 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.bs.productBom.domain.BsProductBomInfo;
import com.jcdm.main.bs.productBom.service.IBsProductBomInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -78,6 +79,8 @@
    @PostMapping
    public AjaxResult add(@RequestBody BsProductBomInfo bsProductBomInfo)
    {
        bsProductBomInfo.setCreateBy(getUsername());
        bsProductBomInfo.setCreateTime(DateUtils.getNowDate());
        return toAjax(bsProductBomInfoService.insertBsProductBomInfo(bsProductBomInfo));
    }
@@ -89,6 +92,8 @@
    @PutMapping
    public AjaxResult edit(@RequestBody BsProductBomInfo bsProductBomInfo)
    {
        bsProductBomInfo.setUpdateBy(getUsername());
        bsProductBomInfo.setUpdateTime(DateUtils.getNowDate());
        return toAjax(bsProductBomInfoService.updateBsProductBomInfo(bsProductBomInfo));
    }
jcdm-main/src/main/java/com/jcdm/main/bs/productBomChild/controller/BsProductBomChildInfoController.java
@@ -3,6 +3,7 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.bs.productBomChild.domain.BsProductBomChildInfo;
import com.jcdm.main.bs.productBomChild.service.IBsProductBomChildInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -78,6 +79,8 @@
    @PostMapping
    public AjaxResult add(@RequestBody BsProductBomChildInfo bsProductBomChildInfo)
    {
        bsProductBomChildInfo.setCreateBy(getUsername());
        bsProductBomChildInfo.setCreateTime(DateUtils.getNowDate());
        return toAjax(bsProductBomChildInfoService.insertBsProductBomChildInfo(bsProductBomChildInfo));
    }
@@ -89,6 +92,8 @@
    @PutMapping
    public AjaxResult edit(@RequestBody BsProductBomChildInfo bsProductBomChildInfo)
    {
        bsProductBomChildInfo.setUpdateBy(getUsername());
        bsProductBomChildInfo.setUpdateTime(DateUtils.getNowDate());
        return toAjax(bsProductBomChildInfoService.updateBsProductBomChildInfo(bsProductBomChildInfo));
    }
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,110 @@
package com.jcdm.main.da.paramCollection.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
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.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集Controller
 *
 * @author yyt
 * @date 2023-12-13
 */
@RestController
@RequestMapping("/main/paramCollection")
public class DaParamCollectionController extends BaseController
{
    @Autowired
    private IDaParamCollectionService daParamCollectionService;
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
     */
    @PreAuthorize("@ss.hasPermi('main:paramCollection:list')")
    @GetMapping("/list")
    public TableDataInfo list(DaParamCollection daParamCollection)
    {
        startPage();
        List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºè®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
     */
    @PreAuthorize("@ss.hasPermi('main:paramCollection:export')")
    @Log(title = "设备产品过程参数采集", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DaParamCollection daParamCollection)
    {
        List<DaParamCollection> list = daParamCollectionService.selectDaParamCollectionList(daParamCollection);
        ExcelUtil<DaParamCollection> util = new ExcelUtil<DaParamCollection>(DaParamCollection.class);
        util.exportExcel(response, list, "设备产品过程参数采集数据");
    }
    /**
     * èŽ·å–设备产品过程参数采集详细信息
     */
    @PreAuthorize("@ss.hasPermi('main:paramCollection:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(daParamCollectionService.selectDaParamCollectionById(id));
    }
    /**
     * æ–°å¢žè®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     */
    @PreAuthorize("@ss.hasPermi('main:paramCollection:add')")
    @Log(title = "设备产品过程参数采集", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DaParamCollection daParamCollection)
    {
        daParamCollection.setCreateBy(getUsername());
        daParamCollection.setCreateTime(DateUtils.getNowDate());
        return toAjax(daParamCollectionService.insertDaParamCollection(daParamCollection));
    }
    /**
     * ä¿®æ”¹è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     */
    @PreAuthorize("@ss.hasPermi('main:paramCollection:edit')")
    @Log(title = "设备产品过程参数采集", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DaParamCollection daParamCollection)
    {
        daParamCollection.setUpdateBy(getUsername());
        daParamCollection.setUpdateTime(DateUtils.getNowDate());
        return toAjax(daParamCollectionService.updateDaParamCollection(daParamCollection));
    }
    /**
     * åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     */
    @PreAuthorize("@ss.hasPermi('main:paramCollection:remove')")
    @Log(title = "设备产品过程参数采集", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(daParamCollectionService.deleteDaParamCollectionByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/domain/DaParamCollection.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,318 @@
package com.jcdm.main.da.paramCollection.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集对象 da_param_collection
 *
 * @author yyt
 * @date 2023-12-13
 */
public class DaParamCollection extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** ä¸»é”®id */
    private Long id;
    /** å·¥å•ç¼–号 */
    @Excel(name = "工单编号")
    private String workOrderNo;
    /** æ€»æˆåºåˆ—号 */
    @Excel(name = "总成序列号")
    private String sfcCode;
    /** äº§å“ç¼–号 */
    @Excel(name = "产品编号")
    private String productCode;
    /** äº§çº¿ç¼–号 */
    @Excel(name = "产线编号")
    private String productionLine;
    /** å·¥ä½ç¼–号 */
    @Excel(name = "工位编号")
    private String locationCode;
    /** è®¾å¤‡ç¼–号 */
    @Excel(name = "设备编号")
    private String equipmentNo;
    /** å‚数编码 */
    @Excel(name = "参数编码")
    private String paramCode;
    /** å‚数值 */
    @Excel(name = "参数值")
    private String paramValue;
    /** å‚数上限 */
    @Excel(name = "参数上限")
    private String paramUpper;
    /** å‚数下限 */
    @Excel(name = "参数下限")
    private String paramLower;
    /** æ ‡å‡†å€¼ */
    @Excel(name = "标准值")
    private String paramStandard;
    /** é‡‡é›†æ—¶é—´ */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date collectionTime;
    /** é¢„留字段1 */
    private String spareField1;
    /** é¢„留字段2 */
    private String spareField2;
    /** åˆ›å»ºç”¨æˆ· */
    private String createUser;
    /** æ›´æ”¹ç”¨æˆ· */
    private String updateUser;
    /** çŠ¶æ€ï¼ˆ1合格、2不合格) */
    @Excel(name = "状态", readConverterExp = "1=合格、2不合格")
    private String state;
    /** å‚数名称 */
    @Excel(name = "参数名称")
    private String paramName;
    /** å•ä½ */
    @Excel(name = "单位")
    private String unit;
    /** ç±»åž‹ */
    @Excel(name = "类型")
    private String type;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setWorkOrderNo(String workOrderNo)
    {
        this.workOrderNo = workOrderNo;
    }
    public String getWorkOrderNo()
    {
        return workOrderNo;
    }
    public void setSfcCode(String sfcCode)
    {
        this.sfcCode = sfcCode;
    }
    public String getSfcCode()
    {
        return sfcCode;
    }
    public void setProductCode(String productCode)
    {
        this.productCode = productCode;
    }
    public String getProductCode()
    {
        return productCode;
    }
    public void setProductionLine(String productionLine)
    {
        this.productionLine = productionLine;
    }
    public String getProductionLine()
    {
        return productionLine;
    }
    public void setLocationCode(String locationCode)
    {
        this.locationCode = locationCode;
    }
    public String getLocationCode()
    {
        return locationCode;
    }
    public void setEquipmentNo(String equipmentNo)
    {
        this.equipmentNo = equipmentNo;
    }
    public String getEquipmentNo()
    {
        return equipmentNo;
    }
    public void setParamCode(String paramCode)
    {
        this.paramCode = paramCode;
    }
    public String getParamCode()
    {
        return paramCode;
    }
    public void setParamValue(String paramValue)
    {
        this.paramValue = paramValue;
    }
    public String getParamValue()
    {
        return paramValue;
    }
    public void setParamUpper(String paramUpper)
    {
        this.paramUpper = paramUpper;
    }
    public String getParamUpper()
    {
        return paramUpper;
    }
    public void setParamLower(String paramLower)
    {
        this.paramLower = paramLower;
    }
    public String getParamLower()
    {
        return paramLower;
    }
    public void setParamStandard(String paramStandard)
    {
        this.paramStandard = paramStandard;
    }
    public String getParamStandard()
    {
        return paramStandard;
    }
    public void setCollectionTime(Date collectionTime)
    {
        this.collectionTime = collectionTime;
    }
    public Date getCollectionTime()
    {
        return collectionTime;
    }
    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 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 setState(String state)
    {
        this.state = state;
    }
    public String getState()
    {
        return state;
    }
    public void setParamName(String paramName)
    {
        this.paramName = paramName;
    }
    public String getParamName()
    {
        return paramName;
    }
    public void setUnit(String unit)
    {
        this.unit = unit;
    }
    public String getUnit()
    {
        return unit;
    }
    public void setType(String type)
    {
        this.type = type;
    }
    public String getType()
    {
        return type;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("workOrderNo", getWorkOrderNo())
            .append("sfcCode", getSfcCode())
            .append("productCode", getProductCode())
            .append("productionLine", getProductionLine())
            .append("locationCode", getLocationCode())
            .append("equipmentNo", getEquipmentNo())
            .append("paramCode", getParamCode())
            .append("paramValue", getParamValue())
            .append("paramUpper", getParamUpper())
            .append("paramLower", getParamLower())
            .append("paramStandard", getParamStandard())
            .append("collectionTime", getCollectionTime())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("state", getState())
            .append("paramName", getParamName())
            .append("unit", getUnit())
            .append("type", getType())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/mapper/DaParamCollectionMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.da.paramCollection.mapper;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import java.util.List;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集Mapper接口
 *
 * @author yyt
 * @date 2023-12-13
 */
public interface DaParamCollectionMapper
{
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param id è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集主键
     * @return è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     */
    public DaParamCollection selectDaParamCollectionById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集集合
     */
    public List<DaParamCollection> selectDaParamCollectionList(DaParamCollection daParamCollection);
    /**
     * æ–°å¢žè®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return ç»“æžœ
     */
    public int insertDaParamCollection(DaParamCollection daParamCollection);
    /**
     * ä¿®æ”¹è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return ç»“æžœ
     */
    public int updateDaParamCollection(DaParamCollection daParamCollection);
    /**
     * åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param id è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集主键
     * @return ç»“æžœ
     */
    public int deleteDaParamCollectionById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteDaParamCollectionByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.jcdm.main.da.paramCollection.service;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import java.util.List;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集Service接口
 *
 * @author yyt
 * @date 2023-12-13
 */
public interface IDaParamCollectionService
{
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param id è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集主键
     * @return è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     */
    public DaParamCollection selectDaParamCollectionById(Long id);
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集集合
     */
    public List<DaParamCollection> selectDaParamCollectionList(DaParamCollection daParamCollection);
    /**
     * æ–°å¢žè®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return ç»“æžœ
     */
    public int insertDaParamCollection(DaParamCollection daParamCollection);
    /**
     * ä¿®æ”¹è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return ç»“æžœ
     */
    public int updateDaParamCollection(DaParamCollection daParamCollection);
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备产品过程参数采集主键集合
     * @return ç»“æžœ
     */
    public int deleteDaParamCollectionByIds(Long[] ids);
    /**
     * åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集信息
     *
     * @param id è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集主键
     * @return ç»“æžœ
     */
    public int deleteDaParamCollectionById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
package com.jcdm.main.da.paramCollection.service.impl;
import java.util.List;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集Service业务层处理
 *
 * @author yyt
 * @date 2023-12-13
 */
@Service
public class DaParamCollectionServiceImpl implements IDaParamCollectionService
{
    @Autowired
    private DaParamCollectionMapper daParamCollectionMapper;
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param id è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集主键
     * @return è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     */
    @Override
    public DaParamCollection selectDaParamCollectionById(Long id)
    {
        return daParamCollectionMapper.selectDaParamCollectionById(id);
    }
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     */
    @Override
    public List<DaParamCollection> selectDaParamCollectionList(DaParamCollection daParamCollection)
    {
        return daParamCollectionMapper.selectDaParamCollectionList(daParamCollection);
    }
    /**
     * æ–°å¢žè®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return ç»“æžœ
     */
    @Override
    public int insertDaParamCollection(DaParamCollection daParamCollection)
    {
        daParamCollection.setCreateTime(DateUtils.getNowDate());
        return daParamCollectionMapper.insertDaParamCollection(daParamCollection);
    }
    /**
     * ä¿®æ”¹è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param daParamCollection è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     * @return ç»“æžœ
     */
    @Override
    public int updateDaParamCollection(DaParamCollection daParamCollection)
    {
        daParamCollection.setUpdateTime(DateUtils.getNowDate());
        return daParamCollectionMapper.updateDaParamCollection(daParamCollection);
    }
    /**
     * æ‰¹é‡åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
     *
     * @param ids éœ€è¦åˆ é™¤çš„设备产品过程参数采集主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaParamCollectionByIds(Long[] ids)
    {
        return daParamCollectionMapper.deleteDaParamCollectionByIds(ids);
    }
    /**
     * åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集信息
     *
     * @param id è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaParamCollectionById(Long id)
    {
        return daParamCollectionMapper.deleteDaParamCollectionById(id);
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/passingStationCollection/controller/DaPassingStationCollectionController.java
@@ -3,6 +3,7 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -78,6 +79,8 @@
    @PostMapping
    public AjaxResult add(@RequestBody DaPassingStationCollection daPassingStationCollection)
    {
        daPassingStationCollection.setCreateBy(getUsername());
        daPassingStationCollection.setCreateTime(DateUtils.getNowDate());
        return toAjax(daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection));
    }
@@ -89,6 +92,8 @@
    @PutMapping
    public AjaxResult edit(@RequestBody DaPassingStationCollection daPassingStationCollection)
    {
        daPassingStationCollection.setUpdateBy(getUsername());
        daPassingStationCollection.setUpdateTime(DateUtils.getNowDate());
        return toAjax(daPassingStationCollectionService.updateDaPassingStationCollection(daPassingStationCollection));
    }
jcdm-main/src/main/resources/mapper/da/paramCollection/DaParamCollectionMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,148 @@
<?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.da.paramCollection.mapper.DaParamCollectionMapper">
    <resultMap type="DaParamCollection" id="DaParamCollectionResult">
        <result property="id"    column="id"    />
        <result property="workOrderNo"    column="work_order_no"    />
        <result property="sfcCode"    column="sfc_code"    />
        <result property="productCode"    column="product_code"    />
        <result property="productionLine"    column="production_line"    />
        <result property="locationCode"    column="location_code"    />
        <result property="equipmentNo"    column="equipment_no"    />
        <result property="paramCode"    column="param_code"    />
        <result property="paramValue"    column="param_value"    />
        <result property="paramUpper"    column="param_upper"    />
        <result property="paramLower"    column="param_lower"    />
        <result property="paramStandard"    column="param_standard"    />
        <result property="collectionTime"    column="collection_time"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <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="state"    column="state"    />
        <result property="paramName"    column="param_name"    />
        <result property="unit"    column="unit"    />
        <result property="type"    column="type"    />
    </resultMap>
    <sql id="selectDaParamCollectionVo">
        select id, work_order_no, sfc_code, product_code, production_line, location_code, equipment_no, param_code, param_value, param_upper, param_lower, param_standard, collection_time, spare_field_1, spare_field_2, create_user, create_time, update_user, update_time, state, param_name, unit, type from da_param_collection
    </sql>
    <select id="selectDaParamCollectionList" parameterType="DaParamCollection" resultMap="DaParamCollectionResult">
        <include refid="selectDaParamCollectionVo"/>
        <where>
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
            <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
            <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
            <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
            <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
            <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
            <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
        </where>
    </select>
    <select id="selectDaParamCollectionById" parameterType="Long" resultMap="DaParamCollectionResult">
        <include refid="selectDaParamCollectionVo"/>
        where id = #{id}
    </select>
    <insert id="insertDaParamCollection" parameterType="DaParamCollection">
        insert into da_param_collection
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="workOrderNo != null and workOrderNo != ''">work_order_no,</if>
            <if test="sfcCode != null and sfcCode != ''">sfc_code,</if>
            <if test="productCode != null and productCode != ''">product_code,</if>
            <if test="productionLine != null and productionLine != ''">production_line,</if>
            <if test="locationCode != null and locationCode != ''">location_code,</if>
            <if test="equipmentNo != null">equipment_no,</if>
            <if test="paramCode != null and paramCode != ''">param_code,</if>
            <if test="paramValue != null and paramValue != ''">param_value,</if>
            <if test="paramUpper != null">param_upper,</if>
            <if test="paramLower != null">param_lower,</if>
            <if test="paramStandard != null">param_standard,</if>
            <if test="collectionTime != null">collection_time,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</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="state != null">state,</if>
            <if test="paramName != null">param_name,</if>
            <if test="unit != null">unit,</if>
            <if test="type != null">type,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="workOrderNo != null and workOrderNo != ''">#{workOrderNo},</if>
            <if test="sfcCode != null and sfcCode != ''">#{sfcCode},</if>
            <if test="productCode != null and productCode != ''">#{productCode},</if>
            <if test="productionLine != null and productionLine != ''">#{productionLine},</if>
            <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
            <if test="equipmentNo != null">#{equipmentNo},</if>
            <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">#{paramValue},</if>
            <if test="paramUpper != null">#{paramUpper},</if>
            <if test="paramLower != null">#{paramLower},</if>
            <if test="paramStandard != null">#{paramStandard},</if>
            <if test="collectionTime != null">#{collectionTime},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</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="state != null">#{state},</if>
            <if test="paramName != null">#{paramName},</if>
            <if test="unit != null">#{unit},</if>
            <if test="type != null">#{type},</if>
         </trim>
    </insert>
    <update id="updateDaParamCollection" parameterType="DaParamCollection">
        update da_param_collection
        <trim prefix="SET" suffixOverrides=",">
            <if test="workOrderNo != null and workOrderNo != ''">work_order_no = #{workOrderNo},</if>
            <if test="sfcCode != null and sfcCode != ''">sfc_code = #{sfcCode},</if>
            <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
            <if test="productionLine != null and productionLine != ''">production_line = #{productionLine},</if>
            <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
            <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
            <if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
            <if test="paramUpper != null">param_upper = #{paramUpper},</if>
            <if test="paramLower != null">param_lower = #{paramLower},</if>
            <if test="paramStandard != null">param_standard = #{paramStandard},</if>
            <if test="collectionTime != null">collection_time = #{collectionTime},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</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="state != null">state = #{state},</if>
            <if test="paramName != null">param_name = #{paramName},</if>
            <if test="unit != null">unit = #{unit},</if>
            <if test="type != null">type = #{type},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteDaParamCollectionById" parameterType="Long">
        delete from da_param_collection where id = #{id}
    </delete>
    <delete id="deleteDaParamCollectionByIds" parameterType="String">
        delete from da_param_collection where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/src/api/main/da/paramCollection/paramCollection.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
export function listParamCollection(query) {
  return request({
    url: '/main/paramCollection/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集详细
export function getParamCollection(id) {
  return request({
    url: '/main/paramCollection/' + id,
    method: 'get'
  })
}
// æ–°å¢žè®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
export function addParamCollection(data) {
  return request({
    url: '/main/paramCollection',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
export function updateParamCollection(data) {
  return request({
    url: '/main/paramCollection',
    method: 'put',
    data: data
  })
}
// åˆ é™¤è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
export function delParamCollection(id) {
  return request({
    url: '/main/paramCollection/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/utils/ruoyi.js
@@ -2,7 +2,6 @@
/**
 * é€šç”¨js方法封装处理
 * Copyright (c) 2019 ruoyi
 */
// æ—¥æœŸæ ¼å¼åŒ–
jcdm-ui/src/views/main/bs/ProductBom/index.vue
@@ -188,7 +188,7 @@
    <!-- æ·»åŠ æˆ–修改基础BOM对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="BOM编码" prop="bomCode">
          <el-input v-model="form.bomCode" placeholder="请输入BOM编码" />
        </el-form-item>
@@ -219,18 +219,18 @@
        <el-form-item label="预留字段2" prop="spareField2">
          <el-input v-model="form.spareField2" placeholder="请输入预留字段2" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="创建用户" prop="createUser">
          <el-input v-model="form.createUser" placeholder="请输入创建用户" />
        </el-form-item>
        <el-form-item label="更改用户" prop="updateUser">
          <el-input v-model="form.updateUser" placeholder="请输入更改用户" />
        </el-form-item>
<!--        <el-form-item label="创建用户" prop="createUser">-->
<!--          <el-input v-model="form.createUser" placeholder="请输入创建用户" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="更改用户" prop="updateUser">-->
<!--          <el-input v-model="form.updateUser" placeholder="请输入更改用户" />-->
<!--        </el-form-item>-->
        <el-form-item label="数据来源" prop="dataSource">
          <el-input v-model="form.dataSource" placeholder="请输入数据来源" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" placeholder="请输入备注" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
jcdm-ui/src/views/main/da/paramCollection/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,436 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <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-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="['main:paramCollection:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['main:paramCollection:edit']"
        >修改</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="['main:paramCollection:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['main:paramCollection:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="paramCollectionList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="主键id" align="center" prop="id" />
      <el-table-column label="工单编号" align="center" prop="workOrderNo">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.workOrderNo"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="总成序列号" align="center" prop="sfcCode">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.sfcCode"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="产品编号" align="center" prop="productCode">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.productCode"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="产线编号" align="center" prop="productionLine">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.productionLine"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="工位编号" align="center" prop="locationCode">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.locationCode"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="设备编号" align="center" prop="equipmentNo">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.equipmentNo"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="参数编码" align="center" prop="paramCode">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramCode"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="参数值" align="center" prop="paramValue">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramValue"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="参数上限" align="center" prop="paramUpper">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramUpper"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="参数下限" align="center" prop="paramLower">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramLower"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="标准值" align="center" prop="paramStandard">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramStandard"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="state">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.state"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="参数名称" align="center" prop="paramName">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramName"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="单位" align="center" prop="unit">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.unit"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="类型" align="center" prop="type">
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.type"/>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['main:paramCollection:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['main:paramCollection:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- æ·»åŠ æˆ–修改设备产品过程参数采集对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="工单编号" prop="workOrderNo">
          <el-input v-model="form.workOrderNo" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="总成序列号" prop="sfcCode">
          <el-input v-model="form.sfcCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产品编号" prop="productCode">
          <el-input v-model="form.productCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="产线编号" prop="productionLine">
          <el-input v-model="form.productionLine" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="工位编号" prop="locationCode">
          <el-input v-model="form.locationCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="设备编号" prop="equipmentNo">
          <el-input v-model="form.equipmentNo" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数编码" prop="paramCode">
          <el-input v-model="form.paramCode" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数值" prop="paramValue">
          <el-input v-model="form.paramValue" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数上限" prop="paramUpper">
          <el-input v-model="form.paramUpper" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="参数下限" prop="paramLower">
          <el-input v-model="form.paramLower" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="标准值" prop="paramStandard">
          <el-input v-model="form.paramStandard" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="采集时间" prop="collectionTime">
          <el-date-picker clearable
            v-model="form.collectionTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择采集时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="预留字段1" prop="spareField1">
          <el-input v-model="form.spareField1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="预留字段2" prop="spareField2">
          <el-input v-model="form.spareField2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="创建用户" prop="createUser">
          <el-input v-model="form.createUser" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="更改用户" prop="updateUser">
          <el-input v-model="form.updateUser" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="状态" prop="state">
          <el-input v-model="form.state" placeholder="请输入状态" />
        </el-form-item>
        <el-form-item label="参数名称" prop="paramName">
          <el-input v-model="form.paramName" placeholder="请输入参数名称" />
        </el-form-item>
        <el-form-item label="单位" prop="unit">
          <el-input v-model="form.unit" placeholder="请输入单位" />
        </el-form-item>
        <el-form-item label="类型" prop="type">
          <el-select v-model="form.type" placeholder="请选择类型">
<!--            <el-option-->
<!--              v-for="dict in dict.type.${dictType}"-->
<!--              :key="dict.value"-->
<!--              :label="dict.label"-->
<!--              :value="dict.value"-->
<!--            ></el-option>-->
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">ç¡® å®š</el-button>
        <el-button @click="cancel">取 æ¶ˆ</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection";
export default {
  name: "ParamCollection",
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集表格数据
      paramCollectionList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        workOrderNo: null,
        sfcCode: null,
        productCode: null,
        productionLine: null,
        locationCode: null,
        equipmentNo: null,
        paramCode: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "主键id不能为空", trigger: "blur" }
        ],
        workOrderNo: [
          { required: true, message: "工单编号不能为空", trigger: "blur" }
        ],
        sfcCode: [
          { required: true, message: "总成序列号不能为空", trigger: "blur" }
        ],
        productCode: [
          { required: true, message: "产品编号不能为空", trigger: "blur" }
        ],
        productionLine: [
          { required: true, message: "产线编号不能为空", trigger: "blur" }
        ],
        locationCode: [
          { required: true, message: "工位编号不能为空", trigger: "blur" }
        ],
        paramCode: [
          { required: true, message: "参数编码不能为空", trigger: "blur" }
        ],
        paramValue: [
          { required: true, message: "参数值不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表 */
    getList() {
      this.loading = true;
      listParamCollection(this.queryParams).then(response => {
        this.paramCollectionList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        workOrderNo: null,
        sfcCode: null,
        productCode: null,
        productionLine: null,
        locationCode: null,
        equipmentNo: null,
        paramCode: null,
        paramValue: null,
        paramUpper: null,
        paramLower: null,
        paramStandard: null,
        collectionTime: null,
        spareField1: null,
        spareField2: null,
        createUser: null,
        createTime: null,
        updateUser: null,
        updateTime: null,
        state: null,
        paramName: null,
        unit: null,
        type: null
      };
      this.resetForm("form");
    },
    /** æœç´¢æŒ‰é’®æ“ä½œ */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** é‡ç½®æŒ‰é’®æ“ä½œ */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // å¤šé€‰æ¡†é€‰ä¸­æ•°æ®
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** æ–°å¢žæŒ‰é’®æ“ä½œ */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加设备产品过程参数采集";
    },
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getParamCollection(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改设备产品过程参数采集";
      });
    },
    /** æäº¤æŒ‰é’® */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateParamCollection(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addParamCollection(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** åˆ é™¤æŒ‰é’®æ“ä½œ */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除设备产品过程参数采集编号为"' + ids + '"的数据项?').then(function() {
        return delParamCollection(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('main/paramCollection/export', {
        ...this.queryParams
      }, `paramCollection_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>