|  |  |  | 
|---|
|  |  |  | import org.springframework.beans.BeanUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Repository; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<CheckItemData> getCheckItemById(String checkId, String companyId) { | 
|---|
|  |  |  | return checkStandardMapper.getCheckItemById(checkId, companyId); | 
|---|
|  |  |  | List<CheckItemData> result = checkStandardMapper.getCheckItemById(checkId, companyId); | 
|---|
|  |  |  | for (CheckItemData data : result) { | 
|---|
|  |  |  | if (data.getUpperLimit() > 0.0 && StringUtils.isNotEmpty(data.getOperaSymbol())) { | 
|---|
|  |  |  | data.setOperaSymbolValue(data.getOperaSymbol() + " " + data.getUpperLimit()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<CheckItemData> getCheckItemByStandard(String checkId, String companyId, String foodVariety) { | 
|---|
|  |  |  | public List<CheckItemData> getCheckItemByStandard(String companyId,String checkId,String foodVariety) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<CheckItemData> result = new ArrayList<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (StringUtils.isEmpty(foodVariety)) { | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (StringUtils.isEmpty(companyId)) { | 
|---|
|  |  |  | companyId = ContextUtil.getDefaultCompanyId(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<CheckStandardData> list = checkStandardMapper.getCheckStandard(companyId, foodVariety); | 
|---|
|  |  |  | if (null == list) { | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | 
|---|
|  |  |  | CheckItemData item; | 
|---|
|  |  |  | for (CheckStandardData data : list) { | 
|---|
|  |  |  | item = new CheckItemData(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BeanUtils.copyProperties(data, item); | 
|---|
|  |  |  | item.setCheckId(checkId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (data.getUpperLimit() > 0.0 && StringUtils.isNotEmpty(data.getOperaSymbol())) { | 
|---|
|  |  |  | item.setOperaSymbol(data.getOperaSymbol() + " " + data.getUpperLimit()); | 
|---|
|  |  |  | item.setOperaSymbolValue(data.getOperaSymbol() + " " + data.getUpperLimit()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | result.add(item); | 
|---|
|  |  |  | } | 
|---|