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.Granary;
|
import com.fzzy.igds.sys.GranaryService;
|
import org.springframework.beans.BeanUtils;
|
import org.springframework.stereotype.Component;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* @Description
|
* @Author CZT
|
* @Date 2024/11/22 14:48
|
*/
|
@Component
|
public class GranaryPR {
|
|
@Resource
|
private GranaryService granaryService;
|
|
/**
|
* ${dorado.getDataProvider("granaryPR#getGranary").getResult()}
|
* granaryPR#getGranary
|
* @return
|
*/
|
@DataProvider
|
public List<Granary> getGranary() {
|
return granaryService.getGranary(null, null);
|
}
|
|
/**
|
* granaryPR#saveGranary 新增或者修改
|
*
|
* @param data
|
*/
|
@DataResolver
|
public void saveGranary(Granary data) {
|
Granary granary = new Granary();
|
BeanUtils.copyProperties(data, granary);
|
granaryService.saveOrUpdate(granary);
|
}
|
|
/**
|
* granaryPR#delGranary
|
*
|
* @param data
|
*/
|
@Expose
|
public String delGranary(Granary data){
|
Granary granary = new Granary();
|
BeanUtils.copyProperties(data, granary);
|
return granaryService.delData(granary);
|
}
|
|
}
|