iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
@@ -20,7 +20,7 @@ import com.iailab.module.data.point.service.DaPointService; import com.iailab.module.data.point.service.DaSequenceNumService; import com.iailab.module.data.point.vo.DaPointPageReqVO; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -74,19 +74,18 @@ @Override public List<DaPointDTO> list(Map<String, Object> params) { String page = (String) params.get("page"); String limit = (String) params.get("limit"); String pointType = (String)params.get("pointType"); Object page = params.get("page"); Object limit = params.get("limit"); Object pointType = params.get("pointType"); List<String> pointNos = new ArrayList<>(); if (params.get("pointNos") != null) { pointNos = JSONArray.parseArray(JSONArray.toJSONString(params.get("pointNos")), String.class); } String pointNoLike = (String)params.get("pointNoLike"); Object pointNoLike = params.get("pointNoLike"); QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper(); queryWrapper.eq(StringUtils.isNotBlank(pointType), "point_type", pointType) .in(!CollectionUtils.isEmpty(pointNos),"point_no", pointNos) .like(StringUtils.isNotBlank(pointNoLike), "point_no", pointNoLike) .last("limit 1, 10"); queryWrapper.eq(!ObjectUtils.isEmpty(pointType), "point_type", pointType); queryWrapper.in(pointNos.size() != 0,"point_no", pointNos); queryWrapper.like(!ObjectUtils.isEmpty(pointNoLike), "point_no", pointNoLike); List<DaPointEntity> list = daPointDao.selectList(queryWrapper); return ConvertUtils.sourceToTarget(list, DaPointDTO.class); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java
@@ -5,8 +5,13 @@ import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.model.mcs.pre.dto.MmPredictItemDTO; import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity; import com.iailab.module.model.mcs.pre.entity.MmPredictItemEntity; import com.iailab.module.model.mcs.pre.service.MmItemOutputService; import com.iailab.module.model.mcs.pre.service.MmItemTypeService; import com.iailab.module.model.mcs.pre.service.MmPredictItemService; import com.iailab.module.model.mcs.pre.service.MmResultTableService; import com.iailab.module.model.mcs.pre.vo.CountItemtypeVO; import com.iailab.module.model.mcs.pre.vo.MmPredictItemPageReqVO; import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; @@ -19,7 +24,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.UUID; import static com.iailab.framework.common.pojo.CommonResult.success; @@ -34,6 +38,15 @@ @Autowired private MmPredictItemService mmPredictItemService; @Autowired private MmItemTypeService mmItemTypeService; @Autowired private MmItemOutputService mmItemOutputService; @Autowired private MmResultTableService mmResultTableService; /** * 预测项列表 */ @@ -41,13 +54,23 @@ @PreAuthorize("@ss.hasPermission('model:pre-predict:query')") public CommonResult<PageResult<MmPredictItemRespVO>> page(@Validated MmPredictItemPageReqVO reqVO) { PageResult<MmPredictItemEntity> page = mmPredictItemService.queryPage(reqVO); return success(BeanUtils.toBean(page, MmPredictItemRespVO.class)); PageResult<MmPredictItemRespVO> result = BeanUtils.toBean(page, MmPredictItemRespVO.class); for (MmPredictItemRespVO item : result.getList()){ MmItemTypeEntity mmItemTypeEntity = mmItemTypeService.info(item.getItemtypeid()); item.setItemtypename(mmItemTypeEntity== null ? "" :mmItemTypeEntity.getItemtypename()); MmItemOutputEntity mmItemOutputEntity = mmItemOutputService.getByItemid(item.getId()); item.setTagname(mmItemOutputEntity== null ? "" :mmItemOutputEntity.getTagname()); item.setResulttableid(mmItemOutputEntity== null ? "" :mmItemOutputEntity.getResulttableid()); item.setTablename(item == null ? "" : mmResultTableService.info(item.getResulttableid()).getTablename()); } return success(result); } @GetMapping("/list") @PreAuthorize("@ss.hasPermission('model:pre-predict:query')") public CommonResult<List<MmPredictItemEntity>> list(@RequestParam Map<String, Object> params) { List<MmPredictItemEntity> list = mmPredictItemService.list(params); public CommonResult<List<MmPredictItemEntity>> list() { List<MmPredictItemEntity> list = mmPredictItemService.list(); return success(list); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmSequenceNumDao.java
文件名从 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/SequenceNumDao.java 修改 @@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.iailab.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.model.mcs.pre.entity.SequenceNumEntity; import com.iailab.module.model.mcs.pre.entity.MmSequenceNumEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -11,5 +11,5 @@ */ @TenantDS @Mapper public interface SequenceNumDao extends BaseMapper<SequenceNumEntity> { public interface MmSequenceNumDao extends BaseMapper<MmSequenceNumEntity> { } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/entity/MmSequenceNumEntity.java
文件名从 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/entity/SequenceNumEntity.java 修改 @@ -13,8 +13,8 @@ * @date 2021年05月06日 12:00 */ @Data @TableName("T_SEQUENCE_NUM") public class SequenceNumEntity implements Serializable { @TableName("T_MM_SEQUENCE_NUM") public class MmSequenceNumEntity implements Serializable { private static final long serialVersionUID = 1L; /** iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/enums/ItemIncreaseCodeEnum.java
@@ -6,5 +6,5 @@ * @createTime 2024年01月02日 16:19:00 */ public enum ItemIncreaseCodeEnum { PRE_MDL, CM, IC, IM PRE_MDL, CM, IC, IM,POINT_C,POINT_M,POINT_T } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java
@@ -1,19 +1,13 @@ package com.iailab.module.model.mcs.pre.service; import com.iailab.framework.common.page.PageData; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.dto.MmPredictItemDTO; import com.iailab.module.model.mcs.pre.entity.MmPredictItemEntity; 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 javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; /** * @author PanZhibao @@ -41,5 +35,5 @@ void update(MmPredictItemDTO mmPredictItemDTO); List<MmPredictItemEntity> list(Map<String, Object> params); List<MmPredictItemEntity> list(); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmSequenceNumService.java
对比新文件 @@ -0,0 +1,12 @@ package com.iailab.module.model.mcs.pre.service; import com.iailab.module.model.mcs.pre.entity.MmSequenceNumEntity; /** * @author PanZhibao * @date 2021年05月06日 13:15 */ public interface MmSequenceNumService { MmSequenceNumEntity getAndIncreaseByCode(String code); } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/SequenceNumService.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemTypeImpl.java
@@ -6,6 +6,7 @@ import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.collection.CollectionUtils; import com.iailab.module.model.mcs.pre.dao.MmItemTypeDao; import com.iailab.module.model.mcs.pre.entity.DmModuleItemEntity; import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity; import com.iailab.module.model.mcs.pre.service.MmItemTypeService; import com.iailab.module.model.mcs.pre.vo.MmItemTypePageReqVO; @@ -74,6 +75,6 @@ @Override public List<MmItemTypeEntity> list(Map<String, Object> params) { return Collections.emptyList(); return mmItemTypeDao.selectList(new QueryWrapper<>()); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelResultstrServiceImpl.java
@@ -1,5 +1,6 @@ package com.iailab.module.model.mcs.pre.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; @@ -38,6 +39,6 @@ @Override public List<MmModelResultstrEntity> list(Map<String, Object> params) { return Collections.emptyList(); return mmModelResultstrDao.selectList(new QueryWrapper<>()); } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
@@ -10,7 +10,7 @@ import com.iailab.module.model.mcs.pre.enums.ItemIncreaseCodeEnum; import com.iailab.module.model.mcs.pre.enums.ItemTypeEnum; 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.service.MmSequenceNumService; import com.iailab.module.model.mcs.pre.vo.MmPredictItemPageReqVO; import com.iailab.module.model.mdk.vo.ItemVO; import com.iailab.module.model.mdk.vo.MergeItemVO; @@ -50,7 +50,7 @@ private MmItemTypeImpl mmItemTypeImpl; @Autowired private SequenceNumService sequenceNumService; private MmSequenceNumService sequenceNumService; @Autowired private MmPredictItemDao mmPredictItemDao; @@ -71,8 +71,8 @@ // } @Override public List<MmPredictItemEntity> list(Map<String, Object> params) { return Collections.emptyList(); public List<MmPredictItemEntity> list() { return mmPredictItemDao.selectList(new QueryWrapper<>()); } @Override @@ -84,12 +84,12 @@ MmItemTypeEntity itemType = mmItemTypeImpl.getById(predictItem.getItemtypeid()); if (itemType != null && ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) { SequenceNumEntity sequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.IM.toString()); MmSequenceNumEntity sequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.IM.toString()); String str = String.format("%010d", sequenceNumEntity.getSequenceNum()); predictItem.setItemno(sequenceNumEntity.getPrefix() + str); MmPredictModelEntity mmPredictModel = mmPredictItemDto.getMmPredictModel(); SequenceNumEntity preMdlSequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.PRE_MDL.toString()); MmSequenceNumEntity preMdlSequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.PRE_MDL.toString()); String preMdlStr = String.format("%04d", preMdlSequenceNumEntity.getSequenceNum()); mmPredictModel.setModelno(preMdlSequenceNumEntity.getPrefix() + preMdlStr); mmPredictModel.setItemid(predictItem.getId()); @@ -107,7 +107,7 @@ }); mmModelParamService.saveList(mmModelParamList); } else if (itemType != null && ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { SequenceNumEntity sequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.IC.toString()); MmSequenceNumEntity sequenceNumEntity = sequenceNumService.getAndIncreaseByCode(ItemIncreaseCodeEnum.IC.toString()); String str = String.format("%010d", sequenceNumEntity.getSequenceNum()); predictItem.setItemno(sequenceNumEntity.getPrefix() + str); iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmResultTableServiceImpl.java
@@ -37,7 +37,7 @@ @Override public List<MmResultTableEntity> list(Map<String, Object> params) { return Collections.emptyList(); return mmResultTableDao.selectList(new QueryWrapper<>()); } @Override iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmSequenceNumServiceImpl.java
对比新文件 @@ -0,0 +1,33 @@ package com.iailab.module.model.mcs.pre.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.module.model.mcs.pre.dao.MmSequenceNumDao; import com.iailab.module.model.mcs.pre.entity.MmSequenceNumEntity; import com.iailab.module.model.mcs.pre.service.MmSequenceNumService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * @author PanZhibao * @date 2021年05月06日 13:20 */ @Service public class MmSequenceNumServiceImpl extends ServiceImpl<MmSequenceNumDao, MmSequenceNumEntity> implements MmSequenceNumService { @Autowired private MmSequenceNumDao mmSequenceNumDao; @Override public synchronized MmSequenceNumEntity getAndIncreaseByCode (String code) { QueryWrapper queryWrapper = new QueryWrapper<MmSequenceNumEntity>(); queryWrapper.eq("code", code); MmSequenceNumEntity mmSequenceNumEntity = mmSequenceNumDao.selectOne(queryWrapper); MmSequenceNumEntity mmSequenceNumUpdate = new MmSequenceNumEntity(); mmSequenceNumUpdate.setId(mmSequenceNumEntity.getId()); mmSequenceNumUpdate.setSequenceNum(mmSequenceNumEntity.getSequenceNum() + 1); mmSequenceNumDao.updateById(mmSequenceNumUpdate); return mmSequenceNumEntity; } } iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/SequenceNumServiceImpl.java
文件已删除 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemRespVO.java
@@ -2,11 +2,13 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelProperty; import com.iailab.module.model.mcs.pre.entity.*; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; /** * @author PanZhibao @@ -81,5 +83,6 @@ @Schema(description = "存放表") @ExcelProperty("存放表") private String tablename; } iailab-module-model/iailab-module-model-biz/src/main/resources/application.yml
@@ -195,6 +195,7 @@ - t_mm_item_accuracy_rate - t_mm_predict_alarm_config - t_mm_predict_alarm_message - t_mm_sequence_num - t_st_schedule_scheme - t_st_schedule_model - t_st_schedule_model_param