|
|
|
@ -2,10 +2,15 @@ package org.jeecg.modules.zystylemodel.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import org.jeecg.modules.zystylefabric.mapper.ZyStyleFabricMapper; |
|
|
|
|
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; |
|
|
|
|
import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper; |
|
|
|
|
import org.jeecg.modules.zystylemodel.service.IZyStyleModelService; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -17,4 +22,30 @@ import org.springframework.stereotype.Service; |
|
|
|
|
@Service |
|
|
|
|
public class ZyStyleModelServiceImpl extends ServiceImpl<ZyStyleModelMapper, ZyStyleModel> implements IZyStyleModelService { |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private ZyStyleModelMapper zyStyleModelMapper; |
|
|
|
|
@Resource |
|
|
|
|
private ZyStyleFabricMapper zyStyleFabricMapper; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<ZyStyleModel> detail(String id) { |
|
|
|
|
List<ZyStyleModel> zyStyleModels = zyStyleModelMapper.listByStyleId(id); |
|
|
|
|
for (ZyStyleModel zy : zyStyleModels) { |
|
|
|
|
String styleName = zyStyleFabricMapper.getStyleNameByStyleId(zy.getStyleId()); |
|
|
|
|
if (StringUtils.hasText(styleName)) { |
|
|
|
|
zy.setStyleId(styleName); |
|
|
|
|
} else { |
|
|
|
|
zy.setStyleId(null); |
|
|
|
|
} |
|
|
|
|
Integer isDefault = zy.getIsdefault(); |
|
|
|
|
if (isDefault == 0) { |
|
|
|
|
zy.setIsDefaultSize("否"); |
|
|
|
|
} else if (isDefault == 1) { |
|
|
|
|
zy.setIsDefaultSize("是"); |
|
|
|
|
} else { |
|
|
|
|
zy.setIsDefaultSize(null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return zyStyleModels; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|