Commit e1bdb089 by huangjy

fix:修复bug

parent 09ae7133
......@@ -2,7 +2,7 @@ package com.makeit.controller.analysis;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.makeit.common.dto.BaseNameDTO;
import com.makeit.common.dto.CommonNameDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.entity.saas.analysis.SaasModelManage;
......@@ -39,7 +39,7 @@ public class SaasModelManageController {
@Action(module = "数据分析-模型管理", name = "分页列表", code = "saas:modelManage:page")
@ApiOperation("分页列表")
@PostMapping("list")
public ApiResponseEntity<List<SaasModelManage>> list(@RequestBody BaseNameDTO dto) {
public ApiResponseEntity<List<SaasModelManage>> list(@RequestBody CommonNameDTO dto) {
return ApiResponseUtils.success(saasModelManageService.list(new QueryWrapper<SaasModelManage>().lambda()
.like(StringUtils.isNotEmpty(dto.getName()),SaasModelManage::getName,dto.getName())));
}
......
......@@ -2,13 +2,11 @@ package com.makeit.controller.analysis;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.makeit.common.dto.BaseNameDTO;
import com.makeit.common.dto.CommonNameDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.entity.saas.analysis.SaasReportManage;
import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasModelManageService;
import com.makeit.service.saas.SaasReportManageService;
import com.makeit.utils.old.StringUtils;
import io.swagger.annotations.Api;
......@@ -41,7 +39,7 @@ public class SaasReportManageController {
@Action(module = "数据分析-报告管理", name = "分页列表", code = "saas:reportManage:page")
@ApiOperation("分页列表")
@PostMapping("list")
public ApiResponseEntity<List<SaasReportManage>> list(@RequestBody BaseNameDTO dto){
public ApiResponseEntity<List<SaasReportManage>> list(@RequestBody CommonNameDTO dto){
return ApiResponseUtils.success(saasReportManageService.list(new QueryWrapper<SaasReportManage>().lambda()
.like(StringUtils.isNotEmpty(dto.getName()),SaasReportManage::getName,dto.getName())));
}
......
......@@ -13,4 +13,5 @@ import com.makeit.entity.saas.analysis.SaasModelManage;
*/
public interface SaasModelManageService extends IService<SaasModelManage> {
void updateEntity(String id, String sleep);
}
......@@ -13,4 +13,5 @@ import com.makeit.entity.saas.analysis.SaasReportManage;
*/
public interface SaasReportManageService extends IService<SaasReportManage> {
void updateEntity(String id, String sleep);
}
......@@ -6,8 +6,11 @@ import com.makeit.dto.saas.analysis.SaasDiseaseEvaluateReportDTO;
import com.makeit.entity.saas.analysis.SaasDiseaseEvaluateReport;
import com.makeit.mapper.saas.analysis.SaasDiseaseEvaluateReportMapper;
import com.makeit.service.saas.SaasDiseaseEvaluateReportService;
import com.makeit.service.saas.SaasReportManageService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* <p>
......@@ -20,6 +23,8 @@ import org.springframework.stereotype.Service;
@Service
public class SaasDiseaseEvaluateReportServiceImpl extends ServiceImpl<SaasDiseaseEvaluateReportMapper, SaasDiseaseEvaluateReport> implements SaasDiseaseEvaluateReportService {
@Autowired
private SaasReportManageService saasReportManageService;
@Override
public SaasDiseaseEvaluateReport view(String id) {
......@@ -35,10 +40,14 @@ public class SaasDiseaseEvaluateReportServiceImpl extends ServiceImpl<SaasDiseas
}
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasDiseaseEvaluateReportDTO dto) {
SaasDiseaseEvaluateReport entity = getById(dto.getId());
String result = JSON.toJSONString(dto.getResultContent());
entity.setResultContent(result);
saveOrUpdate(entity);
saasReportManageService.updateEntity(dto.getId(),"disease");
}
}
package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.dto.saas.analysis.SaasDiseaseModelDTO;
import com.makeit.entity.saas.analysis.SaasDiseaseModel;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.mapper.saas.analysis.SaasDiseaseModelMapper;
import com.makeit.service.saas.SaasDiseaseModelService;
import com.makeit.service.saas.SaasModelManageService;
import com.makeit.utils.user.common.CommonUserUtil;
import com.makeit.utils.user.common.CommonUserVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/**
* <p>
......@@ -20,6 +29,8 @@ import org.springframework.stereotype.Service;
@Service
public class SaasDiseaseModelServiceImpl extends ServiceImpl<SaasDiseaseModelMapper, SaasDiseaseModel> implements SaasDiseaseModelService {
@Autowired
private SaasModelManageService saasModelManageService;
@Override
public SaasDiseaseModel view(String id) {
......@@ -34,9 +45,12 @@ public class SaasDiseaseModelServiceImpl extends ServiceImpl<SaasDiseaseModelMap
}
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasDiseaseModelDTO dto) {
SaasDiseaseModel entity = getById(dto.getId());
BeanUtils.copyProperties(dto,entity);
saveOrUpdate(entity);
saasModelManageService.updateEntity(dto.getId(),"sleep");
}
}
......@@ -10,8 +10,11 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import com.makeit.mapper.saas.analysis.SaasElderReportConfigMapper;
import com.makeit.module.iot.vo.analysis.EvaluateReportVO;
import com.makeit.service.saas.SaasElderReportConfigService;
import com.makeit.service.saas.SaasReportManageService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -26,6 +29,8 @@ import java.util.List;
@Service
public class SaasElderReportConfigServiceImpl extends ServiceImpl<SaasElderReportConfigMapper, SaasElderReportConfig> implements SaasElderReportConfigService {
@Autowired
private SaasReportManageService saasReportManageService;
@Override
public SaasElderReportConfig view(String id) {
......@@ -41,11 +46,15 @@ public class SaasElderReportConfigServiceImpl extends ServiceImpl<SaasElderRepor
}
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasElderReportConfigDTO dto) {
SaasElderReportConfig entity = getById(dto.getId());
String result = JSON.toJSONString(dto.getResultContent());
entity.setResultContent(result);
saveOrUpdate(entity);
saasReportManageService.updateEntity(dto.getId(),"elder");
}
@Override
......
package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.mapper.saas.analysis.SaasModelManageMapper;
import com.makeit.service.saas.SaasModelManageService;
import com.makeit.utils.user.common.CommonUserUtil;
import com.makeit.utils.user.common.CommonUserVO;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
/**
* <p>
* 模型管理 服务实现类
......@@ -17,4 +22,16 @@ import org.springframework.stereotype.Service;
@Service
public class SaasModelManageServiceImpl extends ServiceImpl<SaasModelManageMapper, SaasModelManage> implements SaasModelManageService {
@Override
public void updateEntity(String id, String type) {
SaasModelManage saasModelManage = getOne(new QueryWrapper<SaasModelManage>().lambda()
.eq(SaasModelManage::getModelId, id)
.eq(SaasModelManage::getModelType, type));
CommonUserVO commonUserVO = CommonUserUtil.getUser();
if (saasModelManage != null) {
saasModelManage.setUpdateBy(commonUserVO == null ? "" : commonUserVO.getName());
saasModelManage.setUpdateDate(LocalDateTime.now());
}
}
}
package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.entity.saas.analysis.SaasReportManage;
import com.makeit.mapper.saas.analysis.SaasReportManageMapper;
import com.makeit.service.saas.SaasReportManageService;
import com.makeit.utils.user.common.CommonUserUtil;
import com.makeit.utils.user.common.CommonUserVO;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
/**
* <p>
* 报告管理 服务实现类
......@@ -17,4 +23,16 @@ import org.springframework.stereotype.Service;
@Service
public class SaasReportManageServiceImpl extends ServiceImpl<SaasReportManageMapper, SaasReportManage> implements SaasReportManageService {
@Override
public void updateEntity(String id, String type) {
SaasReportManage saasReportManage = getOne(new QueryWrapper<SaasReportManage>().lambda()
.eq(SaasReportManage::getReportId, id)
.eq(SaasReportManage::getReportType, type));
CommonUserVO commonUserVO = CommonUserUtil.getUser();
if (saasReportManage != null) {
saasReportManage.setUpdateBy(commonUserVO == null ? "" : commonUserVO.getName());
saasReportManage.setUpdateDate(LocalDateTime.now());
}
}
}
package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.dto.saas.analysis.SaasSleepAnalysisModelDTO;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.entity.saas.analysis.SaasSleepAnalysisModel;
import com.makeit.mapper.saas.analysis.SaasSleepAnalysisModelMapper;
import com.makeit.service.saas.SaasModelManageService;
import com.makeit.service.saas.SaasSleepAnalysisModelService;
import com.makeit.utils.user.common.CommonUserUtil;
import com.makeit.utils.user.common.CommonUserVO;
import com.makeit.utils.user.saas.SaasUserUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/**
* <p>
......@@ -20,6 +30,8 @@ import org.springframework.stereotype.Service;
@Service
public class SaasSleepAnalysisModelServiceImpl extends ServiceImpl<SaasSleepAnalysisModelMapper, SaasSleepAnalysisModel> implements SaasSleepAnalysisModelService {
@Autowired
private SaasModelManageService saasModelManageService;
@Override
public SaasSleepAnalysisModel view(String id) {
......@@ -34,9 +46,13 @@ public class SaasSleepAnalysisModelServiceImpl extends ServiceImpl<SaasSleepAnal
}
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasSleepAnalysisModelDTO dto) {
SaasSleepAnalysisModel entity = getById(dto.getId());
BeanUtils.copyProperties(dto,entity);
saveOrUpdate(entity);
saasModelManageService.updateEntity(dto.getId(),"disease");
}
}
......@@ -9,10 +9,12 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import com.makeit.mapper.saas.analysis.SaasSleepEvaluateReportMapper;
import com.makeit.module.iot.vo.analysis.EvaluateReportVO;
import com.makeit.service.saas.SaasElderReportConfigService;
import com.makeit.service.saas.SaasReportManageService;
import com.makeit.service.saas.SaasSleepEvaluateReportService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -29,6 +31,8 @@ public class SaasSleepEvaluateReportServiceImpl extends ServiceImpl<SaasSleepEva
@Autowired
private SaasElderReportConfigService saasElderReportConfigService;
@Autowired
private SaasReportManageService saasReportManageService;
@Override
public SaasSleepEvaluateReport view(String id) {
......@@ -44,11 +48,14 @@ public class SaasSleepEvaluateReportServiceImpl extends ServiceImpl<SaasSleepEva
}
@Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasSleepEvaluateReportDTO dto) {
SaasSleepEvaluateReport entity = getById(dto.getId());
String result = JSON.toJSONString(dto.getResultContent());
entity.setResultContent(result);
saveOrUpdate(entity);
saasReportManageService.updateEntity(dto.getId(),"sleep");
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment