package com.qianwen.smartman.modules.cps.convert; import java.util.ArrayList; import java.util.List; import com.qianwen.smartman.modules.cps.entity.ProductionCalendar; import com.qianwen.smartman.modules.cps.vo.CalendarSaveVO; import com.qianwen.smartman.modules.cps.vo.CalendarSimpleVO; import com.qianwen.smartman.modules.cps.vo.ProductionCalendarVO; /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/convert/ProductionCalendarConvertImpl.class */ public class ProductionCalendarConvertImpl implements ProductionCalendarConvert { @Override // org.springblade.modules.cps.convert.ProductionCalendarConvert public ProductionCalendarVO convert(ProductionCalendar db) { if (db == null) { return null; } ProductionCalendarVO productionCalendarVO = new ProductionCalendarVO(); productionCalendarVO.setId(db.getId()); productionCalendarVO.setCreateUser(db.getCreateUser()); productionCalendarVO.setCreateDept(db.getCreateDept()); productionCalendarVO.setCreateTime(db.getCreateTime()); productionCalendarVO.setUpdateUser(db.getUpdateUser()); productionCalendarVO.setUpdateTime(db.getUpdateTime()); productionCalendarVO.setIsDeleted(db.getIsDeleted()); productionCalendarVO.setCode(db.getCode()); productionCalendarVO.setName(db.getName()); productionCalendarVO.setYear(db.getYear()); productionCalendarVO.setStatus(db.getStatus()); productionCalendarVO.setTenantId(db.getTenantId()); return productionCalendarVO; } @Override // org.springblade.modules.cps.convert.ProductionCalendarConvert public List convert(List db) { if (db == null) { return null; } List list = new ArrayList<>(db.size()); for (ProductionCalendar productionCalendar : db) { list.add(productionCalendarToCalendarSimpleVO(productionCalendar)); } return list; } @Override // org.springblade.modules.cps.convert.ProductionCalendarConvert public ProductionCalendar conver(CalendarSaveVO calendarSaveVO) { if (calendarSaveVO == null) { return null; } ProductionCalendar productionCalendar = new ProductionCalendar(); productionCalendar.setCode(calendarSaveVO.getCode()); productionCalendar.setName(calendarSaveVO.getName()); productionCalendar.setYear(calendarSaveVO.getYear()); productionCalendar.setStatus(calendarSaveVO.getStatus()); return productionCalendar; } protected CalendarSimpleVO productionCalendarToCalendarSimpleVO(ProductionCalendar productionCalendar) { if (productionCalendar == null) { return null; } CalendarSimpleVO calendarSimpleVO = new CalendarSimpleVO(); calendarSimpleVO.setId(productionCalendar.getId()); calendarSimpleVO.setCode(productionCalendar.getCode()); calendarSimpleVO.setName(productionCalendar.getName()); calendarSimpleVO.setYear(productionCalendar.getYear()); calendarSimpleVO.setStatus(productionCalendar.getStatus()); return calendarSimpleVO; } }