package com.fzzy.igds.sys.pr;
|
|
import com.bstek.dorado.annotation.DataProvider;
|
import com.bstek.dorado.annotation.DataResolver;
|
import com.bstek.dorado.annotation.Expose;
|
import com.fzzy.igds.dzhwk.domain.DepotConf;
|
import com.fzzy.igds.sys.DepotConfService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* @author jiazx
|
*/
|
@Slf4j
|
@Component
|
public class DepotConfPR {
|
|
@Resource
|
private DepotConfService depotConfService;
|
|
/**
|
* 参数配置列表 depotConfPR#getConfList
|
*
|
* @return
|
*/
|
@DataProvider
|
public List<DepotConf> getConfList() {
|
return depotConfService.getConfList(null,null);
|
}
|
|
/**
|
* depotConfPR#saveConf 参数配置更新,包括新增和修改
|
*
|
* @param conf
|
*/
|
@DataResolver
|
public void saveConf(DepotConf conf) {
|
DepotConf depotConf = new DepotConf();
|
BeanUtils.copyProperties(conf, depotConf);
|
depotConfService.saveConf(depotConf);
|
}
|
|
/**
|
* depotConfPR#delDepotConf 删除参数配置
|
*
|
* @param conf
|
*/
|
@Expose
|
public void delDepotConf(DepotConf conf) {
|
DepotConf depotConf = new DepotConf();
|
BeanUtils.copyProperties(conf, depotConf);
|
depotConfService.deleteDepotConf(depotConf);
|
}
|
|
/**
|
* depotConfPR#flushConfCache 刷新配置缓存
|
*/
|
@Expose
|
public void flushConfCache() {
|
depotConfService.flushConfCache(null);
|
}
|
|
/**
|
* depotConfPR#updateFreq 更新所有粮库的粮情频率
|
*/
|
@Expose
|
public void updateFreq(String freq) {
|
depotConfService.updateFreq(freq);
|
}
|
|
}
|