admin
2024-05-14 5966d6d329279119f3af29508b97c1d2c0bbe2bd
-测试设备接口保存
已修改5个文件
已添加8个文件
1285 ■■■■■ 文件已修改
jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/controller/DaTestDeviceInterfaceController.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/domain/DaTestDeviceInterface.java 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/mapper/DaTestDeviceInterfaceMapper.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/service/IDaTestDeviceInterfaceService.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/service/impl/DaTestDeviceInterfaceServiceImpl.java 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/resources/mapper/da/testDeviceInterface/DaTestDeviceInterfaceMapper.xml 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/api/main/da/testDeviceInterface/testDeviceInterface.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-ui/src/views/main/da/testDeviceInterface/index.vue 399 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java
@@ -117,6 +117,8 @@
                .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
                .antMatchers("/sendDemo/push").permitAll()
                .antMatchers("/jcdmMes/deviceResultFeedback").permitAll()
                .antMatchers("/da/testDeviceInterface/**").permitAll()
                .antMatchers("/main/paramCollection/**").permitAll()
                // é™¤ä¸Šé¢å¤–的所有请求全部需要鉴权认证
                .anyRequest().authenticated()
                .and()
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/controller/DaParamCollectionController.java
@@ -42,6 +42,15 @@
    }
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
     */
    @GetMapping("/testput")
    public void testput()
    {
        daParamCollectionService.pushGeelycvMesFeedback("80012","OP240");
    }
    /**
     * å¯¼å‡ºè®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集列表
     */
    @PreAuthorize("@ss.hasPermi('main:paramCollection:export')")
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/IDaParamCollectionService.java
@@ -77,4 +77,6 @@
    void jrmSaveCampaignTimeParameters(DaParamCollection daParamCollection);
    void sendToFactoryMes(String stationCode,String productNum );
    void pushGeelycvMesFeedback(String packID,String stationCode);
}
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -18,6 +18,7 @@
import com.jcdm.main.constant.Constants;
import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf;
import com.jcdm.main.da.collectionParamConf.mapper.DaCollectionParamConfMapper;
import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper;
import com.jcdm.main.da.paramCollection.service.IDaParamCollectionService;
@@ -33,9 +34,12 @@
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.*;
import java.util.stream.Collectors;
@@ -71,6 +75,9 @@
    @Autowired
    private IDaParamCollectionService daParamCollectionService;
    @Autowired
    private IDaCollectionParamConfService daCollectionParamConfService;
    /**
     * æŸ¥è¯¢è®¾å¤‡äº§å“è¿‡ç¨‹å‚数采集
@@ -411,4 +418,61 @@
        HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(vo)).execute();
    }
    @Override
    public void pushGeelycvMesFeedback(String packID, String stationCode) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
        String totalResult = "0";
        List<DaParamCollection> paramList = daParamCollectionService.list(new LambdaQueryWrapper<DaParamCollection>().eq(DaParamCollection::getSfcCode, packID).eq(DaParamCollection::getLocationCode, stationCode));
        if(paramList.size() > 0){
            ParentVO parentVO = new ParentVO();
            parentVO.setSiteCode("3983");
            parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli()));
            parentVO.setStationCode(stationCode);
            parentVO.setProductNum(packID);
            parentVO.setTotalResult("1");
            List<ChildVO> listChildVo = new ArrayList<>();
            for (DaParamCollection daParamCollection : paramList) {
                ChildVO childVO = new ChildVO();
                childVO.setItemCode(daParamCollection.getParamCode());
                BsFormulaChildInfo childOne = bsFormulaChildInfoService.getOne(new LambdaQueryWrapper<BsFormulaChildInfo>().eq(BsFormulaChildInfo::getParamCode, daParamCollection.getParamCode()));
                DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode()));
                if(childOne!=null){
                    String operationType = childOne.getOperationType();
                    if(operationType.equals("1")){
                        childVO.setItemType("2");
                    }else if(operationType.equals("2")){
                        childVO.setItemType("1");
                    }
                }else {
                    childVO.setItemType("3");
                }
                if(paramConfOne!=null){
                    childVO.setItemText(paramConfOne.getCollectParameterName());
                }else {
                    childVO.setItemText("");
                }
                childVO.setItemValue(daParamCollection.getParamValue());
                if(daParamCollection.getParamValue().equals("1")){
                    childVO.setCheckResult("1");
                }else if(daParamCollection.getParamValue().equals("2")){
                    childVO.setCheckResult("0");
                    parentVO.setTotalResult("0");
                    totalResult = "1";
                }else {
                    childVO.setCheckResult("1");
                }
                childVO.setCheckTime(format.format(daParamCollection.getCollectionTime()));
                listChildVo.add(childVO);
            }
            parentVO.setCheckList(listChildVo);
            HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
            System.out.println(execute.body());
            System.out.println("-----------------------"+totalResult);
        }
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/controller/DaTestDeviceInterfaceController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,129 @@
package com.jcdm.main.da.testDeviceInterface.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.JsonObject;
import com.jcdm.main.restful.qingYan.doman.ChildVO;
import com.jcdm.main.restful.qingYan.doman.ParentVO;
import com.jcdm.main.webservice.ItemList;
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.da.testDeviceInterface.domain.DaTestDeviceInterface;
import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService;
import com.jcdm.common.utils.poi.ExcelUtil;
import com.jcdm.common.core.page.TableDataInfo;
/**
 * æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®Controller
 *
 * @author hdy
 * @date 2024-05-13
 */
