package com.fzzy.igds; import com.bstek.dorado.annotation.DataProvider; import com.bstek.dorado.annotation.DataResolver; import com.bstek.dorado.annotation.Expose; import com.fzzy.igds.domain.DeviceSer; import com.fzzy.igds.service.DeviceSerService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; /** * @Description * @Author CZT * @Date 2025/11/28 13:50 */ @Component public class DeviceSerPR { @Resource private DeviceSerService deviceSerService; /** * deviceSerPR#getAllSer * * @return */ @DataProvider public List getAllSer() { return deviceSerService.getAllSer(); } /** * deviceSerPR#getDataById * * @param id * @return */ @Expose public DeviceSer getDataById(String id) { return deviceSerService.getDataById(null, id); } /** * deviceSerPR#updateSer * * @param data */ @DataResolver public void updateSer(DeviceSer data) { DeviceSer deviceSer = new DeviceSer(); BeanUtils.copyProperties(data, deviceSer); if(null == data.getOrderNum()){ data.setOrderNum(1); } deviceSerService.saveSer(deviceSer); } /** * 根据分机id和名称删除分机 */ @Expose @Transactional public void delSerById(String id) { DeviceSer ser = deviceSerService.getDataById(null, id); deviceSerService.delSer(ser); } /** * deviceSerPR#refreshCache * * @throws * @Title: refreshCache * @Description: 刷新缓存 void */ @Expose public void refreshCache() { deviceSerService.refreshCache(null); } /** * ${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()} * * @return */ @DataProvider public List getAllSerCache() { return deviceSerService.getCacheSerList(null); } /** * ${dorado.getDataProvider("deviceSerPR#getSerCacheByType").getResult("01")} * * @param type * @return */ @DataProvider public List getSerCacheByType(String type) { return deviceSerService.getSerCacheByType(null, type); } }