| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 质量追溯管理 |
| | | * |
| | | * @author: chen |
| | | * |
| | | * @author: chen |
| | | */ |
| | | @Component |
| | | public class QualityManagerPR { |
| | |
| | | |
| | | /** |
| | | * 检验类别 |
| | | * |
| | | * <p> |
| | | * ${dorado.getDataProvider("qualityManagerPR#triggerType").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | // @DataProvider |
| | | // public List<DicTrigger> triggerType() { |
| | | // List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | // list.add(new DicTrigger("01", "满仓初检")); |
| | | // list.add(new DicTrigger("02", "出仓检验")); |
| | | // list.add(new DicTrigger("03", "月度普检")); |
| | | // return list; |
| | | // } |
| | | @DataProvider |
| | | public List<DicTrigger> triggerType() { |
| | | List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | list.add(new DicTrigger("01", "满仓初检")); |
| | | list.add(new DicTrigger("01", "入仓验收")); |
| | | list.add(new DicTrigger("02", "出仓检验")); |
| | | list.add(new DicTrigger("03", "月度普检")); |
| | | list.add(new DicTrigger("03", "3月末普检")); |
| | | list.add(new DicTrigger("04", "9月末普检")); |
| | | list.add(new DicTrigger("05", "入库初检")); |
| | | list.add(new DicTrigger("06", "月度检查")); |
| | | list.add(new DicTrigger("07", "3月末库内普查")); |
| | | list.add(new DicTrigger("08", "9月末库内普查")); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 检验依据 |
| | | * |
| | | * 指标类别 |
| | | * <p> |
| | | * ${dorado.getDataProvider("qualityManagerPR#triggerStandard").getResult()} |
| | | * |
| | | * @return |
| | |
| | | } |
| | | |
| | | /** |
| | | * 分页获取质量巡检记录信息 |
| | | * 检验依据 |
| | | * <p> |
| | | * ${dorado.getDataProvider("qualityManagerPR#triggerMetrics").getResult()} |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<DicTrigger> triggerMetrics() { |
| | | List<DicTrigger> list = new ArrayList<DicTrigger>(); |
| | | |
| | | list.add(new DicTrigger("1", "质量指标检验")); |
| | | list.add(new DicTrigger("2", "储存品质检验")); |
| | | list.add(new DicTrigger("3", "食品安全检验")); |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 分页获取质量巡检记录信息 |
| | | * <p> |
| | | * qualityManagerPR#listQuality |
| | | * |
| | | * @param page |
| | |
| | | * @throws Exception |
| | | */ |
| | | @DataProvider |
| | | public void listQuality(Page<MQuality> page, Map<String, Object> param) throws Exception{ |
| | | public void listQuality(Page<MQuality> page, Map<String, Object> param) throws Exception { |
| | | qualityManageService.listQuality(page, param); |
| | | } |
| | | |
| | |
| | | * @param data |
| | | */ |
| | | @DataResolver |
| | | public void saveQuality(MQuality data){ |
| | | public void saveQuality(MQuality data) { |
| | | String id = ""; |
| | | if(StringUtils.isEmpty(data.getId())){ |
| | | if (StringUtils.isEmpty(data.getId())) { |
| | | id = ManageUtil.createQualityId(data.getType()); |
| | | } |
| | | qualityManageService.saveQuality(id, data); |
| | | |
| | | //保存检测的化验项信息 |
| | | if (null != data.getCheckItems()) { |
| | | checkStandardManager.updateCheckItems(id,null,data.getCheckItems()); |
| | | checkStandardManager.updateCheckItems(id, null, data.getCheckItems()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String delQuality(MQuality data){ |
| | | public String delQuality(MQuality data) { |
| | | return qualityManageService.delQuality(data); |
| | | } |
| | | |