package com.ld.igds.n2.view;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
import com.ld.igds.constant.Constant;
|
import com.ld.igds.models.DicTrigger;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
import com.bstek.dorado.annotation.DataProvider;
|
import com.bstek.dorado.annotation.Expose;
|
import com.ld.igds.models.N2MacConf;
|
import com.ld.igds.n2.service.HMacConfService;
|
import com.ld.igds.util.ContextUtil;
|
|
/**
|
* 制氮机配置管理,不包括远程操作管理
|
*
|
* @author andy.jia
|
*/
|
@Component
|
public class N2MacPR {
|
|
@Autowired
|
private HMacConfService n2ConfService;
|
|
|
/**
|
* n2MacPR#getData
|
*
|
* @return
|
* @throws Exception
|
*/
|
@DataProvider
|
public List<N2MacConf> getData() throws Exception {
|
String companyId = ContextUtil.getCompanyId();
|
return n2ConfService.getConfData(companyId, null);
|
}
|
|
/**
|
* n2MacPR#saveData
|
*
|
* @param data
|
* @return
|
*/
|
@Expose
|
public String saveData(N2MacConf data) {
|
String msg = n2ConfService.saveData(data);
|
return msg;
|
}
|
|
/**
|
* n2MacPR#delData
|
*
|
* @param data
|
* @return
|
*/
|
@Expose
|
public String delData(N2MacConf data) {
|
String msg = n2ConfService.delData(data);
|
return msg;
|
}
|
|
/**
|
* n2MacPR#getDataBySn 根据参数获取当前的制氮机信息
|
*
|
* @return
|
* @throws Exception
|
*/
|
@DataProvider
|
public N2MacConf getDataBySn(String sn) throws Exception {
|
return n2ConfService.getDataBySn(sn);
|
}
|
|
/**
|
*
|
*${dorado.getDataProvider("n2MacPR#runStatus").getResult()}
|
* @return
|
* @throws Exception
|
*/
|
@DataProvider
|
public List<DicTrigger> runStatus() {
|
List<DicTrigger> list = new ArrayList<>();
|
list.add(new DicTrigger(Constant.YN_Y, "运行"));
|
list.add(new DicTrigger(Constant.YN_N, "停止"));
|
return list;
|
}
|
|
}
|