From 5c60072c51928a5c8a0732191b1df17a88c68b99 Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期一, 23 九月 2024 08:30:42 +0800 Subject: [PATCH] pre后端修改 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java | 6 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmModelResultstrController.java | 11 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemTypeService.java | 8 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java | 17 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleService.java | 5 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictMergeItemService.java | 3 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelParamService.java | 3 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictModelService.java | 3 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemTypeImpl.java | 55 ++-- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java | 21 - iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelResultstrService.java | 5 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java | 18 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmResultTableService.java | 8 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictModelServiceImpl.java | 23 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java | 25 ++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelArithSettingsService.java | 3 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelParamServiceImpl.java | 16 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictMergeItemServiceImpl.java | 16 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemPageReqVO.java | 2 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dto/MmPredictItemDTO.java | 31 ++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelArithSettingsServiceImpl.java | 16 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java | 5 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java | 32 +- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmResultTableServiceImpl.java | 51 ++-- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/SequenceNumService.java | 3 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelResultstrServiceImpl.java | 22 + iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java | 26 +- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java | 55 ++-- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictItemDao.java | 17 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java | 31 +- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/SequenceNumServiceImpl.java | 10 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java | 94 +++---- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleItemService.java | 3 33 files changed, 381 insertions(+), 263 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java index 9082921..8be5627 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/DmModuleController.java @@ -1,5 +1,6 @@ package com.iailab.module.model.mcs.pre.controller.admin; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.iailab.framework.common.exception.ErrorCode; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; @@ -58,7 +59,7 @@ @GetMapping("/get/{id}") @PreAuthorize("@ss.hasPermission('model:pre-module:query')") public CommonResult<DmModuleEntity> info(@PathVariable("id") String id){ - DmModuleEntity info = dmModuleService.selectById(id); + DmModuleEntity info = dmModuleService.info(id); return success(info); } @@ -68,6 +69,7 @@ */ @PostMapping("/create") @PreAuthorize("@ss.hasPermission('model:pre-module:create')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> save(@RequestBody DmModuleEntity module){ int count = dmModuleService.check(module); if (count > 0) { @@ -83,6 +85,7 @@ */ @PutMapping("/update") @PreAuthorize("@ss.hasPermission('model:pre-module:update')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> update(@RequestBody DmModuleEntity module){ dmModuleService.update(module); return success(true); @@ -93,6 +96,7 @@ */ @DeleteMapping("/delete") @PreAuthorize("@ss.hasPermission('model:pre-module:delete')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> delete(@RequestParam("id") String id){ dmModuleService.deleteBatch(new String[]{id}); return success(true); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java index 1cd0229..b2674ae 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmItemTypeController.java @@ -1,8 +1,10 @@ package com.iailab.module.model.mcs.pre.controller.admin; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; 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; @@ -11,6 +13,9 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; import static com.iailab.framework.common.pojo.CommonResult.error; import static com.iailab.framework.common.pojo.CommonResult.success; @@ -37,13 +42,21 @@ return success(BeanUtils.toBean(page, MmItemTypeRespVO.class)); } + @GetMapping("/list") + @PreAuthorize("@ss.hasPermission('model:pre-item:query')") + public CommonResult<List<MmItemTypeEntity>> list(@RequestParam Map<String, Object> params) { + List<MmItemTypeEntity> list = mmItemTypeService.list(params); + + return success(list); + } + /** * 预测项类型信息 */ @GetMapping("/get/{id}") @PreAuthorize("@ss.hasPermission('model:pre-item:query')") public CommonResult<MmItemTypeEntity> info(@PathVariable("id") String id) { - MmItemTypeEntity itemType = mmItemTypeService.selectById(id); + MmItemTypeEntity itemType = mmItemTypeService.info(id); return success(itemType); } @@ -53,6 +66,7 @@ */ @PostMapping("/create") @PreAuthorize("@ss.hasPermission('model:pre-item:create')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> save(@RequestBody MmItemTypeEntity itemType) { int count = mmItemTypeService.check(itemType); if (count > 0) { @@ -67,6 +81,7 @@ */ @PutMapping("/update") @PreAuthorize("@ss.hasPermission('model:pre-item:update')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> update(@RequestBody MmItemTypeEntity itemType) { int count = mmItemTypeService.check(itemType); if (count > 0) { @@ -81,6 +96,7 @@ */ @DeleteMapping("/delete") @PreAuthorize("@ss.hasPermission('model:pre-item:delete')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> delete(@RequestParam("id") String id) { mmItemTypeService.deleteBatch(new String[]{id}); return success(true); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmModelResultstrController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmModelResultstrController.java index 3e9ee20..9dcf9dd 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmModelResultstrController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmModelResultstrController.java @@ -3,16 +3,20 @@ import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity; import com.iailab.module.model.mcs.pre.entity.MmModelResultstrEntity; import com.iailab.module.model.mcs.pre.service.MmModelResultstrService; import com.iailab.module.model.mcs.pre.vo.MmModelResultstrPageReqVO; import com.iailab.module.model.mcs.pre.vo.MmModelResultstrRespVO; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.List; import java.util.Map; import static com.iailab.framework.common.pojo.CommonResult.success; @@ -37,4 +41,11 @@ return success(BeanUtils.toBean(page, MmModelResultstrRespVO.class)); } + + @GetMapping("/list") + public CommonResult<List<MmModelResultstrEntity>> list(@RequestParam Map<String, Object> params) { + List<MmModelResultstrEntity> list = mmModelResultstrService.list(params); + + return success(list); + } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java index b7a1575..c84413b 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmPredictItemController.java @@ -1,19 +1,23 @@ package com.iailab.module.model.mcs.pre.controller.admin; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.iailab.framework.common.pojo.CommonResult; 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.MmPredictItemEntity; import com.iailab.module.model.mcs.pre.service.MmPredictItemService; -import com.iailab.module.model.mcs.pre.vo.CountItemtypeVO; -import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; +import com.iailab.module.model.mcs.pre.vo.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.UUID; import static com.iailab.framework.common.pojo.CommonResult.error; import static com.iailab.framework.common.pojo.CommonResult.success; @@ -34,9 +38,9 @@ */ @GetMapping("/page") @PreAuthorize("@ss.hasPermission('model:pre-predict:query')") - public CommonResult<PageResult<MmPredictItemRespVO>> page(@RequestParam Map<String, Object> params) { - PageResult<MmPredictItemRespVO> page = mmPredictItemService.getPageList(params); - return success(page); + public CommonResult<PageResult<MmPredictItemRespVO>> page(@Validated MmPredictItemPageReqVO reqVO) { + PageResult<MmPredictItemEntity> page = mmPredictItemService.queryPage(reqVO); + return success(BeanUtils.toBean(page, MmPredictItemRespVO.class)); } /** @@ -44,8 +48,8 @@ */ @GetMapping("/get/{id}") @PreAuthorize("@ss.hasPermission('model:pre-predict:query')") - public CommonResult<MmPredictItemDTO> info(@PathVariable("id") String id, @RequestParam Map<String, Object> params){ - MmPredictItemDTO predictItem = mmPredictItemService.getDetailById(id, params); + public CommonResult<MmPredictItemDTO> info(@PathVariable("id") String id){ + MmPredictItemDTO predictItem = mmPredictItemService.info(id); return success(predictItem); } @@ -54,12 +58,11 @@ */ @PostMapping("/create") @PreAuthorize("@ss.hasPermission('model:pre-predict:create')") - public CommonResult<Boolean> save(@RequestBody MmPredictItemDTO mmPredictItemDto){ - int count = mmPredictItemService.check(mmPredictItemDto.getMmPredictItem()); - if (count > 0) { - return error(999, "名称或编号重复"); - } - mmPredictItemService.savePredictItem(mmPredictItemDto); + @DSTransactional(rollbackFor= Exception.class) + public CommonResult<Boolean> save(@RequestBody MmPredictItemEntity mmPredictItemEntity){ + String id = UUID.randomUUID().toString(); + mmPredictItemEntity.setId(id); + mmPredictItemService.add(mmPredictItemEntity); return success(true); } @@ -68,12 +71,9 @@ */ @PutMapping("/update") @PreAuthorize("@ss.hasPermission('model:pre-predict:update')") - public CommonResult<Boolean> update(@RequestBody MmPredictItemDTO mmPredictItemDto){ - int count = mmPredictItemService.check(mmPredictItemDto.getMmPredictItem()); - if (count > 0) { - return error(999, "名称或编号重复"); - } - mmPredictItemService.update(mmPredictItemDto); + @DSTransactional(rollbackFor= Exception.class) + public CommonResult<Boolean> update(@RequestBody MmPredictItemEntity mmPredictItemEntity){ + mmPredictItemService.update(mmPredictItemEntity); return success(true); } @@ -82,6 +82,7 @@ */ @DeleteMapping("/delete") @PreAuthorize("@ss.hasPermission('model:pre-predict:delete')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> delete(@RequestParam("id") String id) { mmPredictItemService.deleteBatch(new String[]{id}); return success(true); @@ -96,14 +97,14 @@ return success(list); } - /** - * 数量 - */ - @GetMapping("/count") - public CommonResult<Long> count() { - Long count = mmPredictItemService.count(); - return success(count); - } +// /** +// * 数量 +// */ +// @GetMapping("/count") +// public CommonResult<Long> count() { +// Long count = mmPredictItemService.count(); +// return success(count); +// } /** * 上传模型 diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java index 8ff66ab..a8a0efd 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/controller/admin/MmResultTableController.java @@ -1,16 +1,24 @@ package com.iailab.module.model.mcs.pre.controller.admin; +import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; import com.iailab.module.model.mcs.pre.entity.MmResultTableEntity; import com.iailab.module.model.mcs.pre.service.MmResultTableService; import com.iailab.module.model.mcs.pre.vo.MmItemTypeRespVO; import com.iailab.module.model.mcs.pre.vo.MmResultTablePageReqVO; +import com.iailab.module.model.mcs.pre.vo.MmResultTableRespVO; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; +import java.util.Map; import static com.iailab.framework.common.pojo.CommonResult.error; import static com.iailab.framework.common.pojo.CommonResult.success; @@ -31,16 +39,24 @@ */ @GetMapping("/page") @PreAuthorize("@ss.hasPermission('model:pre-result:query')") - public CommonResult<PageResult<MmItemTypeRespVO>> page(@Validated MmResultTablePageReqVO reqVO) { + public CommonResult<PageResult<MmResultTableRespVO>> page(@Validated MmResultTablePageReqVO reqVO) { PageResult<MmResultTableEntity> page = mmResultTableService.page(reqVO); - return success(BeanUtils.toBean(page, MmItemTypeRespVO.class)); + return success(BeanUtils.toBean(page, MmResultTableRespVO.class)); + } + + + @GetMapping("/list") + @PreAuthorize("@ss.hasPermission('model:pre-result:query')") + public CommonResult<List<MmResultTableEntity>> list(@Valid @RequestParam Map<String, Object> params) { + List<MmResultTableEntity> list = mmResultTableService.list(params); + return success(list); } @GetMapping("/get/{id}") @PreAuthorize("@ss.hasPermission('model:pre-result:query')") public CommonResult<MmResultTableEntity> info(@PathVariable("id") String id){ - MmResultTableEntity resultTable = mmResultTableService.selectById(id); + MmResultTableEntity resultTable = mmResultTableService.info(id); return success(resultTable); } @@ -50,6 +66,7 @@ */ @PostMapping("/create") @PreAuthorize("@ss.hasPermission('model:pre-result:create')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> save(@RequestBody MmResultTableEntity resultTable){ int count = mmResultTableService.check(resultTable); if (count > 0) { @@ -64,6 +81,7 @@ */ @PutMapping("/update") @PreAuthorize("@ss.hasPermission('model:pre-result:update')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> update(@RequestBody MmResultTableEntity resultTable){ int count = mmResultTableService.check(resultTable); if (count > 0) { @@ -78,6 +96,7 @@ */ @DeleteMapping("/delete") @PreAuthorize("@ss.hasPermission('model:pre-result:delete')") + @DSTransactional(rollbackFor= Exception.class) public CommonResult<Boolean> delete(@RequestParam("id") String id) { mmResultTableService.deleteBatch(new String[]{id}); return success(true); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictItemDao.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictItemDao.java index bc049ff..b472ede 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictItemDao.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dao/MmPredictItemDao.java @@ -7,6 +7,8 @@ import com.iailab.framework.tenant.core.db.dynamic.TenantDS; import com.iailab.module.model.mcs.pre.entity.MmPredictItemEntity; import com.iailab.module.model.mcs.pre.entity.MmPredictItemEntity; +import com.iailab.module.model.mcs.pre.entity.MmPredictItemEntity; +import com.iailab.module.model.mcs.pre.vo.DmModulePageReqVO; 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; @@ -25,17 +27,16 @@ @Mapper public interface MmPredictItemDao extends BaseMapperX<MmPredictItemEntity> { - /** - * 查询列表 - * - * @param params - * @return - */ - IPage<MmPredictItemRespVO> getPageList(IPage<MmPredictItemEntity> page, @Param("params") Map<String, Object> params); - List<ItemVO> getByModuleId(Map<String, Object> params); List<ItemVO> getItem(Map<String, Object> params); List<MergeItemVO> getMergeItemByItemId(Map<String, Object> params); + + default PageResult<MmPredictItemEntity> selectPage(MmPredictItemPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX<MmPredictItemEntity>() + .likeIfPresent(MmPredictItemEntity::getItemno, reqVO.getItemno()) + .likeIfPresent(MmPredictItemEntity::getItemname, reqVO.getItemname()) + .orderByDesc(MmPredictItemEntity::getCreateTime)); + } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dto/MmPredictItemDTO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dto/MmPredictItemDTO.java index 221c13a..ec5f99f 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dto/MmPredictItemDTO.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/dto/MmPredictItemDTO.java @@ -3,7 +3,10 @@ import com.iailab.module.model.mcs.pre.entity.*; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; import java.util.List; /** @@ -14,6 +17,34 @@ public class MmPredictItemDTO implements Serializable { private static final long serialVersionUID = 1L; + private String id; + + private String itemno; + + private String itemname; + + private String caltypeid; + + private String itemtypeid; + + private BigDecimal predictlength; + + private BigDecimal granularity; + + private BigDecimal status; + + private BigDecimal isfuse; + + private BigDecimal predictphase; + + private BigDecimal workchecked; + + private BigDecimal unittransfactor; + + private Date createTime; + + private Date updateTime; + private MmPredictItemEntity mmPredictItem; private DmModuleItemEntity dmModuleItem; diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleItemService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleItemService.java index 9c486ee..d90da47 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleItemService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleItemService.java @@ -1,13 +1,12 @@ package com.iailab.module.model.mcs.pre.service; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.DmModuleItemEntity; /** * @author PanZhibao * @date 2021年04月27日 9:11 */ -public interface DmModuleItemService extends BaseService<DmModuleItemEntity> { +public interface DmModuleItemService{ void saveModuleItem(DmModuleItemEntity moduleItem); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleService.java index 80dbfbf..2f02af2 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/DmModuleService.java @@ -1,7 +1,6 @@ package com.iailab.module.model.mcs.pre.service; import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; import com.iailab.module.model.mcs.pre.vo.DmModulePageReqVO; @@ -12,7 +11,7 @@ * @author PanZhibao * @date 2021年04月23日 8:35 */ -public interface DmModuleService extends BaseService<DmModuleEntity> { +public interface DmModuleService{ void saveModule(DmModuleEntity module); @@ -28,5 +27,5 @@ List<DmModuleEntity> getModuleByModuleType(String moduletype); - DmModuleEntity get(String id); + DmModuleEntity info(String id); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java index d6ed981..9904df2 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemOutputService.java @@ -1,8 +1,7 @@ package com.iailab.module.model.mcs.pre.service; -import com.iailab.framework.common.service.BaseService; -import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO; +import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mdk.vo.MmItemOutputVO; import java.util.List; @@ -12,7 +11,7 @@ * @author PanZhibao * @date 2021年04月27日 9:13 */ -public interface MmItemOutputService extends BaseService<MmItemOutputEntity> { +public interface MmItemOutputService{ void saveMmItemOutput(MmItemOutputEntity mmItemOutput); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemTypeService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemTypeService.java index ec6c900..5729be1 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemTypeService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmItemTypeService.java @@ -1,17 +1,17 @@ package com.iailab.module.model.mcs.pre.service; import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.MmItemTypeEntity; import com.iailab.module.model.mcs.pre.vo.MmItemTypePageReqVO; +import java.util.List; import java.util.Map; /** * @author PanZhibao * @date 2021年04月23日 15:27 */ -public interface MmItemTypeService extends BaseService<MmItemTypeEntity> { +public interface MmItemTypeService{ void saveItemType(MmItemTypeEntity module); @@ -24,4 +24,8 @@ PageResult<MmItemTypeEntity> page(MmItemTypePageReqVO reqVO); MmItemTypeEntity getItemTypeByItemId(String itemId); + + MmItemTypeEntity info(String id); + + List<MmItemTypeEntity> list(Map<String, Object> params); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelArithSettingsService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelArithSettingsService.java index ea9734b..e26bfe7 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelArithSettingsService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelArithSettingsService.java @@ -1,6 +1,5 @@ package com.iailab.module.model.mcs.pre.service; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.MmModelArithSettingsEntity; import java.util.List; @@ -9,7 +8,7 @@ * @author PanZhibao * @date 2021年04月27日 9:06 */ -public interface MmModelArithSettingsService extends BaseService<MmModelArithSettingsEntity> { +public interface MmModelArithSettingsService{ void saveList(List<MmModelArithSettingsEntity> list); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelParamService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelParamService.java index 5a2fb5d..1d48162 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelParamService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelParamService.java @@ -1,6 +1,5 @@ package com.iailab.module.model.mcs.pre.service; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.MmModelParamEntity; import java.util.List; @@ -9,7 +8,7 @@ * @author PanZhibao * @date 2021年04月27日 9:09 */ -public interface MmModelParamService extends BaseService<MmModelParamEntity> { +public interface MmModelParamService{ void saveList(List<MmModelParamEntity> list); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelResultstrService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelResultstrService.java index 9207065..c5f3963 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelResultstrService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmModelResultstrService.java @@ -6,15 +6,18 @@ import com.iailab.module.model.mcs.pre.entity.MmModelResultstrEntity; import com.iailab.module.model.mcs.pre.vo.MmModelResultstrPageReqVO; +import java.util.List; import java.util.Map; /** * @author PanZhibao * @date 2021年05月07日 16:42 */ -public interface MmModelResultstrService extends BaseService<MmModelResultstrEntity> { +public interface MmModelResultstrService { PageResult<MmModelResultstrEntity> page(MmModelResultstrPageReqVO reqVO); MmModelResultstrEntity getInfo(String id); + + List<MmModelResultstrEntity> list(Map<String, Object> params); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java index 718600f..d77d7a9 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictItemService.java @@ -5,6 +5,7 @@ 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; @@ -18,23 +19,13 @@ * @author PanZhibao * @date 2021年04月26日 13:57 */ -public interface MmPredictItemService extends BaseService<MmPredictItemEntity> { - - void savePredictItem(MmPredictItemDTO mmPredictItemDto); - - void update(MmPredictItemDTO mmPredictItemDto); +public interface MmPredictItemService{ void deleteBatch(String[] itemIds); - MmPredictItemDTO getDetailById(String id, Map<String, Object> params); - - boolean exportItemResult(HttpServletResponse response, HttpServletRequest request, String id, Map<String, Object> params); + MmPredictItemDTO info(String id); int check(MmPredictItemEntity mmPredictItem); - - PageResult<MmPredictItemRespVO> getPageList(Map<String, Object> params); - - Long count(); List<ItemVO> getByModuleId(String moduleId); @@ -43,4 +34,10 @@ ItemVO getItemById(String itemId); MergeItemVO getMergeItemByItemId(String itemId); + + PageResult<MmPredictItemEntity> queryPage(MmPredictItemPageReqVO reqVO); + + void add(MmPredictItemEntity mmPredictItemEntity); + + void update(MmPredictItemEntity mmPredictItemEntity); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictMergeItemService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictMergeItemService.java index 0825a59..5488804 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictMergeItemService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictMergeItemService.java @@ -1,13 +1,12 @@ package com.iailab.module.model.mcs.pre.service; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.MmPredictMergeItemEntity; /** * @author PanZhibao * @date 2021年04月27日 9:00 */ -public interface MmPredictMergeItemService extends BaseService<MmPredictMergeItemEntity> { +public interface MmPredictMergeItemService{ void savePredictMergeItem(MmPredictMergeItemEntity resultTable); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictModelService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictModelService.java index a4055c0..29f3e54 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictModelService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmPredictModelService.java @@ -1,6 +1,5 @@ package com.iailab.module.model.mcs.pre.service; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.MmPredictModelEntity; import java.math.BigDecimal; @@ -11,7 +10,7 @@ * @author PanZhibao * @date 2021年04月27日 11:26 */ -public interface MmPredictModelService extends BaseService<MmPredictModelEntity> { +public interface MmPredictModelService{ void savePredictModel(MmPredictModelEntity predictModel); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmResultTableService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmResultTableService.java index 2b14706..3d93a49 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmResultTableService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/MmResultTableService.java @@ -1,17 +1,18 @@ package com.iailab.module.model.mcs.pre.service; import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.service.BaseService; import com.iailab.module.model.mcs.pre.entity.MmResultTableEntity; import com.iailab.module.model.mcs.pre.vo.MmResultTablePageReqVO; +import javax.validation.Valid; +import java.util.List; import java.util.Map; /** * @author PanZhibao * @date 2021年04月23日 16:25 */ -public interface MmResultTableService extends BaseService<MmResultTableEntity> { +public interface MmResultTableService{ void saveResultTable(MmResultTableEntity resultTable); void update(MmResultTableEntity resultTable); @@ -22,4 +23,7 @@ PageResult<MmResultTableEntity> page(MmResultTablePageReqVO reqVO); + MmResultTableEntity info(String id); + + List<MmResultTableEntity> list(@Valid Map<String, Object> params); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/SequenceNumService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/SequenceNumService.java index 3ed0fab..caa69f6 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/SequenceNumService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/SequenceNumService.java @@ -1,13 +1,12 @@ package com.iailab.module.model.mcs.pre.service; -import com.baomidou.mybatisplus.extension.service.IService; import com.iailab.module.model.mcs.pre.entity.SequenceNumEntity; /** * @author PanZhibao * @date 2021年05月06日 13:15 */ -public interface SequenceNumService extends IService<SequenceNumEntity> { +public interface SequenceNumService{ SequenceNumEntity getAndIncreaseByCode(String code); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java index 90073a4..07d21e5 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java @@ -1,10 +1,11 @@ package com.iailab.module.model.mcs.pre.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.iailab.framework.common.service.impl.BaseServiceImpl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.module.model.mcs.pre.dao.DmModuleItemDao; import com.iailab.module.model.mcs.pre.entity.DmModuleItemEntity; import com.iailab.module.model.mcs.pre.service.DmModuleItemService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -16,24 +17,26 @@ * @author PanZhibao * @date 2021年04月27日 9:20 */ -@Service("dmModuleItemService") -public class DmModuleItemServiceImpl extends BaseServiceImpl<DmModuleItemDao, DmModuleItemEntity> implements DmModuleItemService { - +@Service +public class DmModuleItemServiceImpl extends ServiceImpl<DmModuleItemDao, DmModuleItemEntity> implements DmModuleItemService { + @Autowired + private DmModuleItemDao dmModuleItemDao; + @Override @Transactional(rollbackFor = Exception.class) public void saveModuleItem(DmModuleItemEntity moduleItem) { moduleItem.setId(UUID.randomUUID().toString()); - baseDao.insert(moduleItem); + dmModuleItemDao.insert(moduleItem); } @Override @Transactional(rollbackFor = Exception.class) public void update(DmModuleItemEntity moduleItem) { - baseDao.updateById(moduleItem); + dmModuleItemDao.updateById(moduleItem); } public DmModuleItemEntity getByItemid(String itemid) { - List<DmModuleItemEntity> list = baseDao.selectList(new QueryWrapper<DmModuleItemEntity>().in("itemid", itemid)); + List<DmModuleItemEntity> list = dmModuleItemDao.selectList(new QueryWrapper<DmModuleItemEntity>().in("itemid", itemid)); if (CollectionUtils.isEmpty(list)) { return new DmModuleItemEntity(); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java index 590cdf0..027832f 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.page.PageData; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; @@ -10,33 +11,38 @@ import com.iailab.module.model.mcs.pre.service.DmModuleService; import com.iailab.module.model.mcs.pre.vo.DmModulePageReqVO; 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 javax.annotation.Resource; import java.util.*; /** * @author PanZhibao * @date 2021年04月23日 8:36 */ -@Service("dmModuleService") -public class DmModuleServiceImpl extends BaseServiceImpl<DmModuleDao, DmModuleEntity> implements DmModuleService { +@Service +public class DmModuleServiceImpl extends ServiceImpl<DmModuleDao, DmModuleEntity> implements DmModuleService { + + @Autowired + private DmModuleDao dmModuleDao; @Override public PageResult<DmModuleEntity> queryPage(DmModulePageReqVO reqVO) { - return baseDao.selectPage(reqVO); + return dmModuleDao.selectPage(reqVO); } @Override public List<DmModuleEntity> list(Map<String, Object> params) { QueryWrapper<DmModuleEntity> wrapper = getWrapper(params); wrapper.orderByDesc("CREATE_TIME"); - return baseDao.selectList(wrapper); + return dmModuleDao.selectList(wrapper); } @Override - public DmModuleEntity get(String id) { - return baseDao.selectById(id); + public DmModuleEntity info(String id) { + return dmModuleDao.selectById(id); } private QueryWrapper<DmModuleEntity> getWrapper(Map<String, Object> params) { @@ -51,7 +57,6 @@ } @Override - @Transactional(rollbackFor = Exception.class) public void saveModule(DmModuleEntity module) { module.setId(UUID.randomUUID().toString()); Calendar calendar = Calendar.getInstance(); @@ -60,20 +65,18 @@ module.setPredicttime(calendar.getTime()); module.setCollecttime(calendar.getTime()); module.setUpdateTime(new Date()); - baseDao.insert(module); + dmModuleDao.insert(module); } @Override - @Transactional(rollbackFor = Exception.class) public void update(DmModuleEntity module) { module.setUpdateTime(new Date()); - baseDao.updateById(module); + dmModuleDao.updateById(module); } @Override - @Transactional(rollbackFor = Exception.class) public void deleteBatch(String[] moduleIds) { - baseDao.deleteBatchIds(Arrays.asList(moduleIds)); + dmModuleDao.deleteBatchIds(Arrays.asList(moduleIds)); } @Override @@ -81,7 +84,7 @@ Map<String, Object> params = new HashMap<>(1); params.put("moduletype", moduletype); QueryWrapper<DmModuleEntity> wrapper = getWrapper(params); - return baseDao.selectList(wrapper); + return dmModuleDao.selectList(wrapper); } @@ -93,7 +96,7 @@ moduleWrapper.ne(StringUtils.isNotBlank(id), "id", id); moduleWrapper.and(wrapper -> wrapper.eq("modulename", modulename)); - List<DmModuleEntity> list = baseDao.selectList(moduleWrapper); + List<DmModuleEntity> list = dmModuleDao.selectList(moduleWrapper); return list.size(); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java index 4868760..9310d7a 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java @@ -1,12 +1,13 @@ package com.iailab.module.model.mcs.pre.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.iailab.framework.common.service.impl.BaseServiceImpl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.module.model.mcs.pre.dao.MmItemOutputDao; +import com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO; import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mcs.pre.service.MmItemOutputService; -import com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO; import com.iailab.module.model.mdk.vo.MmItemOutputVO; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -19,33 +20,36 @@ * @author PanZhibao * @date 2021年04月27日 9:22 */ -@Service("mmItemOutputService") -public class MmItemOutputServiceImpl extends BaseServiceImpl<MmItemOutputDao, MmItemOutputEntity> implements MmItemOutputService { +@Service +public class MmItemOutputServiceImpl extends ServiceImpl<MmItemOutputDao, MmItemOutputEntity> implements MmItemOutputService { + @Autowired + private MmItemOutputDao mmItemOutputDao; + @Override @Transactional(rollbackFor = Exception.class) public void saveMmItemOutput(MmItemOutputEntity mmItemOutput) { mmItemOutput.setId(UUID.randomUUID().toString()); - baseDao.insert(mmItemOutput); + mmItemOutputDao.insert(mmItemOutput); } @Override @Transactional(rollbackFor = Exception.class) public void update(MmItemOutputEntity mmItemOutput) { - this.updateById(mmItemOutput); + mmItemOutputDao.updateById(mmItemOutput); } public void deleteBatch(String[] itemIds) { - QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<MmItemOutputEntity>(); + QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper(); queryWrapper.in("itemid", itemIds); - baseDao.delete(queryWrapper); + mmItemOutputDao.delete(queryWrapper); } @Override public MmItemOutputEntity getByItemid(String itemid) { - QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<MmItemOutputEntity>(); + QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper(); queryWrapper.eq("itemid", itemid); - List<MmItemOutputEntity> list = baseDao.selectList(queryWrapper); + List<MmItemOutputEntity> list = mmItemOutputDao.selectList(queryWrapper); if (CollectionUtils.isEmpty(list)) { return new MmItemOutputEntity(); } @@ -54,12 +58,12 @@ @Override public List<MmItemOutputDTO> queryList(Map<String, Object> params) { - return baseDao.queryList(params); + return mmItemOutputDao.queryList(params); } @Override public MmItemOutputVO getOutPutById(String outputid) { - List<MmItemOutputVO> list = baseDao.getOutPutById(outputid); + List<MmItemOutputVO> list = mmItemOutputDao.getOutPutById(outputid); if (CollectionUtils.isEmpty(list)) { return null; } @@ -68,11 +72,11 @@ @Override public List<MmItemOutputVO> getOutPutByItemId(String itemid) { - return baseDao.getOutPutByItemId(itemid); + return mmItemOutputDao.getOutPutByItemId(itemid); } @Override public List<MmItemOutputVO> getOutPutByPointId(String pointid) { - return baseDao.getOutPutByPointId(pointid); + return mmItemOutputDao.getOutPutByPointId(pointid); } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java index 0465a2d..51c9c47 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemResultServiceImpl.java @@ -2,13 +2,10 @@ import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.iailab.framework.common.service.impl.BaseServiceImpl; -import com.iailab.module.data.api.point.dto.ApiPointDTO; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.module.model.mcs.pre.dao.MmItemResultDao; -import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; import com.iailab.module.model.mcs.pre.entity.MmItemResultEntity; import com.iailab.module.model.mcs.pre.entity.MmItemResultJsonEntity; -import com.iailab.module.model.mcs.pre.service.MmItemOutputService; import com.iailab.module.model.mcs.pre.service.MmItemResultService; import com.iailab.module.model.mdk.vo.DataValueVO; import org.springframework.beans.factory.annotation.Autowired; @@ -25,17 +22,16 @@ * @author PanZhibao * @date 2021年05月28日 10:34 */ -@Service("mmItemResultService") -public class MmItemResultServiceImpl extends BaseServiceImpl<MmItemResultDao, MmItemResultEntity> - implements MmItemResultService { +@Service +public class MmItemResultServiceImpl extends ServiceImpl<MmItemResultDao, MmItemResultEntity> implements MmItemResultService { private final int max_group_count = 100; private final String T_MM_ITEM_RESULT = "T_MM_ITEM_RESULT"; @Autowired - private MmItemOutputService mmItemOutputService; - + private MmItemResultDao mmItemResultDao; + @Override public List<MmItemResultEntity> getListByOutputId(String outputid, Map<String, Object> params) { @@ -53,7 +49,7 @@ e.printStackTrace(); } - List<MmItemResultEntity> list = baseDao.selectList( + List<MmItemResultEntity> list = mmItemResultDao.selectList( new QueryWrapper<MmItemResultEntity>() .eq("outputid", outputid) .between("datatime", startDateParam, endDateParam) @@ -107,7 +103,7 @@ Map<String, Object> map4 = new HashMap(2); map4.put("TABLENAME", "T_MM_ITEM_RESULT_JSON"); map4.put("entity", resultJson); - baseDao.savePredictJsonValue(map4); + mmItemResultDao.savePredictJsonValue(map4); } Map<String, Object> params = new HashMap(4); @@ -115,7 +111,7 @@ params.put("OUTPUTID", importList.get(0).getOutputid()); params.put("STARTTIME", importList.get(0).getDatatime()); params.put("ENDTIME", importList.get(importList.size() - 1).getDatatime()); - baseDao.deletePredictValue(params); + mmItemResultDao.deletePredictValue(params); int num1 = importList.size() / max_group_count; int num2 = importList.size() % max_group_count; @@ -139,13 +135,13 @@ Map<String, Object> map2 = new HashMap<>(2); map2.put("TABLENAME", T_MM_ITEM_RESULT); map2.put("list", tempList); - baseDao.savePredictValue(map2); + mmItemResultDao.savePredictValue(map2); } Map<String, Object> map3 = new HashMap<>(2); map3.put("TABLENAME", "T_MM_ITEM_RESULT_LAST_POINT"); map3.put("list", lastList); - baseDao.savePredictValue(map3); + mmItemResultDao.savePredictValue(map3); } @Override @@ -155,7 +151,7 @@ .eq("outputid", outputid) .between("datatime", startTime, endTime) .orderByAsc("datatime"); - List<MmItemResultEntity> list = baseDao.selectList(queryWrapper); + List<MmItemResultEntity> list = mmItemResultDao.selectList(queryWrapper); if (CollectionUtils.isEmpty(list)) { return result; } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemTypeImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemTypeImpl.java index 17344d5..5258d78 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemTypeImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemTypeImpl.java @@ -1,6 +1,7 @@ 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; import com.iailab.framework.common.util.collection.CollectionUtils; @@ -9,76 +10,70 @@ import com.iailab.module.model.mcs.pre.service.MmItemTypeService; import com.iailab.module.model.mcs.pre.vo.MmItemTypePageReqVO; 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 java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; /** * @author PanZhibao * @date 2021年04月23日 15:29 */ -@Service("mmItemTypeService") -public class MmItemTypeImpl extends BaseServiceImpl<MmItemTypeDao, MmItemTypeEntity> implements MmItemTypeService { +@Service +public class MmItemTypeImpl extends ServiceImpl<MmItemTypeDao, MmItemTypeEntity> implements MmItemTypeService { + @Autowired + private MmItemTypeDao mmItemTypeDao; + @Override public PageResult<MmItemTypeEntity> page(MmItemTypePageReqVO reqVO) { - return baseDao.selectPage(reqVO); - } - - private QueryWrapper<MmItemTypeEntity> getWrapper(Map<String, Object> params) { - String itemtypename = (String)params.get("itemtypename"); - - QueryWrapper<MmItemTypeEntity> wrapper = new QueryWrapper<>(); - wrapper.like(StringUtils.isNotBlank(itemtypename),"itemtypename", itemtypename); - - return wrapper; + return mmItemTypeDao.selectPage(reqVO); } @Override - @Transactional(rollbackFor = Exception.class) public void saveItemType(MmItemTypeEntity itemType) { itemType.setId(UUID.randomUUID().toString()); - baseDao.insert(itemType); + mmItemTypeDao.insert(itemType); } @Override - @Transactional(rollbackFor = Exception.class) public void update(MmItemTypeEntity itemType) { - baseDao.updateById(itemType); + mmItemTypeDao.updateById(itemType); } @Override - @Transactional(rollbackFor = Exception.class) public void deleteBatch(String[] moduleIds) { - baseDao.deleteBatchIds(Arrays.asList(moduleIds)); + mmItemTypeDao.deleteBatchIds(Arrays.asList(moduleIds)); } @Override public int check(MmItemTypeEntity itemType) { String id = itemType.getId(); String itemtypename = itemType.getItemtypename(); - QueryWrapper<MmItemTypeEntity> moduleWrapper = new QueryWrapper<>(); + QueryWrapper<MmItemTypeEntity> moduleWrapper = new QueryWrapper(); moduleWrapper.ne(StringUtils.isNotBlank(id), "id", id); moduleWrapper.and(wrapper -> wrapper.eq("itemtypename",itemtypename)); - List<MmItemTypeEntity> list = baseDao.selectList(moduleWrapper); + List<MmItemTypeEntity> list = mmItemTypeDao.selectList(moduleWrapper); return list.size(); - } - - public MmItemTypeEntity getById(String itemtypeid) { - MmItemTypeEntity entity = baseDao.selectById(itemtypeid); - return entity; } @Override public MmItemTypeEntity getItemTypeByItemId(String itemId) { - List<MmItemTypeEntity> list = baseDao.getItemTypeByItemId(itemId); + List<MmItemTypeEntity> list = mmItemTypeDao.getItemTypeByItemId(itemId); if (CollectionUtils.isAnyEmpty(list)) { return null; } return list.get(0); } + + @Override + public MmItemTypeEntity info(String id) { + return mmItemTypeDao.selectById(id); + } + + @Override + public List<MmItemTypeEntity> list(Map<String, Object> params) { + return Collections.emptyList(); + } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelArithSettingsServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelArithSettingsServiceImpl.java index fff6acd..f26796c 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelArithSettingsServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelArithSettingsServiceImpl.java @@ -1,10 +1,13 @@ 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.service.impl.BaseServiceImpl; +import com.iailab.module.model.mcs.pre.dao.MmItemTypeDao; import com.iailab.module.model.mcs.pre.dao.MmModelArithSettingsDao; import com.iailab.module.model.mcs.pre.entity.MmModelArithSettingsEntity; import com.iailab.module.model.mcs.pre.service.MmModelArithSettingsService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -15,24 +18,27 @@ * @date 2021年04月27日 9:24 */ @Service -public class MmModelArithSettingsServiceImpl extends BaseServiceImpl<MmModelArithSettingsDao, MmModelArithSettingsEntity> +public class MmModelArithSettingsServiceImpl extends ServiceImpl<MmModelArithSettingsDao, MmModelArithSettingsEntity> implements MmModelArithSettingsService { + @Autowired + private MmModelArithSettingsDao mmModelArithSettingsDao; + @Override public void saveList(List<MmModelArithSettingsEntity> list) { QueryWrapper<MmModelArithSettingsEntity> queryWrapper = new QueryWrapper(); queryWrapper.eq("modelid", list.get(0).getModelid()); - baseDao.delete(queryWrapper); + mmModelArithSettingsDao.delete(queryWrapper); list.forEach(item -> { item.setId(UUID.randomUUID().toString()); }); - baseDao.insertList(list); + mmModelArithSettingsDao.insertList(list); } public List<MmModelArithSettingsEntity> getByModelid(String modelid) { Map<String, Object> params = new HashMap<>(1); params.put("modelid", modelid); - List<MmModelArithSettingsEntity> list = baseDao.getMmModelArithSettings(params); + List<MmModelArithSettingsEntity> list = mmModelArithSettingsDao.getMmModelArithSettings(params); if (CollectionUtils.isEmpty(list)) { return new ArrayList<>(); @@ -44,6 +50,6 @@ public List<MmModelArithSettingsEntity> getByModelId(String modelId) { QueryWrapper<MmModelArithSettingsEntity> queryWrapper = new QueryWrapper(); queryWrapper.eq("modelid", modelId); - return baseDao.selectList(queryWrapper); + return mmModelArithSettingsDao.selectList(queryWrapper); } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelParamServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelParamServiceImpl.java index cea16cc..4c79982 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelParamServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelParamServiceImpl.java @@ -1,10 +1,13 @@ 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.service.impl.BaseServiceImpl; +import com.iailab.module.model.mcs.pre.dao.MmModelArithSettingsDao; import com.iailab.module.model.mcs.pre.dao.MmModelParamDao; import com.iailab.module.model.mcs.pre.entity.MmModelParamEntity; import com.iailab.module.model.mcs.pre.service.MmModelParamService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -16,17 +19,20 @@ * @author PanZhibao * @date 2021年04月27日 9:25 */ -@Service("mmModelParamService") -public class MmModelParamServiceImpl extends BaseServiceImpl<MmModelParamDao, MmModelParamEntity> implements MmModelParamService { +@Service +public class MmModelParamServiceImpl extends ServiceImpl<MmModelParamDao, MmModelParamEntity> implements MmModelParamService { + @Autowired + private MmModelParamDao mmModelParamDao; + @Override public void saveList(List<MmModelParamEntity> list) { QueryWrapper<MmModelParamEntity> queryWrapper = new QueryWrapper(); queryWrapper.eq("modelid", list.get(0).getModelid()); - baseDao.delete(queryWrapper); + mmModelParamDao.delete(queryWrapper); list.forEach(item -> { item.setId(UUID.randomUUID().toString()); - baseDao.insert(item); + mmModelParamDao.insert(item); }); } @@ -36,7 +42,7 @@ queryWrapper.eq("modelid", modelid); queryWrapper.orderByAsc("MODELPARAMPORTORDER"); queryWrapper.orderByAsc("MODELPARAMORDER"); - List<MmModelParamEntity> list = baseDao.selectList(queryWrapper); + List<MmModelParamEntity> list = mmModelParamDao.selectList(queryWrapper); if (CollectionUtils.isEmpty(list)) { return new ArrayList<>(); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelResultstrServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelResultstrServiceImpl.java index 339defd..7aaf512 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelResultstrServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmModelResultstrServiceImpl.java @@ -1,29 +1,43 @@ package com.iailab.module.model.mcs.pre.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; +import com.iailab.module.model.mcs.pre.dao.MmModelParamDao; import com.iailab.module.model.mcs.pre.dao.MmModelResultstrDao; import com.iailab.module.model.mcs.pre.entity.MmModelResultstrEntity; import com.iailab.module.model.mcs.pre.service.MmModelResultstrService; import com.iailab.module.model.mcs.pre.vo.MmModelResultstrPageReqVO; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; +import java.util.Map; /** * @author PanZhibao * @date 2021年05月07日 16:43 */ -@Service("mmModelResultstrService") -public class MmModelResultstrServiceImpl extends BaseServiceImpl<MmModelResultstrDao, MmModelResultstrEntity> +@Service +public class MmModelResultstrServiceImpl extends ServiceImpl<MmModelResultstrDao, MmModelResultstrEntity> implements MmModelResultstrService { + @Autowired + private MmModelResultstrDao mmModelResultstrDao; @Override public PageResult<MmModelResultstrEntity> page(MmModelResultstrPageReqVO reqVO) { - return baseDao.selectPage(reqVO); + return mmModelResultstrDao.selectPage(reqVO); } @Override public MmModelResultstrEntity getInfo(String id) { - return baseDao.selectById(id); + return mmModelResultstrDao.selectById(id); } + + @Override + public List<MmModelResultstrEntity> list(Map<String, Object> params) { + return Collections.emptyList(); + } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java index 810f29d..0af6c44 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java @@ -1,10 +1,9 @@ package com.iailab.module.model.mcs.pre.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.iailab.framework.common.page.PageData; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.service.impl.BaseServiceImpl; +import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.model.mcs.pre.dao.MmPredictItemDao; import com.iailab.module.model.mcs.pre.dto.MmPredictItemDTO; import com.iailab.module.model.mcs.pre.entity.*; @@ -12,6 +11,7 @@ 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.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; @@ -23,15 +23,14 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.text.SimpleDateFormat; import java.util.*; /** * @author PanZhibao * @date 2021年04月26日 14:03 */ -@Service("mmPredictItemService") -public class MmPredictItemServiceImpl extends BaseServiceImpl<MmPredictItemDao, MmPredictItemEntity> implements MmPredictItemService { +@Service +public class MmPredictItemServiceImpl extends ServiceImpl<MmPredictItemDao, MmPredictItemEntity> implements MmPredictItemService { @Autowired private DmModuleItemServiceImpl dmModuleItemService; @@ -57,25 +56,25 @@ @Autowired private SequenceNumService sequenceNumService; - @Override - public PageResult<MmPredictItemRespVO> getPageList(Map<String, Object> params) { - PageResult<MmPredictItemRespVO> result = new PageResult(); - IPage<MmPredictItemRespVO> page = baseDao.getPageList( - getPage(params, "CREATE_TIME", false), - params - ); - result.setList(page.getRecords()); - result.setTotal(page.getTotal()); - return result; - } + @Autowired + private MmPredictItemDao mmPredictItemDao; - private QueryWrapper<MmPredictItemEntity> getWrapper(Map<String, Object> params) { - QueryWrapper<MmPredictItemEntity> wrapper = new QueryWrapper<>(); - return wrapper; + @Override + public PageResult<MmPredictItemEntity> queryPage(MmPredictItemPageReqVO reqVO) { + return mmPredictItemDao.selectPage(reqVO); } @Override - @Transactional(rollbackFor = Exception.class) + public void add(MmPredictItemEntity mmPredictItemEntity) { + mmPredictItemDao.insert(mmPredictItemEntity); + } + + @Override + public void update(MmPredictItemEntity mmPredictItemEntity) { + mmPredictItemDao.updateById(mmPredictItemEntity); + } + + /* public void savePredictItem(MmPredictItemDTO mmPredictItemDto) { MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem(); predictItem.setId(UUID.randomUUID().toString()); @@ -115,7 +114,7 @@ mMmPredictMergeItem.setItemid(predictItem.getId()); mmPredictMergeItemService.savePredictMergeItem(mMmPredictMergeItem); } - insert(predictItem); + mmPredictItemDao.insert(predictItem); DmModuleItemEntity dmModuleItem = mmPredictItemDto.getDmModuleItem(); dmModuleItem.setItemid(predictItem.getId()); dmModuleItemService.saveModuleItem(dmModuleItem); @@ -123,10 +122,9 @@ MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput(); mmItemOutput.setItemid(predictItem.getId()); mmItemOutputService.saveMmItemOutput(mmItemOutput); - } - + }*/ +/* @Override - @Transactional(rollbackFor = Exception.class) public void update(MmPredictItemDTO mmPredictItemDto) { MmPredictItemEntity predictItem = mmPredictItemDto.getMmPredictItem(); predictItem.setUpdateTime(new Date()); @@ -156,21 +154,27 @@ MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput(); mmItemOutputService.update(mmItemOutput); - } - + }*/ @Override - @Transactional(rollbackFor = Exception.class) public void deleteBatch(String[] itemIds) { - deleteBatchIds(Arrays.asList(itemIds)); + mmPredictItemDao.deleteBatchIds(Arrays.asList(itemIds)); mmPredictMergeItemService.deleteBatch(itemIds); mmPredictModelService.deleteBatch(itemIds); mmItemOutputService.deleteBatch(itemIds); } @Override - public MmPredictItemDTO getDetailById(String id, Map<String, Object> params) { - MmPredictItemDTO mmPredictItemDto = new MmPredictItemDTO(); - MmPredictItemEntity predictItem = selectById(id); + 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)); @@ -183,17 +187,9 @@ } else if (ItemTypeEnum.MERGE_ITEM.getName().equals(itemType.getItemtypename())) { mmPredictItemDto.setMmPredictMergeItem(mmPredictMergeItemService.getByItemid(id)); } - return mmPredictItemDto; } - - @Override - public boolean exportItemResult(HttpServletResponse response, HttpServletRequest request, String id, Map<String, Object> params) { - //MmPredictItemDTO mmPredictItemDto = this.getPredictValuesById(id, params); - //List<MmItemResultEntity> itemResultList = mmPredictItemDto.getMmItemResultList(); - - return true; - } +*/ @Override public int check(MmPredictItemEntity mmPredictItem) { @@ -203,21 +199,15 @@ QueryWrapper<MmPredictItemEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.ne(StringUtils.isNotBlank(id), "id", id); queryWrapper.and(wrapper -> wrapper.eq("itemname", itemname).or().eq("itemno", itemno)); - List<MmPredictItemEntity> list = baseDao.selectList(queryWrapper); + List<MmPredictItemEntity> list = mmPredictItemDao.selectList(queryWrapper); return list.size(); - } - - @Override - public Long count() { - QueryWrapper<MmPredictItemEntity> queryWrapper = new QueryWrapper<>(); - return baseDao.selectCount(queryWrapper); } @Override public List<ItemVO> getByModuleId(String moduleId) { Map<String, Object> params = new HashMap<>(); - return baseDao.getByModuleId(params); + return mmPredictItemDao.getByModuleId(params); } @Override @@ -227,7 +217,7 @@ } Map<String, Object> params = new HashMap(1); params.put("ITEMNO", itemNo); - List<ItemVO> list = baseDao.getItem(params); + List<ItemVO> list = mmPredictItemDao.getItem(params); if (CollectionUtils.isEmpty(list)) { return null; } @@ -241,7 +231,7 @@ } Map<String, Object> params = new HashMap(1); params.put("ITEMID", itemId); - List<ItemVO> list = baseDao.getItem(params); + List<ItemVO> list = mmPredictItemDao.getItem(params); if (CollectionUtils.isEmpty(list)) { return null; } @@ -255,7 +245,7 @@ } Map<String, Object> params = new HashMap(1); params.put("ITEMID", itemId); - List<MergeItemVO> list = baseDao.getMergeItemByItemId(params); + List<MergeItemVO> list = mmPredictItemDao.getMergeItemByItemId(params); if (CollectionUtils.isEmpty(list)) { return null; } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictMergeItemServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictMergeItemServiceImpl.java index 8e03ef2..f4da186 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictMergeItemServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictMergeItemServiceImpl.java @@ -1,10 +1,13 @@ 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.service.impl.BaseServiceImpl; +import com.iailab.module.model.mcs.pre.dao.DmModuleItemDao; import com.iailab.module.model.mcs.pre.dao.MmPredictMergeItemDao; import com.iailab.module.model.mcs.pre.entity.MmPredictMergeItemEntity; import com.iailab.module.model.mcs.pre.service.MmPredictMergeItemService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -15,13 +18,16 @@ * @author PanZhibao * @date 2021年04月27日 9:27 */ -@Service("mmPredictMergeItemService") -public class MmPredictMergeItemServiceImpl extends BaseServiceImpl<MmPredictMergeItemDao, MmPredictMergeItemEntity> implements MmPredictMergeItemService { +@Service +public class MmPredictMergeItemServiceImpl extends ServiceImpl<MmPredictMergeItemDao, MmPredictMergeItemEntity> implements MmPredictMergeItemService { + @Autowired + private MmPredictMergeItemDao mmPredictMergeItemDao; + @Override public void savePredictMergeItem(MmPredictMergeItemEntity predictMergeItem) { predictMergeItem.setId(UUID.randomUUID().toString()); - baseDao.insert(predictMergeItem); + mmPredictMergeItemDao.insert(predictMergeItem); } @Override @@ -32,13 +38,13 @@ public void deleteBatch(String[] itemIds) { QueryWrapper queryWrapper = new QueryWrapper<MmPredictMergeItemEntity>(); queryWrapper.in("itemid", itemIds); - baseDao.delete(queryWrapper); + mmPredictMergeItemDao.delete(queryWrapper); } public MmPredictMergeItemEntity getByItemid(String itemid) { QueryWrapper queryWrapper = new QueryWrapper<MmPredictMergeItemEntity>(); queryWrapper.eq("itemid", itemid); - List<MmPredictMergeItemEntity> list = baseDao.selectList(queryWrapper); + List<MmPredictMergeItemEntity> list = mmPredictMergeItemDao.selectList(queryWrapper); if (CollectionUtils.isEmpty(list)) { return new MmPredictMergeItemEntity(); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictModelServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictModelServiceImpl.java index eb61a05..2922b37 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictModelServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictModelServiceImpl.java @@ -1,10 +1,13 @@ 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.service.impl.BaseServiceImpl; +import com.iailab.module.model.mcs.pre.dao.MmPredictMergeItemDao; import com.iailab.module.model.mcs.pre.dao.MmPredictModelDao; import com.iailab.module.model.mcs.pre.entity.MmPredictModelEntity; import com.iailab.module.model.mcs.pre.service.MmPredictModelService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -17,13 +20,15 @@ * @author PanZhibao * @date 2021年04月27日 11:30 */ -@Service("mmPredictModelService") -public class MmPredictModelServiceImpl extends BaseServiceImpl<MmPredictModelDao, MmPredictModelEntity> implements MmPredictModelService { +@Service +public class MmPredictModelServiceImpl extends ServiceImpl<MmPredictModelDao, MmPredictModelEntity> implements MmPredictModelService { + @Autowired + private MmPredictModelDao mmPredictModelDao; @Override public void savePredictModel(MmPredictModelEntity predictModel) { predictModel.setId(UUID.randomUUID().toString()); - baseDao.insert(predictModel); + mmPredictModelDao.insert(predictModel); } @Override @@ -33,13 +38,13 @@ @Override public MmPredictModelEntity getInfo(String id) { - return baseDao.selectById(id); + return mmPredictModelDao.selectById(id); } @Override public BigDecimal getSampleLength(String id) { BigDecimal result = BigDecimal.ZERO; - List<MmPredictModelEntity> list = baseDao.getSampleLength(id); + List<MmPredictModelEntity> list = mmPredictModelDao.getSampleLength(id); if (CollectionUtils.isEmpty(list)) { return result; } @@ -51,13 +56,13 @@ public void deleteBatch(String[] itemIds) { QueryWrapper<MmPredictModelEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.in("itemid", itemIds); - baseDao.delete(queryWrapper); + mmPredictModelDao.delete(queryWrapper); } public MmPredictModelEntity getByItemid(String itemid) { QueryWrapper<MmPredictModelEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("itemid", itemid); - List<MmPredictModelEntity> list = baseDao.selectList(queryWrapper); + List<MmPredictModelEntity> list = mmPredictModelDao.selectList(queryWrapper); if (CollectionUtils.isEmpty(list)) { return new MmPredictModelEntity(); } @@ -66,11 +71,11 @@ @Override public List<MmPredictModelEntity> getNoSettingmapPredictModel(Map<String, Object> params) { - return baseDao.getNoSettingmapPredictModel(params); + return mmPredictModelDao.getNoSettingmapPredictModel(params); } @Override public List<MmPredictModelEntity> getActiveModelByItemId(String itemId) { - return baseDao.getActiveModelByItemId(itemId); + return mmPredictModelDao.getActiveModelByItemId(itemId); } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmResultTableServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmResultTableServiceImpl.java index 597002c..a3b54e7 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmResultTableServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmResultTableServiceImpl.java @@ -1,58 +1,59 @@ 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; import com.iailab.module.model.mcs.pre.dao.MmResultTableDao; import com.iailab.module.model.mcs.pre.entity.MmResultTableEntity; -import com.iailab.module.model.mcs.pre.service.MmResultTableService;; +import com.iailab.module.model.mcs.pre.service.MmResultTableService; import com.iailab.module.model.mcs.pre.vo.MmResultTablePageReqVO; 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 java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; + +; /** * @author PanZhibao * @date 2021年04月23日 16:28 */ -@Service("mmResultTableService") -public class MmResultTableServiceImpl extends BaseServiceImpl<MmResultTableDao, MmResultTableEntity> implements MmResultTableService { +@Service +public class MmResultTableServiceImpl extends ServiceImpl<MmResultTableDao, MmResultTableEntity> implements MmResultTableService { + @Autowired + private MmResultTableDao mmResultTableDao; + @Override public PageResult<MmResultTableEntity> page(MmResultTablePageReqVO reqVO) { - return baseDao.selectPage(reqVO); - } - - private QueryWrapper<MmResultTableEntity> getWrapper(Map<String, Object> params) { - String tablename = (String)params.get("tablename"); - - QueryWrapper<MmResultTableEntity> wrapper = new QueryWrapper<>(); - wrapper.like(StringUtils.isNotBlank(tablename),"tablename", tablename); - - return wrapper; + return mmResultTableDao.selectPage(reqVO); } @Override - @Transactional(rollbackFor = Exception.class) + public MmResultTableEntity info(String id) { + return mmResultTableDao.selectById(id); + } + + @Override + public List<MmResultTableEntity> list(Map<String, Object> params) { + return Collections.emptyList(); + } + + @Override public void saveResultTable(MmResultTableEntity resultTable) { resultTable.setId(UUID.randomUUID().toString()); - baseDao.insert(resultTable); + mmResultTableDao.insert(resultTable); } @Override - @Transactional(rollbackFor = Exception.class) public void update(MmResultTableEntity resultTable) { - baseDao.updateById(resultTable); + mmResultTableDao.updateById(resultTable); } @Override - @Transactional(rollbackFor = Exception.class) public void deleteBatch(String[] resultTableIds) { - baseDao.deleteBatchIds(Arrays.asList(resultTableIds)); + mmResultTableDao.deleteBatchIds(Arrays.asList(resultTableIds)); } @Override @@ -63,7 +64,7 @@ queryWrapper.ne(StringUtils.isNotBlank(id), "id", id); queryWrapper.and(wrapper -> wrapper.eq("tablename",tablename)); - List<MmResultTableEntity> list = baseDao.selectList(queryWrapper); + List<MmResultTableEntity> list = mmResultTableDao.selectList(queryWrapper); return list.size(); } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/SequenceNumServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/SequenceNumServiceImpl.java index 731ae18..958ea5a 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/SequenceNumServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/SequenceNumServiceImpl.java @@ -5,25 +5,29 @@ import com.iailab.module.model.mcs.pre.dao.SequenceNumDao; import com.iailab.module.model.mcs.pre.entity.SequenceNumEntity; import com.iailab.module.model.mcs.pre.service.SequenceNumService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * @author PanZhibao * @date 2021年05月06日 13:20 */ -@Service("sequenceNumService") +@Service public class SequenceNumServiceImpl extends ServiceImpl<SequenceNumDao, SequenceNumEntity> implements SequenceNumService { + + @Autowired + private SequenceNumDao sequenceNumDao; @Override public synchronized SequenceNumEntity getAndIncreaseByCode (String code) { QueryWrapper queryWrapper = new QueryWrapper<SequenceNumEntity>(); queryWrapper.eq("code", code); - SequenceNumEntity sequenceNumEntity = this.getOne(queryWrapper); + SequenceNumEntity sequenceNumEntity = sequenceNumDao.selectOne(queryWrapper); SequenceNumEntity sequenceNumUpdate = new SequenceNumEntity(); sequenceNumUpdate.setId(sequenceNumEntity.getId()); sequenceNumUpdate.setSequenceNum(sequenceNumEntity.getSequenceNum() + 1); - this.updateById(sequenceNumUpdate); + sequenceNumDao.updateById(sequenceNumUpdate); return sequenceNumEntity; } } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemPageReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemPageReqVO.java index b0405c9..7682105 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemPageReqVO.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictItemPageReqVO.java @@ -16,4 +16,6 @@ @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) public class MmPredictItemPageReqVO extends PageParam { + private String itemno; + private String itemname; } \ No newline at end of file -- Gitblit v1.9.3