@RestController
@RequestMapping("/da/testDeviceInterface")
public class DaTestDeviceInterfaceController extends BaseController
{
    @Autowired
    private IDaTestDeviceInterfaceService daTestDeviceInterfaceService;
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表
     */
    @PostMapping("/testPut")
    public AjaxResult list(@RequestBody ParentVO parentVO) throws JsonProcessingException {
        ObjectMapper mapper = new ObjectMapper();
        List<ChildVO> li = parentVO.getCheckList();
        String s = mapper.writeValueAsString(li);
        DaTestDeviceInterface daTestDeviceInterface = new DaTestDeviceInterface();
        daTestDeviceInterface.setRecordId(parentVO.getRecordId());
        daTestDeviceInterface.setStationCode(parentVO.getStationCode());
        daTestDeviceInterface.setProductNum(parentVO.getProductNum());
        daTestDeviceInterface.setTotalResult(parentVO.getTotalResult());
        daTestDeviceInterface.setCheckList(s);
        daTestDeviceInterfaceService.save(daTestDeviceInterface);
        return AjaxResult.success("i");
    }
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('da:testDeviceInterface:list')")
    @GetMapping("/list")
    public TableDataInfo list(DaTestDeviceInterface daTestDeviceInterface)
    {
        startPage();
        List<DaTestDeviceInterface> list = daTestDeviceInterfaceService.selectDaTestDeviceInterfaceList(daTestDeviceInterface);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºæµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('da:testDeviceInterface:export')")
    @Log(title = "测试设备接口数据", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DaTestDeviceInterface daTestDeviceInterface)
    {
        List<DaTestDeviceInterface> list = daTestDeviceInterfaceService.selectDaTestDeviceInterfaceList(daTestDeviceInterface);
        ExcelUtil<DaTestDeviceInterface> util = new ExcelUtil<DaTestDeviceInterface>(DaTestDeviceInterface.class);
        util.exportExcel(response, list, "测试设备接口数据数据");
    }
    /**
     * èŽ·å–测试设备接口数据详细信息
     */
    @PreAuthorize("@ss.hasPermi('da:testDeviceInterface:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(daTestDeviceInterfaceService.selectDaTestDeviceInterfaceById(id));
    }
    /**
     * æ–°å¢žæµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     */
    @PreAuthorize("@ss.hasPermi('da:testDeviceInterface:add')")
    @Log(title = "测试设备接口数据", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DaTestDeviceInterface daTestDeviceInterface)
    {
        return toAjax(daTestDeviceInterfaceService.insertDaTestDeviceInterface(daTestDeviceInterface));
    }
    /**
     * ä¿®æ”¹æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     */
    @PreAuthorize("@ss.hasPermi('da:testDeviceInterface:edit')")
    @Log(title = "测试设备接口数据", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DaTestDeviceInterface daTestDeviceInterface)
    {
        return toAjax(daTestDeviceInterfaceService.updateDaTestDeviceInterface(daTestDeviceInterface));
    }
    /**
     * åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     */
    @PreAuthorize("@ss.hasPermi('da:testDeviceInterface:remove')")
    @Log(title = "测试设备接口数据", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(daTestDeviceInterfaceService.deleteDaTestDeviceInterfaceByIds(ids));
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/domain/DaTestDeviceInterface.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,273 @@
package com.jcdm.main.da.testDeviceInterface.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;
/**
 * æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®å¯¹è±¡ da_test_device_interface
 *
 * @author hdy
 * @date 2024-05-13
 */
public class DaTestDeviceInterface extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** id */
    private Long id;
    /** æ£€éªŒè®°å½•ç¼–号,由各设备按自定规则生成,唯一编码 */
    @Excel(name = "检验记录编号,由各设备按自定规则生成,唯一编码")
    private String recordId;
    /** æ£€æµ‹ç«™ç‚¹ç¼–号 */
    @Excel(name = "检测站点编号")
    private String stationCode;
    /** äº§å“åºåˆ—号-pack码 */
    @Excel(name = "产品序列号-pack码")
    private String productNum;
    /** æ•´ä½“结果 ï¼ˆ0 ä¸åˆæ ¼ ï¼Œ 1 åˆæ ¼ï¼‰ */
    @Excel(name = "整体结果 ", readConverterExp = "0=,不=合格,,=,1=,合=æ ¼")
    private String totalResult;
    /** å·¥å•å· */
    @Excel(name = "工单号")
    private String workOrderNo;
    /** ä¾›åº”商类型 */
    @Excel(name = "供应商类型")
    private String supplierType;
    /** å…¥å‚-参数列表 */
    @Excel(name = "入参-参数列表")
    private String checkList;
    /** çŠ¶æ€ç¼–码(success为成功,fail为失败) */
    @Excel(name = "状态编码", readConverterExp = "s=uccess为成功,fail为失败")
    private String resultCode;
    /** æŽ¥å£çš„返回信息,当fail时会有报错信息 */
    @Excel(name = "接口的返回信息,当fail时会有报错信息")
    private String resultMessage;
    /** å‡ºå‚-参数列表 */
    @Excel(name = "出参-参数列表")
    private String resultData;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
    private String remarks;
    /** åˆ›å»ºç”¨æˆ· */
    @Excel(name = "创建用户")
    private String createUser;
    /** æ›´æ”¹ç”¨æˆ· */
    @Excel(name = "更改用户")
    private String updateUser;
    /** é¢„留字段1 */
    private String spareField1;
    /** é¢„留字段2 */
    private String spareField2;
    /** é¢„留字段3 */
    private String spareField3;
    /** é¢„留字段4 */
    private String spareField4;
    public void setId(Long id)
    {
        this.id = id;
    }
    public Long getId()
    {
        return id;
    }
    public void setRecordId(String recordId)
    {
        this.recordId = recordId;
    }
    public String getRecordId()
    {
        return recordId;
    }
    public void setStationCode(String stationCode)
    {
        this.stationCode = stationCode;
    }
    public String getStationCode()
    {
        return stationCode;
    }
    public void setProductNum(String productNum)
    {
        this.productNum = productNum;
    }
    public String getProductNum()
    {
        return productNum;
    }
    public void setTotalResult(String totalResult)
    {
        this.totalResult = totalResult;
    }
    public String getTotalResult()
    {
        return totalResult;
    }
    public void setWorkOrderNo(String workOrderNo)
    {
        this.workOrderNo = workOrderNo;
    }
    public String getWorkOrderNo()
    {
        return workOrderNo;
    }
    public void setSupplierType(String supplierType)
    {
        this.supplierType = supplierType;
    }
    public String getSupplierType()
    {
        return supplierType;
    }
    public void setCheckList(String checkList)
    {
        this.checkList = checkList;
    }
    public String getCheckList()
    {
        return checkList;
    }
    public void setResultCode(String resultCode)
    {
        this.resultCode = resultCode;
    }
    public String getResultCode()
    {
        return resultCode;
    }
    public void setResultMessage(String resultMessage)
    {
        this.resultMessage = resultMessage;
    }
    public String getResultMessage()
    {
        return resultMessage;
    }
    public void setResultData(String resultData)
    {
        this.resultData = resultData;
    }
    public String getResultData()
    {
        return resultData;
    }
    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }
    public String getRemarks()
    {
        return remarks;
    }
    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(String spareField3)
    {
        this.spareField3 = spareField3;
    }
    public String getSpareField3()
    {
        return spareField3;
    }
    public void setSpareField4(String spareField4)
    {
        this.spareField4 = spareField4;
    }
    public String getSpareField4()
    {
        return spareField4;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("recordId", getRecordId())
            .append("stationCode", getStationCode())
            .append("productNum", getProductNum())
            .append("totalResult", getTotalResult())
            .append("workOrderNo", getWorkOrderNo())
            .append("supplierType", getSupplierType())
            .append("checkList", getCheckList())
            .append("resultCode", getResultCode())
            .append("resultMessage", getResultMessage())
            .append("resultData", getResultData())
            .append("remarks", getRemarks())
            .append("createUser", getCreateUser())
            .append("createTime", getCreateTime())
            .append("updateUser", getUpdateUser())
            .append("updateTime", getUpdateTime())
            .append("spareField1", getSpareField1())
            .append("spareField2", getSpareField2())
            .append("spareField3", getSpareField3())
            .append("spareField4", getSpareField4())
            .toString();
    }
}
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/mapper/DaTestDeviceInterfaceMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
package com.jcdm.main.da.testDeviceInterface.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jcdm.main.da.testDeviceInterface.domain.DaTestDeviceInterface;
/**
 * æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®Mapper接口
 *
 * @author hdy
 * @date 2024-05-13
 */
public interface DaTestDeviceInterfaceMapper extends BaseMapper<DaTestDeviceInterface>
{
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param id æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¸»é”®
     * @return æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     */
    public DaTestDeviceInterface selectDaTestDeviceInterfaceById(Long id);
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®é›†åˆ
     */
    public List<DaTestDeviceInterface> selectDaTestDeviceInterfaceList(DaTestDeviceInterface daTestDeviceInterface);
    /**
     * æ–°å¢žæµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return ç»“æžœ
     */
    public int insertDaTestDeviceInterface(DaTestDeviceInterface daTestDeviceInterface);
    /**
     * ä¿®æ”¹æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return ç»“æžœ
     */
    public int updateDaTestDeviceInterface(DaTestDeviceInterface daTestDeviceInterface);
    /**
     * åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param id æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteDaTestDeviceInterfaceById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteDaTestDeviceInterfaceByIds(Long[] ids);
}
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/service/IDaTestDeviceInterfaceService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,63 @@
package com.jcdm.main.da.testDeviceInterface.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jcdm.main.da.testDeviceInterface.domain.DaTestDeviceInterface;
/**
 * æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®Service接口
 *
 * @author hdy
 * @date 2024-05-13
 */
public interface IDaTestDeviceInterfaceService extends IService<DaTestDeviceInterface>
{
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param id æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¸»é”®
     * @return æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     */
    public DaTestDeviceInterface selectDaTestDeviceInterfaceById(Long id);
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®é›†åˆ
     */
    public List<DaTestDeviceInterface> selectDaTestDeviceInterfaceList(DaTestDeviceInterface daTestDeviceInterface);
    /**
     * æ–°å¢žæµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return ç»“æžœ
     */
    public int insertDaTestDeviceInterface(DaTestDeviceInterface daTestDeviceInterface);
    /**
     * ä¿®æ”¹æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return ç»“æžœ
     */
    public int updateDaTestDeviceInterface(DaTestDeviceInterface daTestDeviceInterface);
    /**
     * æ‰¹é‡åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param ids éœ€è¦åˆ é™¤çš„测试设备接口数据主键集合
     * @return ç»“æžœ
     */
    public int deleteDaTestDeviceInterfaceByIds(Long[] ids);
    /**
     * åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¿¡æ¯
     *
     * @param id æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteDaTestDeviceInterfaceById(Long id);
}
jcdm-main/src/main/java/com/jcdm/main/da/testDeviceInterface/service/impl/DaTestDeviceInterfaceServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
package com.jcdm.main.da.testDeviceInterface.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection;
import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.da.testDeviceInterface.mapper.DaTestDeviceInterfaceMapper;
import com.jcdm.main.da.testDeviceInterface.domain.DaTestDeviceInterface;
import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService;
/**
 * æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®Service业务层处理
 *
 * @author hdy
 * @date 2024-05-13
 */
@Service
public class DaTestDeviceInterfaceServiceImpl extends ServiceImpl<DaTestDeviceInterfaceMapper, DaTestDeviceInterface> implements IDaTestDeviceInterfaceService
{
    @Autowired
    private DaTestDeviceInterfaceMapper daTestDeviceInterfaceMapper;
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param id æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¸»é”®
     * @return æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     */
    @Override
    public DaTestDeviceInterface selectDaTestDeviceInterfaceById(Long id)
    {
        return daTestDeviceInterfaceMapper.selectDaTestDeviceInterfaceById(id);
    }
    /**
     * æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     */
    @Override
    public List<DaTestDeviceInterface> selectDaTestDeviceInterfaceList(DaTestDeviceInterface daTestDeviceInterface)
    {
        return daTestDeviceInterfaceMapper.selectDaTestDeviceInterfaceList(daTestDeviceInterface);
    }
    /**
     * æ–°å¢žæµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return ç»“æžœ
     */
    @Override
    public int insertDaTestDeviceInterface(DaTestDeviceInterface daTestDeviceInterface)
    {
        daTestDeviceInterface.setCreateTime(DateUtils.getNowDate());
        return daTestDeviceInterfaceMapper.insertDaTestDeviceInterface(daTestDeviceInterface);
    }
    /**
     * ä¿®æ”¹æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param daTestDeviceInterface æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     * @return ç»“æžœ
     */
    @Override
    public int updateDaTestDeviceInterface(DaTestDeviceInterface daTestDeviceInterface)
    {
        daTestDeviceInterface.setUpdateTime(DateUtils.getNowDate());
        return daTestDeviceInterfaceMapper.updateDaTestDeviceInterface(daTestDeviceInterface);
    }
    /**
     * æ‰¹é‡åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
     *
     * @param ids éœ€è¦åˆ é™¤çš„测试设备接口数据主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaTestDeviceInterfaceByIds(Long[] ids)
    {
        return daTestDeviceInterfaceMapper.deleteDaTestDeviceInterfaceByIds(ids);
    }
    /**
     * åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¿¡æ¯
     *
     * @param id æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteDaTestDeviceInterfaceById(Long id)
    {
        return daTestDeviceInterfaceMapper.deleteDaTestDeviceInterfaceById(id);
    }
}
jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java
@@ -9,6 +9,7 @@
    public static void main(String[] args) {
        String str = "uuuuuu11uuuuuuuuuuuuuuu";
        System.out.println(str.length());
//        getWorkReportResultFeedback()
    }
    public static final String getRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration";
jcdm-main/src/main/resources/mapper/da/testDeviceInterface/DaTestDeviceInterfaceMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,136 @@
<?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.testDeviceInterface.mapper.DaTestDeviceInterfaceMapper">
    <resultMap type="DaTestDeviceInterface" id="DaTestDeviceInterfaceResult">
        <result property="id"    column="id"    />
        <result property="recordId"    column="record_id"    />
        <result property="stationCode"    column="station_code"    />
        <result property="productNum"    column="product_num"    />
        <result property="totalResult"    column="total_result"    />
        <result property="workOrderNo"    column="work_order_no"    />
        <result property="supplierType"    column="supplier_type"    />
        <result property="checkList"    column="check_list"    />
        <result property="resultCode"    column="result_code"    />
        <result property="resultMessage"    column="result_message"    />
        <result property="resultData"    column="result_data"    />
        <result property="remarks"    column="remarks"    />
        <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_field1"    />
        <result property="spareField2"    column="spare_field2"    />
        <result property="spareField3"    column="spare_field3"    />
        <result property="spareField4"    column="spare_field4"    />
    </resultMap>
    <sql id="selectDaTestDeviceInterfaceVo">
        select id, record_id, station_code, product_num, total_result, work_order_no, supplier_type, check_list, result_code, result_message, result_data, remarks, create_user, create_time, update_user, update_time, spare_field1, spare_field2, spare_field3, spare_field4 from da_test_device_interface
    </sql>
    <select id="selectDaTestDeviceInterfaceList" parameterType="DaTestDeviceInterface" resultMap="DaTestDeviceInterfaceResult">
        <include refid="selectDaTestDeviceInterfaceVo"/>
        <where>
            <if test="recordId != null  and recordId != ''"> and record_id = #{recordId}</if>
            <if test="stationCode != null  and stationCode != ''"> and station_code = #{stationCode}</if>
            <if test="productNum != null  and productNum != ''"> and product_num = #{productNum}</if>
            <if test="totalResult != null  and totalResult != ''"> and total_result = #{totalResult}</if>
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
            <if test="supplierType != null  and supplierType != ''"> and supplier_type = #{supplierType}</if>
            <if test="resultCode != null  and resultCode != ''"> and result_code = #{resultCode}</if>
        </where>
    </select>
    <select id="selectDaTestDeviceInterfaceById" parameterType="Long" resultMap="DaTestDeviceInterfaceResult">
        <include refid="selectDaTestDeviceInterfaceVo"/>
        where id = #{id}
    </select>
    <insert id="insertDaTestDeviceInterface" parameterType="DaTestDeviceInterface">
        insert into da_test_device_interface
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="recordId != null">record_id,</if>
            <if test="stationCode != null">station_code,</if>
            <if test="productNum != null">product_num,</if>
            <if test="totalResult != null">total_result,</if>
            <if test="workOrderNo != null">work_order_no,</if>
            <if test="supplierType != null">supplier_type,</if>
            <if test="checkList != null">check_list,</if>
            <if test="resultCode != null">result_code,</if>
            <if test="resultMessage != null">result_message,</if>
            <if test="resultData != null">result_data,</if>
            <if test="remarks != null">remarks,</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_field1,</if>
            <if test="spareField2 != null">spare_field2,</if>
            <if test="spareField3 != null">spare_field3,</if>
            <if test="spareField4 != null">spare_field4,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="recordId != null">#{recordId},</if>
            <if test="stationCode != null">#{stationCode},</if>
            <if test="productNum != null">#{productNum},</if>
            <if test="totalResult != null">#{totalResult},</if>
            <if test="workOrderNo != null">#{workOrderNo},</if>
            <if test="supplierType != null">#{supplierType},</if>
            <if test="checkList != null">#{checkList},</if>
            <if test="resultCode != null">#{resultCode},</if>
            <if test="resultMessage != null">#{resultMessage},</if>
            <if test="resultData != null">#{resultData},</if>
            <if test="remarks != null">#{remarks},</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>
         </trim>
    </insert>
    <update id="updateDaTestDeviceInterface" parameterType="DaTestDeviceInterface">
        update da_test_device_interface
        <trim prefix="SET" suffixOverrides=",">
            <if test="recordId != null">record_id = #{recordId},</if>
            <if test="stationCode != null">station_code = #{stationCode},</if>
            <if test="productNum != null">product_num = #{productNum},</if>
            <if test="totalResult != null">total_result = #{totalResult},</if>
            <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if>
            <if test="supplierType != null">supplier_type = #{supplierType},</if>
            <if test="checkList != null">check_list = #{checkList},</if>
            <if test="resultCode != null">result_code = #{resultCode},</if>
            <if test="resultMessage != null">result_message = #{resultMessage},</if>
            <if test="resultData != null">result_data = #{resultData},</if>
            <if test="remarks != null">remarks = #{remarks},</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_field1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field2 = #{spareField2},</if>
            <if test="spareField3 != null">spare_field3 = #{spareField3},</if>
            <if test="spareField4 != null">spare_field4 = #{spareField4},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteDaTestDeviceInterfaceById" parameterType="Long">
        delete from da_test_device_interface where id = #{id}
    </delete>
    <delete id="deleteDaTestDeviceInterfaceByIds" parameterType="String">
        delete from da_test_device_interface where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
jcdm-ui/src/api/main/da/testDeviceInterface/testDeviceInterface.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表
export function listTestDeviceInterface(query) {
  return request({
    url: '/da/testDeviceInterface/list',
    method: 'get',
    params: query
  })
}
// æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®è¯¦ç»†
export function getTestDeviceInterface(id) {
  return request({
    url: '/da/testDeviceInterface/' + id,
    method: 'get'
  })
}
// æ–°å¢žæµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
export function addTestDeviceInterface(data) {
  return request({
    url: '/da/testDeviceInterface',
    method: 'post',
    data: data
  })
}
// ä¿®æ”¹æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
export function updateTestDeviceInterface(data) {
  return request({
    url: '/da/testDeviceInterface',
    method: 'put',
    data: data
  })
}
// åˆ é™¤æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®
export function delTestDeviceInterface(id) {
  return request({
    url: '/da/testDeviceInterface/' + id,
    method: 'delete'
  })
}
jcdm-ui/src/views/main/da/testDeviceInterface/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,399 @@
<template>
  <div class="app-container">
    <el-card class="box-card">
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="检验记录编号" prop="recordId">
            <el-input
              v-model="queryParams.recordId"
              placeholder="请输入检验记录编号,由各设备按自定规则生成,唯一编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="站点编号" prop="stationCode">
            <el-input
              v-model="queryParams.stationCode"
              placeholder="请输入检测站点编号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="pack码" prop="productNum">
            <el-input
              v-model="queryParams.productNum"
              placeholder="请输入产品序列号-pack码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="整体结果 " prop="totalResult">
            <el-input
              v-model="queryParams.totalResult"
              placeholder="请输入整体结果 "
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="工单号" prop="workOrderNo">
            <el-input
              v-model="queryParams.workOrderNo"
              placeholder="请输入工单号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
<!--          <el-form-item label="供应商类型" prop="supplierType">-->
<!--            <el-select v-model="queryParams.supplierType" placeholder="请选择供应商类型" clearable>-->
<!--              <el-option-->
<!--                v-for="dict in dict.type.${dictType}"-->
<!--                :key="dict.value"-->
<!--                :label="dict.label"-->
<!--                :value="dict.value"-->
<!--              />-->
<!--            </el-select>-->
<!--          </el-form-item>-->
          <el-form-item label="状态编码" prop="resultCode">
            <el-input
              v-model="queryParams.resultCode"
              placeholder="请输入状态编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item style="float: right">
            <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-card>
    <el-card style="margin-top: 10px" class="box-card">
        <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="['da:testDeviceInterface: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="['da:testDeviceInterface: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="['da:testDeviceInterface: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="['da:testDeviceInterface:export']"
            >导出</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table border v-loading="loading" :data="testDeviceInterfaceList" @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="recordId">
          </el-table-column>
          <el-table-column label="站点编号" align="center" prop="stationCode">
          </el-table-column>
          <el-table-column label="pack码" align="center" prop="productNum">
          </el-table-column>
          <el-table-column label="整体结果 " align="center" prop="totalResult">
          </el-table-column>
          <el-table-column label="工单号" align="center" prop="workOrderNo">
          </el-table-column>
          <el-table-column label="供应商类型" align="center" prop="supplierType">
          </el-table-column>
          <el-table-column label="入参" align="center" prop="checkList">
          </el-table-column>
          <el-table-column label="状态编码" align="center" prop="resultCode">
          </el-table-column>
          <el-table-column label="返回信息" align="center" prop="resultMessage">
          </el-table-column>
          <el-table-column label="出参" align="center" prop="resultData">
          </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-column fixed="right" width="200" label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="success"
                plain
                style="width: 72px"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['da:testDeviceInterface:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="danger"
                plain
                style="width: 72px"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['da:testDeviceInterface:remove']"
              >删除</el-button>
            </template>
          </el-table-column>
        </el-table>
    </el-card>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- æ·»åŠ æˆ–修改测试设备接口数据对话框 -->
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body>
      <span slot="title">
        <i class="el-icon-s-order"></i>
        {{titleName}}
      </span>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="检验记录编号,由各设备按自定规则生成,唯一编码" prop="recordId">
          <el-input v-model="form.recordId" placeholder="请输入检验记录编号,由各设备按自定规则生成,唯一编码" />
        </el-form-item>
        <el-form-item label="检测站点编号" prop="stationCode">
          <el-input v-model="form.stationCode" placeholder="请输入检测站点编号" />
        </el-form-item>
        <el-form-item label="产品序列号-pack码" prop="productNum">
          <el-input v-model="form.productNum" placeholder="请输入产品序列号-pack码" />
        </el-form-item>
        <el-form-item label="整体结果 " prop="totalResult">
          <el-input v-model="form.totalResult" placeholder="请输入整体结果 " />
        </el-form-item>
        <el-form-item label="工单号" prop="workOrderNo">
          <el-input v-model="form.workOrderNo" placeholder="请输入工单号" />
        </el-form-item>
<!--        <el-form-item label="供应商类型" prop="supplierType">-->
<!--          <el-select v-model="form.supplierType" 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-item label="入参-参数列表" prop="checkList">
          <el-input v-model="form.checkList" placeholder="请输入入参-参数列表" />
        </el-form-item>
        <el-form-item label="状态编码" prop="resultCode">
          <el-input v-model="form.resultCode" placeholder="请输入状态编码" />
        </el-form-item>
        <el-form-item label="接口的返回信息,当fail时会有报错信息" prop="resultMessage">
          <el-input v-model="form.resultMessage" placeholder="请输入接口的返回信息,当fail时会有报错信息" />
        </el-form-item>
        <el-form-item label="出参-参数列表" prop="resultData">
          <el-input v-model="form.resultData" placeholder="请输入出参-参数列表" />
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" placeholder="请输入备注" />
        </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 { listTestDeviceInterface, getTestDeviceInterface, delTestDeviceInterface, addTestDeviceInterface, updateTestDeviceInterface } from "@/api/main/da/testDeviceInterface/testDeviceInterface";
export default {
  name: "TestDeviceInterface",
  data() {
    return {
      // é®ç½©å±‚
      loading: true,
      titleName: "",
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // éžå•ä¸ªç¦ç”¨
      single: true,
      // éžå¤šä¸ªç¦ç”¨
      multiple: true,
      // æ˜¾ç¤ºæœç´¢æ¡ä»¶
      showSearch: true,
      // æ€»æ¡æ•°
      total: 0,
      // æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®è¡¨æ ¼æ•°æ®
      testDeviceInterfaceList: [],
      // å¼¹å‡ºå±‚标题
      title: "",
      // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚
      open: false,
      // æŸ¥è¯¢å‚æ•°
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        recordId: null,
        stationCode: null,
        productNum: null,
        totalResult: null,
        workOrderNo: null,
        supplierType: null,
        resultCode: null,
      },
      // è¡¨å•å‚æ•°
      form: {},
      // è¡¨å•æ ¡éªŒ
      rules: {
        id: [
          { required: true, message: "id不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** æŸ¥è¯¢æµ‹è¯•è®¾å¤‡æŽ¥å£æ•°æ®åˆ—表 */
    getList() {
      this.loading = true;
      listTestDeviceInterface(this.queryParams).then(response => {
        this.testDeviceInterfaceList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // å–消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // è¡¨å•é‡ç½®
    reset() {
      this.form = {
        id: null,
        recordId: null,
        stationCode: null,
        productNum: null,
        totalResult: null,
        workOrderNo: null,
        supplierType: null,
        checkList: null,
        resultCode: null,
        resultMessage: null,
        resultData: null,
        remarks: null,
        createUser: null,
        createTime: null,
        updateUser: null,
        updateTime: null,
        spareField1: null,
        spareField2: null,
        spareField3: null,
        spareField4: 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.titleName = "添加测试设备接口数据";
    },
    /** ä¿®æ”¹æŒ‰é’®æ“ä½œ */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getTestDeviceInterface(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.titleName = "修改测试设备接口数据";
      });
    },
    /** æäº¤æŒ‰é’® */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateTestDeviceInterface(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addTestDeviceInterface(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 delTestDeviceInterface(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** å¯¼å‡ºæŒ‰é’®æ“ä½œ */
    handleExport() {
      this.download('da/testDeviceInterface/export', {
        ...this.queryParams
      }, `testDeviceInterface_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>