Merge remote-tracking branch 'origin/master'
| | |
| | | excludes: /system/notice |
| | | # å¹é
é¾æ¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | kangaroohy: |
| | | milo: |
| | | primary: default |
| | | config: |
| | | default: |
| | | endpoint: opc.tcp://127.0.0.1:49320 |
| | | security-policy: none |
| | |
| | | <dependency> |
| | | <groupId>com.jcdm</groupId> |
| | | <artifactId>jcdm-common</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>mybatis-spring</artifactId> |
| | | <groupId>org.mybatis</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <artifactId>mybatis</artifactId> |
| | | <groupId>org.mybatis</groupId> |
| | | </exclusion> |
| | | <exclusion> |
| | | <artifactId>jsqlparser</artifactId> |
| | | <groupId>com.github.jsqlparser</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.kangaroohy</groupId> |
| | | <artifactId>milo-spring-boot-starter</artifactId> |
| | | <version>3.0.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | </dependencies> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.opcuaconfig.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; |
| | | 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; |
| | | |
| | | /** |
| | | * OPCUAåæ°è®¾ç½®Controller |
| | | * |
| | | * @author yyt |
| | | * @date 2023-12-22 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/da/opcuaconfig") |
| | | public class DaOpcuaConfigController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IDaOpcuaConfigService daOpcuaConfigService; |
| | | |
| | | /** |
| | | * æ¥è¯¢OPCUAåæ°è®¾ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | startPage(); |
| | | List<DaOpcuaConfig> list = daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:getconfig')") |
| | | @GetMapping("/getconfig") |
| | | public List<DaOpcuaConfig> getconfig(DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | return daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig); |
| | | } |
| | | |
| | | /** |
| | | * 导åºOPCUAåæ°è®¾ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:export')") |
| | | @Log(title = "OPCUAåæ°è®¾ç½®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | List<DaOpcuaConfig> list = daOpcuaConfigService.selectDaOpcuaConfigList(daOpcuaConfig); |
| | | ExcelUtil<DaOpcuaConfig> util = new ExcelUtil<DaOpcuaConfig>(DaOpcuaConfig.class); |
| | | util.exportExcel(response, list, "OPCUAåæ°è®¾ç½®æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åOPCUAåæ°è®¾ç½®è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(daOpcuaConfigService.selectDaOpcuaConfigById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢OPCUAåæ°è®¾ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:add')") |
| | | @Log(title = "OPCUAåæ°è®¾ç½®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | return toAjax(daOpcuaConfigService.insertDaOpcuaConfig(daOpcuaConfig)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹OPCUAåæ°è®¾ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:edit')") |
| | | @Log(title = "OPCUAåæ°è®¾ç½®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | return toAjax(daOpcuaConfigService.updateDaOpcuaConfig(daOpcuaConfig)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤OPCUAåæ°è®¾ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('da:opcuaconfig:remove')") |
| | | @Log(title = "OPCUAåæ°è®¾ç½®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(daOpcuaConfigService.deleteDaOpcuaConfigByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.opcuaconfig.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; |
| | | |
| | | /** |
| | | * OPCUAåæ°è®¾ç½®å¯¹è±¡ da_opcua_config |
| | | * |
| | | * @author yyt |
| | | * @date 2023-12-22 |
| | | */ |
| | | public class DaOpcuaConfig extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** ID */ |
| | | private Long id; |
| | | |
| | | /** æå±æ¨¡å */ |
| | | @Excel(name = "æå±æ¨¡å") |
| | | private String module; |
| | | |
| | | /** èç¹ */ |
| | | @Excel(name = "èç¹") |
| | | private String node; |
| | | |
| | | /** é¿åº¦ */ |
| | | @Excel(name = "é¿åº¦") |
| | | private Long length; |
| | | |
| | | /** ç±»å */ |
| | | @Excel(name = "ç±»å") |
| | | private String sysTypes; |
| | | |
| | | /** åè½è¯´æ */ |
| | | @Excel(name = "åè½è¯´æ") |
| | | private String functionality; |
| | | |
| | | /** æ¯å¦è®¢é
*/ |
| | | @Excel(name = "æ¯å¦è®¢é
") |
| | | private Long subscribe; |
| | | |
| | | /** 订é
ååºæ¨¡å */ |
| | | @Excel(name = "订é
ååºæ¨¡å") |
| | | private String rModule; |
| | | |
| | | /** 订é
ååºå½æ° */ |
| | | @Excel(name = "订é
ååºå½æ°") |
| | | private String rFunction; |
| | | |
| | | /** å¤æ³¨ */ |
| | | @Excel(name = "å¤æ³¨") |
| | | private String remarks; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setModule(String module) |
| | | { |
| | | this.module = module; |
| | | } |
| | | |
| | | public String getModule() |
| | | { |
| | | return module; |
| | | } |
| | | public void setNode(String node) |
| | | { |
| | | this.node = node; |
| | | } |
| | | |
| | | public String getNode() |
| | | { |
| | | return node; |
| | | } |
| | | public void setLength(Long length) |
| | | { |
| | | this.length = length; |
| | | } |
| | | |
| | | public Long getLength() |
| | | { |
| | | return length; |
| | | } |
| | | public void setSysTypes(String sysTypes) |
| | | { |
| | | this.sysTypes = sysTypes; |
| | | } |
| | | |
| | | public String getSysTypes() |
| | | { |
| | | return sysTypes; |
| | | } |
| | | public void setFunctionality(String functionality) |
| | | { |
| | | this.functionality = functionality; |
| | | } |
| | | |
| | | public String getFunctionality() |
| | | { |
| | | return functionality; |
| | | } |
| | | public void setSubscribe(Long subscribe) |
| | | { |
| | | this.subscribe = subscribe; |
| | | } |
| | | |
| | | public Long getSubscribe() |
| | | { |
| | | return subscribe; |
| | | } |
| | | public void setrModule(String rModule) |
| | | { |
| | | this.rModule = rModule; |
| | | } |
| | | |
| | | public String getrModule() |
| | | { |
| | | return rModule; |
| | | } |
| | | public void setrFunction(String rFunction) |
| | | { |
| | | this.rFunction = rFunction; |
| | | } |
| | | |
| | | public String getrFunction() |
| | | { |
| | | return rFunction; |
| | | } |
| | | public void setRemarks(String remarks) |
| | | { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public String getRemarks() |
| | | { |
| | | return remarks; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("module", getModule()) |
| | | .append("node", getNode()) |
| | | .append("length", getLength()) |
| | | .append("sysTypes", getSysTypes()) |
| | | .append("functionality", getFunctionality()) |
| | | .append("subscribe", getSubscribe()) |
| | | .append("rModule", getrModule()) |
| | | .append("rFunction", getrFunction()) |
| | | .append("remarks", getRemarks()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.opcuaconfig.init; |
| | | |
| | | import com.kangaroohy.milo.runner.subscription.SubscriptionCallback; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class CustomRunner implements ApplicationRunner { |
| | | |
| | | @Autowired |
| | | private MiloService miloService; |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | sub(); |
| | | } |
| | | |
| | | private void sub() throws Exception { |
| | | List<String> ids = new ArrayList<>(); |
| | | ids.add("nbu01.OP1010.PalletID"); |
| | | // miloService.subscriptionFromOpcUa(ids, (id, value) -> log.info("subscription ç¹ä½ï¼{} 订é
å°æ¶æ¯ï¼{}", id, value)); |
| | | TestCallback testCallback = new TestCallback(); |
| | | miloService.subscriptionFromOpcUa(ids,testCallback); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.opcuaconfig.init; |
| | | |
| | | import com.jcdm.main.da.opcuaconfig.controller.DaOpcuaConfigController; |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | import com.kangaroohy.milo.runner.subscription.SubscriptionCallback; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | public class TestCallback implements SubscriptionCallback { |
| | | |
| | | // public List<DaOpcuaConfig> b = null; |
| | | // @Autowired |
| | | // private DaOpcuaConfigController daOpcuaConfigController; |
| | | // public void onSubscribe(String identifier, Object value) { |
| | | // if (b == null || 0 > b.size()) { |
| | | // DaOpcuaConfig daOpcuaConfig=new DaOpcuaConfig(); |
| | | // daOpcuaConfig.setSubscribe(1L); |
| | | // b=daOpcuaConfigController.getconfig(daOpcuaConfig); |
| | | // } |
| | | // //使ç¨Stream APIå¨List<T>ä¸æ¥æ¾å
ç´ |
| | | // DaOpcuaConfig opcuaConf = b.stream() |
| | | // .filter(customer ->identifier.equals(customer.getNode())) |
| | | // .findAny() |
| | | // .orElse(null); |
| | | // try { |
| | | // Class<?> clazz = Class.forName(opcuaConf.getrModule()); |
| | | // Method method = clazz.getMethod(opcuaConf.getrFunction(), new Class[] { String.class, |
| | | // String.class }); |
| | | // method.invoke(clazz.newInstance(),new Object[] { |
| | | // new String(identifier), new String(value.toString()) }); |
| | | // } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | |
| | | // InvocationTargetException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | public void onSubscribe(String identifier, Object value) { |
| | | if(identifier.equals("nbu01.OP1010.PalletID")){ |
| | | switch(value.toString()) { |
| | | case "Q": |
| | | System.out.println("订é
åè°æåQQQ"); |
| | | break; |
| | | case "T": |
| | | System.out.println("订é
åè°æåTTT"); |
| | | break; |
| | | case "F": |
| | | System.out.println("订é
åè°æå"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.opcuaconfig.mapper; |
| | | |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * OPCUAåæ°è®¾ç½®Mapperæ¥å£ |
| | | * |
| | | * @author yyt |
| | | * @date 2023-12-22 |
| | | */ |
| | | public interface DaOpcuaConfigMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param id OPCUAåæ°è®¾ç½®ä¸»é® |
| | | * @return OPCUAåæ°è®¾ç½® |
| | | */ |
| | | public DaOpcuaConfig selectDaOpcuaConfigById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢OPCUAåæ°è®¾ç½®å表 |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return OPCUAåæ°è®¾ç½®éå |
| | | */ |
| | | public List<DaOpcuaConfig> selectDaOpcuaConfigList(DaOpcuaConfig daOpcuaConfig); |
| | | |
| | | /** |
| | | * æ°å¢OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig); |
| | | |
| | | /** |
| | | * ä¿®æ¹OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig); |
| | | |
| | | /** |
| | | * å é¤OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param id OPCUAåæ°è®¾ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaOpcuaConfigById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaOpcuaConfigByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.opcuaconfig.service; |
| | | |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * OPCUAåæ°è®¾ç½®Serviceæ¥å£ |
| | | * |
| | | * @author yyt |
| | | * @date 2023-12-22 |
| | | */ |
| | | public interface IDaOpcuaConfigService |
| | | { |
| | | /** |
| | | * æ¥è¯¢OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param id OPCUAåæ°è®¾ç½®ä¸»é® |
| | | * @return OPCUAåæ°è®¾ç½® |
| | | */ |
| | | public DaOpcuaConfig selectDaOpcuaConfigById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢OPCUAåæ°è®¾ç½®å表 |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return OPCUAåæ°è®¾ç½®éå |
| | | */ |
| | | public List<DaOpcuaConfig> selectDaOpcuaConfigList(DaOpcuaConfig daOpcuaConfig); |
| | | |
| | | /** |
| | | * æ°å¢OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig); |
| | | |
| | | /** |
| | | * ä¿®æ¹OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig); |
| | | |
| | | /** |
| | | * æ¹éå é¤OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param ids éè¦å é¤çOPCUAåæ°è®¾ç½®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaOpcuaConfigByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤OPCUAåæ°è®¾ç½®ä¿¡æ¯ |
| | | * |
| | | * @param id OPCUAåæ°è®¾ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDaOpcuaConfigById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.da.opcuaconfig.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.jcdm.main.da.opcuaconfig.domain.DaOpcuaConfig; |
| | | import com.jcdm.main.da.opcuaconfig.mapper.DaOpcuaConfigMapper; |
| | | import com.jcdm.main.da.opcuaconfig.service.IDaOpcuaConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * OPCUAåæ°è®¾ç½®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author yyt |
| | | * @date 2023-12-22 |
| | | */ |
| | | @Service |
| | | public class DaOpcuaConfigServiceImpl implements IDaOpcuaConfigService |
| | | { |
| | | @Autowired |
| | | private DaOpcuaConfigMapper daOpcuaConfigMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param id OPCUAåæ°è®¾ç½®ä¸»é® |
| | | * @return OPCUAåæ°è®¾ç½® |
| | | */ |
| | | @Override |
| | | public DaOpcuaConfig selectDaOpcuaConfigById(Long id) |
| | | { |
| | | return daOpcuaConfigMapper.selectDaOpcuaConfigById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢OPCUAåæ°è®¾ç½®å表 |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return OPCUAåæ°è®¾ç½® |
| | | */ |
| | | @Override |
| | | public List<DaOpcuaConfig> selectDaOpcuaConfigList(DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | return daOpcuaConfigMapper.selectDaOpcuaConfigList(daOpcuaConfig); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | return daOpcuaConfigMapper.insertDaOpcuaConfig(daOpcuaConfig); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param daOpcuaConfig OPCUAåæ°è®¾ç½® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateDaOpcuaConfig(DaOpcuaConfig daOpcuaConfig) |
| | | { |
| | | return daOpcuaConfigMapper.updateDaOpcuaConfig(daOpcuaConfig); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤OPCUAåæ°è®¾ç½® |
| | | * |
| | | * @param ids éè¦å é¤çOPCUAåæ°è®¾ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDaOpcuaConfigByIds(Long[] ids) |
| | | { |
| | | return daOpcuaConfigMapper.deleteDaOpcuaConfigByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤OPCUAåæ°è®¾ç½®ä¿¡æ¯ |
| | | * |
| | | * @param id OPCUAåæ°è®¾ç½®ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteDaOpcuaConfigById(Long id) |
| | | { |
| | | return daOpcuaConfigMapper.deleteDaOpcuaConfigById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.opcuaconfig.mapper.DaOpcuaConfigMapper"> |
| | | |
| | | <resultMap type="DaOpcuaConfig" id="DaOpcuaConfigResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="module" column="module" /> |
| | | <result property="node" column="node" /> |
| | | <result property="length" column="length" /> |
| | | <result property="sysTypes" column="sys_types" /> |
| | | <result property="functionality" column="functionality" /> |
| | | <result property="subscribe" column="subscribe" /> |
| | | <result property="rModule" column="r_module" /> |
| | | <result property="rFunction" column="r_function" /> |
| | | <result property="remarks" column="remarks" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectDaOpcuaConfigVo"> |
| | | select id, module, node, length, sys_types, functionality, subscribe, r_module, r_function, remarks from da_opcua_config |
| | | </sql> |
| | | |
| | | <select id="selectDaOpcuaConfigList" parameterType="DaOpcuaConfig" resultMap="DaOpcuaConfigResult"> |
| | | <include refid="selectDaOpcuaConfigVo"/> |
| | | <where> |
| | | <if test="module != null and module != ''"> and module like concat('%', #{module}, '%')</if> |
| | | <if test="node != null and node != ''"> and node like concat('%', #{node}, '%')</if> |
| | | <if test="length != null "> and length = #{length}</if> |
| | | <if test="sysTypes != null and sysTypes != ''"> and sys_types = #{sysTypes}</if> |
| | | <if test="functionality != null and functionality != ''"> and functionality like concat('%', #{functionality}, '%')</if> |
| | | <if test="subscribe != null "> and subscribe = #{subscribe}</if> |
| | | <if test="rModule != null and rModule != ''"> and r_module like concat('%', #{rModule}, '%')</if> |
| | | <if test="rFunction != null and rFunction != ''"> and r_function like concat('%', #{rFunction}, '%')</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectDaOpcuaConfigById" parameterType="Long" resultMap="DaOpcuaConfigResult"> |
| | | <include refid="selectDaOpcuaConfigVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertDaOpcuaConfig" parameterType="DaOpcuaConfig"> |
| | | insert into da_opcua_config |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="module != null">module,</if> |
| | | <if test="node != null">node,</if> |
| | | <if test="length != null">length,</if> |
| | | <if test="sysTypes != null">sys_types,</if> |
| | | <if test="functionality != null">functionality,</if> |
| | | <if test="subscribe != null">subscribe,</if> |
| | | <if test="rModule != null">r_module,</if> |
| | | <if test="rFunction != null">r_function,</if> |
| | | <if test="remarks != null">remarks,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="module != null">#{module},</if> |
| | | <if test="node != null">#{node},</if> |
| | | <if test="length != null">#{length},</if> |
| | | <if test="sysTypes != null">#{sysTypes},</if> |
| | | <if test="functionality != null">#{functionality},</if> |
| | | <if test="subscribe != null">#{subscribe},</if> |
| | | <if test="rModule != null">#{rModule},</if> |
| | | <if test="rFunction != null">#{rFunction},</if> |
| | | <if test="remarks != null">#{remarks},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateDaOpcuaConfig" parameterType="DaOpcuaConfig"> |
| | | update da_opcua_config |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="module != null">module = #{module},</if> |
| | | <if test="node != null">node = #{node},</if> |
| | | <if test="length != null">length = #{length},</if> |
| | | <if test="sysTypes != null">sys_types = #{sysTypes},</if> |
| | | <if test="functionality != null">functionality = #{functionality},</if> |
| | | <if test="subscribe != null">subscribe = #{subscribe},</if> |
| | | <if test="rModule != null">r_module = #{rModule},</if> |
| | | <if test="rFunction != null">r_function = #{rFunction},</if> |
| | | <if test="remarks != null">remarks = #{remarks},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteDaOpcuaConfigById" parameterType="Long"> |
| | | delete from da_opcua_config where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteDaOpcuaConfigByIds" parameterType="String"> |
| | | delete from da_opcua_config where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| | |
| | | <if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if> |
| | | sysdate() |
| | | getdate() |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | <if test="configType != null and configType != ''">#{configType},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | sysdate() |
| | | getdate() |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | <if test="configType != null and configType != ''">config_type = #{configType},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | update_time = sysdate() |
| | | update_time = getdate() |
| | | </set> |
| | | where config_id = #{configId} |
| | | </update> |
| | |
| | | <if test="status != null">#{status},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | getdate() |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | <if test="status != null and status != ''">#{status}, </if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | getdate() |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | <if test="noticeContent != null">notice_content = #{noticeContent}, </if> |
| | | <if test="status != null and status != ''">status = #{status}, </if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | update_time = sysdate() |
| | | update_time = getdate() |
| | | </set> |
| | | where notice_id = #{noticeId} |
| | | </update> |
| | |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | getdate() |
| | | ) |
| | | </insert> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢OPCUAåæ°è®¾ç½®å表 |
| | | export function listOpcuaconfig(query) { |
| | | return request({ |
| | | url: '/da/opcuaconfig/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢OPCUAåæ°è®¾ç½®è¯¦ç» |
| | | export function getOpcuaconfig(id) { |
| | | return request({ |
| | | url: '/da/opcuaconfig/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢OPCUAåæ°è®¾ç½® |
| | | export function addOpcuaconfig(data) { |
| | | return request({ |
| | | url: '/da/opcuaconfig', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹OPCUAåæ°è®¾ç½® |
| | | export function updateOpcuaconfig(data) { |
| | | return request({ |
| | | url: '/da/opcuaconfig', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤OPCUAåæ°è®¾ç½® |
| | | export function delOpcuaconfig(id) { |
| | | return request({ |
| | | url: '/da/opcuaconfig/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="æå±æ¨¡å" prop="module"> |
| | | <el-input |
| | | v-model="queryParams.module" |
| | | placeholder="请è¾å
¥æå±æ¨¡å" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="èç¹" prop="node"> |
| | | <el-input |
| | | v-model="queryParams.node" |
| | | placeholder="请è¾å
¥èç¹" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="é¿åº¦" prop="length"> |
| | | <el-input |
| | | v-model="queryParams.length" |
| | | placeholder="请è¾å
¥é¿åº¦" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å" prop="sysTypes"> |
| | | <el-select v-model="queryParams.sysTypes" 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="functionality"> |
| | | <el-input |
| | | v-model="queryParams.functionality" |
| | | placeholder="请è¾å
¥åè½è¯´æ" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦è®¢é
" prop="subscribe"> |
| | | <el-select v-model="queryParams.subscribe" 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="rModule"> |
| | | <el-input |
| | | v-model="queryParams.rModule" |
| | | placeholder="请è¾å
¥è®¢é
ååºæ¨¡å" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="订é
ååºå½æ°" prop="rFunction"> |
| | | <el-input |
| | | v-model="queryParams.rFunction" |
| | | placeholder="请è¾å
¥è®¢é
ååºå½æ°" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-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:opcuaconfig: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:opcuaconfig: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:opcuaconfig: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:opcuaconfig:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="opcuaconfigList" @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="module"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.module"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="èç¹" align="center" prop="node"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.node"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="é¿åº¦" align="center" prop="length"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.length"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="ç±»å" align="center" prop="sysTypes"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.sysTypes"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="åè½è¯´æ" align="center" prop="functionality"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.functionality"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="æ¯å¦è®¢é
" align="center" prop="subscribe"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.subscribe"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="订é
ååºæ¨¡å" align="center" prop="rModule"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.rModule"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="订é
ååºå½æ°" align="center" prop="rFunction"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.rFunction"/>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column label="å¤æ³¨" align="center" prop="remarks"> |
| | | <!-- <template slot-scope="scope">--> |
| | | <!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.remarks"/>--> |
| | | <!-- </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="['da:opcuaconfig:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['da:opcuaconfig: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" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹OPCUAåæ°è®¾ç½®å¯¹è¯æ¡ --> |
| | | <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="module"> |
| | | <el-input v-model="form.module" placeholder="请è¾å
¥æå±æ¨¡å" /> |
| | | </el-form-item> |
| | | <el-form-item label="èç¹" prop="node"> |
| | | <el-input v-model="form.node" placeholder="请è¾å
¥èç¹" /> |
| | | </el-form-item> |
| | | <el-form-item label="é¿åº¦" prop="length"> |
| | | <el-input v-model="form.length" placeholder="请è¾å
¥é¿åº¦" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å" prop="sysTypes"> |
| | | <el-select v-model="form.sysTypes" 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="functionality"> |
| | | <el-input v-model="form.functionality" placeholder="请è¾å
¥åè½è¯´æ" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦è®¢é
" prop="subscribe"> |
| | | <el-select v-model="form.subscribe" placeholder="请éæ©æ¯å¦è®¢é
"> |
| | | <!-- <el-option--> |
| | | <!-- v-for="dict in dict.type.${dictType}"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.label"--> |
| | | <!-- :value="parseInt(dict.value)"--> |
| | | <!-- ></el-option>--> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="订é
ååºæ¨¡å" prop="rModule"> |
| | | <el-input v-model="form.rModule" placeholder="请è¾å
¥è®¢é
ååºæ¨¡å" /> |
| | | </el-form-item> |
| | | <el-form-item label="订é
ååºå½æ°" prop="rFunction"> |
| | | <el-input v-model="form.rFunction" 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 { listOpcuaconfig, getOpcuaconfig, delOpcuaconfig, addOpcuaconfig, updateOpcuaconfig } from "@/api/main/da/opcuaconfig/opcuaconfig"; |
| | | |
| | | export default { |
| | | name: "Opcuaconfig", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // OPCUAåæ°è®¾ç½®è¡¨æ ¼æ°æ® |
| | | opcuaconfigList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | module: null, |
| | | node: null, |
| | | length: null, |
| | | sysTypes: null, |
| | | functionality: null, |
| | | subscribe: null, |
| | | rModule: null, |
| | | rFunction: null, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "IDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢OPCUAåæ°è®¾ç½®å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listOpcuaconfig(this.queryParams).then(response => { |
| | | this.opcuaconfigList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | module: null, |
| | | node: null, |
| | | length: null, |
| | | sysTypes: null, |
| | | functionality: null, |
| | | subscribe: null, |
| | | rModule: null, |
| | | rFunction: null, |
| | | remarks: 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 = "æ·»å OPCUAåæ°è®¾ç½®"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getOpcuaconfig(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹OPCUAåæ°è®¾ç½®"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateOpcuaconfig(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addOpcuaconfig(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤OPCUAåæ°è®¾ç½®ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delOpcuaconfig(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('da/opcuaconfig/export', { |
| | | ...this.queryParams |
| | | }, `opcuaconfig_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <version>${jcdm.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.kangaroohy</groupId> |
| | | <artifactId>milo-spring-boot-starter</artifactId> |
| | | <version>3.0.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-pool2</artifactId> |
| | | <version>2.12.0</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | |
| | | -- ---------------------------- |
| | | -- åå§å-é¨é¨è¡¨æ°æ® |
| | | -- ---------------------------- |
| | | insert into sys_dept values(100, 0, '0', 'è¥ä¾ç§æ', 0, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(101, 100, '0,100', 'æ·±å³æ»å
¬å¸', 1, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(102, 100, '0,100', 'é¿æ²åå
¬å¸', 2, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(103, 101, '0,100,101', 'ç åé¨é¨', 1, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(104, 101, '0,100,101', 'å¸åºé¨é¨', 2, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(105, 101, '0,100,101', 'æµè¯é¨é¨', 3, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(106, 101, '0,100,101', 'è´¢å¡é¨é¨', 4, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(107, 101, '0,100,101', 'è¿ç»´é¨é¨', 5, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(108, 102, '0,100,102', 'å¸åºé¨é¨', 1, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(109, 102, '0,100,102', 'è´¢å¡é¨é¨', 2, 'è¥ä¾', '15888888888', 'ry@qq.com', '0', '0', 'admin', sysdate(), '', null); |
| | | insert into sys_dept values(100, 0, '0', 'æ±å®¸', 0, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(101, 100, '0,100', 'æ·±å³æ»å
¬å¸', 1, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(102, 100, '0,100', 'é¿æ²åå
¬å¸', 2, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(103, 101, '0,100,101', 'ç åé¨é¨', 1, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(104, 101, '0,100,101', 'å¸åºé¨é¨', 2, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(105, 101, '0,100,101', 'æµè¯é¨é¨', 3, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(106, 101, '0,100,101', 'è´¢å¡é¨é¨', 4, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(107, 101, '0,100,101', 'è¿ç»´é¨é¨', 5, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(108, 102, '0,100,102', 'å¸åºé¨é¨', 1, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | insert into sys_dept values(109, 102, '0,100,102', 'è´¢å¡é¨é¨', 2, 'æ±å®¸', '15888888888', 'ry@qq.com', '0', '0', 'admin', getdate(), '', null); |
| | | |
| | | |
| | | -- ---------------------------- |
| | |
| | | -- ---------------------------- |
| | | -- åå§å-ç¨æ·ä¿¡æ¯è¡¨æ°æ® |
| | | -- ---------------------------- |
| | | insert into sys_user values(1, 103, 'admin', 'è¥ä¾', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, '管çå'); |
| | | insert into sys_user values(2, 105, 'ry', 'è¥ä¾', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', sysdate(), 'admin', sysdate(), '', null, 'æµè¯å'); |
| | | insert into sys_user values(1, 103, 'admin', 'è¥ä¾', '00', 'ry@163.com', '15888888888', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', getdate(), 'admin', sysdate(), '', null, '管çå'); |
| | | insert into sys_user values(2, 105, 'ry', 'è¥ä¾', '00', 'ry@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '0', '0', '127.0.0.1', getdate(), 'admin', sysdate(), '', null, 'æµè¯å'); |
| | | |
| | | |
| | | -- ---------------------------- |