| | |
| | | import com.iailab.module.model.mcs.pre.service.MmPredictItemService; |
| | | import com.iailab.module.model.mcs.pre.service.SequenceNumService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import com.iailab.module.model.mdk.vo.MergeItemVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return mmPredictItemDao.selectPage(reqVO); |
| | | } |
| | | |
| | | // @Override |
| | | // public void add(MmPredictItemEntity mmPredictItemEntity) { |
| | | // mmPredictItemDao.insert(mmPredictItemEntity); |
| | | // } |
| | | |
| | | // @Override |
| | | // public void update(MmPredictItemEntity mmPredictItemEntity) { |
| | | // mmPredictItemDao.updateById(mmPredictItemEntity); |
| | | // } |
| | | |
| | | @Override |
| | | public void add(MmPredictItemEntity mmPredictItemEntity) { |
| | | mmPredictItemDao.insert(mmPredictItemEntity); |
| | | public List<MmPredictItemEntity> list(Map<String, Object> params) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public void update(MmPredictItemEntity mmPredictItemEntity) { |
| | | mmPredictItemDao.updateById(mmPredictItemEntity); |
| | | } |
| | | |
| | | /* |
| | | public void savePredictItem(MmPredictItemDTO mmPredictItemDto) { |
| | | public void add(MmPredictItemDTO mmPredictItemDto) { |
| | | MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem(); |
| | | predictItem.setId(UUID.randomUUID().toString()); |
| | | predictItem.setCreateTime(new Date()); |
| | | predictItem.setUpdateTime(new Date()); |
| | | |
| | | MmItemTypeEntity itemType = mmItemTypeImpl.getById(predictItem.getItemtypeid()); |
| | | if (ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | if (itemType != null && ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | SequenceNumEntity sequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.IM.toString()); |
| | | String str = String.format("%010d", sequenceNumEntity.getSequenceNum()); |
| | | predictItem.setItemno(sequenceNumEntity.getPrefix() + str); |
| | |
| | | item.setModelid(mmPredictModel.getId()); |
| | | }); |
| | | mmModelParamService.saveList(mmModelParamList); |
| | | } else if (ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | } else if (itemType != null && ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | SequenceNumEntity sequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.IC.toString()); |
| | | String str = String.format("%010d", sequenceNumEntity.getSequenceNum()); |
| | | predictItem.setItemno(sequenceNumEntity.getPrefix() + str); |
| | |
| | | MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput(); |
| | | mmItemOutput.setItemid(predictItem.getId()); |
| | | mmItemOutputService.saveMmItemOutput(mmItemOutput); |
| | | }*/ |
| | | /* |
| | | } |
| | | |
| | | @Override |
| | | public void update(MmPredictItemDTO mmPredictItemDto) { |
| | | MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem(); |
| | | predictItem.setUpdateTime(new Date()); |
| | | this.updateById(predictItem); |
| | | mmPredictItemDao.updateById(predictItem); |
| | | MmItemTypeEntity itemType = mmItemTypeImpl.getById(predictItem.getItemtypeid()); |
| | | if (ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | if (itemType != null && ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | MmPredictModelEntity mmPredictModel = mmPredictItemDto.getMmPredictModel(); |
| | | mmPredictModelService.update(mmPredictModel); |
| | | |
| | |
| | | item.setModelid(mmPredictModel.getId()); |
| | | }); |
| | | mmModelParamService.saveList(mmModelParamList); |
| | | } else if (ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | } else if (itemType != null && ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | MmPredictMergeItemEntity mMmPredictMergeItem = mmPredictItemDto.getMmPredictMergeItem(); |
| | | mmPredictMergeItemService.update(mMmPredictMergeItem); |
| | | } |
| | | DmModuleItemEntity dmModuleItem = mmPredictItemDto.getDmModuleItem(); |
| | | dmModuleItemService.update(dmModuleItem); |
| | | |
| | | if(!"".equals(dmModuleItem.getId()) && dmModuleItem.getId() != null){ |
| | | dmModuleItemService.update(dmModuleItem); |
| | | } |
| | | MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput(); |
| | | mmItemOutputService.update(mmItemOutput); |
| | | }*/ |
| | | if(!"".equals(mmItemOutput.getId()) && dmModuleItem.getId() != null){ |
| | | mmItemOutputService.update(mmItemOutput); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteBatch(String[] itemIds) { |
| | | mmPredictItemDao.deleteBatchIds(Arrays.asList(itemIds)); |
| | |
| | | public MmPredictItemDTO info(String id) { |
| | | MmPredictItemEntity predictItem = mmPredictItemDao.selectById(id); |
| | | MmPredictItemDTO mmPredictItemDto = BeanUtils.toBean(predictItem, MmPredictItemDTO.class); |
| | | return mmPredictItemDto; |
| | | } |
| | | /* |
| | | |
| | | @Override |
| | | public MmPredictItemDTO info(String id) { |
| | | MmPredictItemEntity predictItem = mmPredictItemDao.selectById(id); |
| | | MmPredictItemDTO mmPredictItemDto = BeanUtils.toBean(predictItem, MmPredictItemDTO.class); |
| | | mmPredictItemDto.setMmPredictItem(predictItem); |
| | | mmPredictItemDto.setDmModuleItem(dmModuleItemService.getByItemid(id)); |
| | | mmPredictItemDto.setMmItemOutput(mmItemOutputService.getByItemid(id)); |
| | | MmItemTypeEntity itemType = mmItemTypeImpl.getById(predictItem.getItemtypeid()); |
| | | if (ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | if (itemType != null && ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | MmPredictModelEntity mmPredictModel = mmPredictModelService.getByItemid(id); |
| | | mmPredictItemDto.setMmPredictModel(mmPredictModel); |
| | | mmPredictItemDto.setMmModelArithSettingsList(mmModelArithSettingsService.getByModelid(mmPredictModel.getId())); |
| | | mmPredictItemDto.setMmModelParamList(mmModelParamService.getByModelid(mmPredictModel.getId())); |
| | | } else if (ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | } else if (itemType != null && ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { |
| | | mmPredictItemDto.setMmPredictMergeItem(mmPredictMergeItemService.getByItemid(id)); |
| | | } |
| | | return mmPredictItemDto; |
| | | } |
| | | */ |
| | | |
| | | @Override |
| | | public int check(MmPredictItemEntity mmPredictItem) { |