Commit e1bdb089 by huangjy

fix:修复bug

parent 09ae7133
...@@ -2,7 +2,7 @@ package com.makeit.controller.analysis; ...@@ -2,7 +2,7 @@ package com.makeit.controller.analysis;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.entity.saas.analysis.SaasModelManage; import com.makeit.entity.saas.analysis.SaasModelManage;
...@@ -39,7 +39,7 @@ public class SaasModelManageController { ...@@ -39,7 +39,7 @@ public class SaasModelManageController {
@Action(module = "数据分析-模型管理", name = "分页列表", code = "saas:modelManage:page") @Action(module = "数据分析-模型管理", name = "分页列表", code = "saas:modelManage:page")
@ApiOperation("分页列表") @ApiOperation("分页列表")
@PostMapping("list") @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() return ApiResponseUtils.success(saasModelManageService.list(new QueryWrapper<SaasModelManage>().lambda()
.like(StringUtils.isNotEmpty(dto.getName()),SaasModelManage::getName,dto.getName()))); .like(StringUtils.isNotEmpty(dto.getName()),SaasModelManage::getName,dto.getName())));
} }
......
...@@ -2,13 +2,11 @@ package com.makeit.controller.analysis; ...@@ -2,13 +2,11 @@ package com.makeit.controller.analysis;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.entity.saas.analysis.SaasReportManage; import com.makeit.entity.saas.analysis.SaasReportManage;
import com.makeit.global.annotation.Action; import com.makeit.global.annotation.Action;
import com.makeit.service.saas.SaasModelManageService;
import com.makeit.service.saas.SaasReportManageService; import com.makeit.service.saas.SaasReportManageService;
import com.makeit.utils.old.StringUtils; import com.makeit.utils.old.StringUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -41,7 +39,7 @@ public class SaasReportManageController { ...@@ -41,7 +39,7 @@ public class SaasReportManageController {
@Action(module = "数据分析-报告管理", name = "分页列表", code = "saas:reportManage:page") @Action(module = "数据分析-报告管理", name = "分页列表", code = "saas:reportManage:page")
@ApiOperation("分页列表") @ApiOperation("分页列表")
@PostMapping("list") @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() return ApiResponseUtils.success(saasReportManageService.list(new QueryWrapper<SaasReportManage>().lambda()
.like(StringUtils.isNotEmpty(dto.getName()),SaasReportManage::getName,dto.getName()))); .like(StringUtils.isNotEmpty(dto.getName()),SaasReportManage::getName,dto.getName())));
} }
......
...@@ -13,4 +13,5 @@ import com.makeit.entity.saas.analysis.SaasModelManage; ...@@ -13,4 +13,5 @@ import com.makeit.entity.saas.analysis.SaasModelManage;
*/ */
public interface SaasModelManageService extends IService<SaasModelManage> { public interface SaasModelManageService extends IService<SaasModelManage> {
void updateEntity(String id, String sleep);
} }
...@@ -13,4 +13,5 @@ import com.makeit.entity.saas.analysis.SaasReportManage; ...@@ -13,4 +13,5 @@ import com.makeit.entity.saas.analysis.SaasReportManage;
*/ */
public interface SaasReportManageService extends IService<SaasReportManage> { public interface SaasReportManageService extends IService<SaasReportManage> {
void updateEntity(String id, String sleep);
} }
...@@ -6,8 +6,11 @@ import com.makeit.dto.saas.analysis.SaasDiseaseEvaluateReportDTO; ...@@ -6,8 +6,11 @@ import com.makeit.dto.saas.analysis.SaasDiseaseEvaluateReportDTO;
import com.makeit.entity.saas.analysis.SaasDiseaseEvaluateReport; import com.makeit.entity.saas.analysis.SaasDiseaseEvaluateReport;
import com.makeit.mapper.saas.analysis.SaasDiseaseEvaluateReportMapper; import com.makeit.mapper.saas.analysis.SaasDiseaseEvaluateReportMapper;
import com.makeit.service.saas.SaasDiseaseEvaluateReportService; import com.makeit.service.saas.SaasDiseaseEvaluateReportService;
import com.makeit.service.saas.SaasReportManageService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* <p> * <p>
...@@ -20,6 +23,8 @@ import org.springframework.stereotype.Service; ...@@ -20,6 +23,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SaasDiseaseEvaluateReportServiceImpl extends ServiceImpl<SaasDiseaseEvaluateReportMapper, SaasDiseaseEvaluateReport> implements SaasDiseaseEvaluateReportService { public class SaasDiseaseEvaluateReportServiceImpl extends ServiceImpl<SaasDiseaseEvaluateReportMapper, SaasDiseaseEvaluateReport> implements SaasDiseaseEvaluateReportService {
@Autowired
private SaasReportManageService saasReportManageService;
@Override @Override
public SaasDiseaseEvaluateReport view(String id) { public SaasDiseaseEvaluateReport view(String id) {
...@@ -35,10 +40,14 @@ public class SaasDiseaseEvaluateReportServiceImpl extends ServiceImpl<SaasDiseas ...@@ -35,10 +40,14 @@ public class SaasDiseaseEvaluateReportServiceImpl extends ServiceImpl<SaasDiseas
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasDiseaseEvaluateReportDTO dto) { public void edit(SaasDiseaseEvaluateReportDTO dto) {
SaasDiseaseEvaluateReport entity = getById(dto.getId()); SaasDiseaseEvaluateReport entity = getById(dto.getId());
String result = JSON.toJSONString(dto.getResultContent()); String result = JSON.toJSONString(dto.getResultContent());
entity.setResultContent(result); entity.setResultContent(result);
saveOrUpdate(entity); saveOrUpdate(entity);
saasReportManageService.updateEntity(dto.getId(),"disease");
} }
} }
package com.makeit.service.saas.impl; package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.dto.saas.analysis.SaasDiseaseModelDTO; import com.makeit.dto.saas.analysis.SaasDiseaseModelDTO;
import com.makeit.entity.saas.analysis.SaasDiseaseModel; import com.makeit.entity.saas.analysis.SaasDiseaseModel;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.mapper.saas.analysis.SaasDiseaseModelMapper; import com.makeit.mapper.saas.analysis.SaasDiseaseModelMapper;
import com.makeit.service.saas.SaasDiseaseModelService; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
...@@ -20,6 +29,8 @@ import org.springframework.stereotype.Service; ...@@ -20,6 +29,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SaasDiseaseModelServiceImpl extends ServiceImpl<SaasDiseaseModelMapper, SaasDiseaseModel> implements SaasDiseaseModelService { public class SaasDiseaseModelServiceImpl extends ServiceImpl<SaasDiseaseModelMapper, SaasDiseaseModel> implements SaasDiseaseModelService {
@Autowired
private SaasModelManageService saasModelManageService;
@Override @Override
public SaasDiseaseModel view(String id) { public SaasDiseaseModel view(String id) {
...@@ -34,9 +45,12 @@ public class SaasDiseaseModelServiceImpl extends ServiceImpl<SaasDiseaseModelMap ...@@ -34,9 +45,12 @@ public class SaasDiseaseModelServiceImpl extends ServiceImpl<SaasDiseaseModelMap
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasDiseaseModelDTO dto) { public void edit(SaasDiseaseModelDTO dto) {
SaasDiseaseModel entity = getById(dto.getId()); SaasDiseaseModel entity = getById(dto.getId());
BeanUtils.copyProperties(dto,entity); BeanUtils.copyProperties(dto,entity);
saveOrUpdate(entity); saveOrUpdate(entity);
saasModelManageService.updateEntity(dto.getId(),"sleep");
} }
} }
...@@ -10,8 +10,11 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport; ...@@ -10,8 +10,11 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import com.makeit.mapper.saas.analysis.SaasElderReportConfigMapper; import com.makeit.mapper.saas.analysis.SaasElderReportConfigMapper;
import com.makeit.module.iot.vo.analysis.EvaluateReportVO; import com.makeit.module.iot.vo.analysis.EvaluateReportVO;
import com.makeit.service.saas.SaasElderReportConfigService; import com.makeit.service.saas.SaasElderReportConfigService;
import com.makeit.service.saas.SaasReportManageService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
...@@ -26,6 +29,8 @@ import java.util.List; ...@@ -26,6 +29,8 @@ import java.util.List;
@Service @Service
public class SaasElderReportConfigServiceImpl extends ServiceImpl<SaasElderReportConfigMapper, SaasElderReportConfig> implements SaasElderReportConfigService { public class SaasElderReportConfigServiceImpl extends ServiceImpl<SaasElderReportConfigMapper, SaasElderReportConfig> implements SaasElderReportConfigService {
@Autowired
private SaasReportManageService saasReportManageService;
@Override @Override
public SaasElderReportConfig view(String id) { public SaasElderReportConfig view(String id) {
...@@ -41,11 +46,15 @@ public class SaasElderReportConfigServiceImpl extends ServiceImpl<SaasElderRepor ...@@ -41,11 +46,15 @@ public class SaasElderReportConfigServiceImpl extends ServiceImpl<SaasElderRepor
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasElderReportConfigDTO dto) { public void edit(SaasElderReportConfigDTO dto) {
SaasElderReportConfig entity = getById(dto.getId()); SaasElderReportConfig entity = getById(dto.getId());
String result = JSON.toJSONString(dto.getResultContent()); String result = JSON.toJSONString(dto.getResultContent());
entity.setResultContent(result); entity.setResultContent(result);
saveOrUpdate(entity); saveOrUpdate(entity);
saasReportManageService.updateEntity(dto.getId(),"elder");
} }
@Override @Override
......
package com.makeit.service.saas.impl; package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.entity.saas.analysis.SaasModelManage; import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.mapper.saas.analysis.SaasModelManageMapper; import com.makeit.mapper.saas.analysis.SaasModelManageMapper;
import com.makeit.service.saas.SaasModelManageService; 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 org.springframework.stereotype.Service;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* 模型管理 服务实现类 * 模型管理 服务实现类
...@@ -17,4 +22,16 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +22,16 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SaasModelManageServiceImpl extends ServiceImpl<SaasModelManageMapper, SaasModelManage> implements SaasModelManageService { 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; package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.entity.saas.analysis.SaasReportManage;
import com.makeit.mapper.saas.analysis.SaasReportManageMapper; import com.makeit.mapper.saas.analysis.SaasReportManageMapper;
import com.makeit.service.saas.SaasReportManageService; 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 org.springframework.stereotype.Service;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* 报告管理 服务实现类 * 报告管理 服务实现类
...@@ -17,4 +23,16 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +23,16 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SaasReportManageServiceImpl extends ServiceImpl<SaasReportManageMapper, SaasReportManage> implements SaasReportManageService { 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; package com.makeit.service.saas.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.dto.saas.analysis.SaasSleepAnalysisModelDTO; import com.makeit.dto.saas.analysis.SaasSleepAnalysisModelDTO;
import com.makeit.entity.saas.analysis.SaasModelManage;
import com.makeit.entity.saas.analysis.SaasSleepAnalysisModel; import com.makeit.entity.saas.analysis.SaasSleepAnalysisModel;
import com.makeit.mapper.saas.analysis.SaasSleepAnalysisModelMapper; import com.makeit.mapper.saas.analysis.SaasSleepAnalysisModelMapper;
import com.makeit.service.saas.SaasModelManageService;
import com.makeit.service.saas.SaasSleepAnalysisModelService; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
...@@ -20,6 +30,8 @@ import org.springframework.stereotype.Service; ...@@ -20,6 +30,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SaasSleepAnalysisModelServiceImpl extends ServiceImpl<SaasSleepAnalysisModelMapper, SaasSleepAnalysisModel> implements SaasSleepAnalysisModelService { public class SaasSleepAnalysisModelServiceImpl extends ServiceImpl<SaasSleepAnalysisModelMapper, SaasSleepAnalysisModel> implements SaasSleepAnalysisModelService {
@Autowired
private SaasModelManageService saasModelManageService;
@Override @Override
public SaasSleepAnalysisModel view(String id) { public SaasSleepAnalysisModel view(String id) {
...@@ -34,9 +46,13 @@ public class SaasSleepAnalysisModelServiceImpl extends ServiceImpl<SaasSleepAnal ...@@ -34,9 +46,13 @@ public class SaasSleepAnalysisModelServiceImpl extends ServiceImpl<SaasSleepAnal
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasSleepAnalysisModelDTO dto) { public void edit(SaasSleepAnalysisModelDTO dto) {
SaasSleepAnalysisModel entity = getById(dto.getId()); SaasSleepAnalysisModel entity = getById(dto.getId());
BeanUtils.copyProperties(dto,entity); BeanUtils.copyProperties(dto,entity);
saveOrUpdate(entity); saveOrUpdate(entity);
saasModelManageService.updateEntity(dto.getId(),"disease");
} }
} }
...@@ -9,10 +9,12 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport; ...@@ -9,10 +9,12 @@ import com.makeit.entity.saas.analysis.SaasSleepEvaluateReport;
import com.makeit.mapper.saas.analysis.SaasSleepEvaluateReportMapper; import com.makeit.mapper.saas.analysis.SaasSleepEvaluateReportMapper;
import com.makeit.module.iot.vo.analysis.EvaluateReportVO; import com.makeit.module.iot.vo.analysis.EvaluateReportVO;
import com.makeit.service.saas.SaasElderReportConfigService; import com.makeit.service.saas.SaasElderReportConfigService;
import com.makeit.service.saas.SaasReportManageService;
import com.makeit.service.saas.SaasSleepEvaluateReportService; import com.makeit.service.saas.SaasSleepEvaluateReportService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
...@@ -29,6 +31,8 @@ public class SaasSleepEvaluateReportServiceImpl extends ServiceImpl<SaasSleepEva ...@@ -29,6 +31,8 @@ public class SaasSleepEvaluateReportServiceImpl extends ServiceImpl<SaasSleepEva
@Autowired @Autowired
private SaasElderReportConfigService saasElderReportConfigService; private SaasElderReportConfigService saasElderReportConfigService;
@Autowired
private SaasReportManageService saasReportManageService;
@Override @Override
public SaasSleepEvaluateReport view(String id) { public SaasSleepEvaluateReport view(String id) {
...@@ -44,11 +48,14 @@ public class SaasSleepEvaluateReportServiceImpl extends ServiceImpl<SaasSleepEva ...@@ -44,11 +48,14 @@ public class SaasSleepEvaluateReportServiceImpl extends ServiceImpl<SaasSleepEva
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void edit(SaasSleepEvaluateReportDTO dto) { public void edit(SaasSleepEvaluateReportDTO dto) {
SaasSleepEvaluateReport entity = getById(dto.getId()); SaasSleepEvaluateReport entity = getById(dto.getId());
String result = JSON.toJSONString(dto.getResultContent()); String result = JSON.toJSONString(dto.getResultContent());
entity.setResultContent(result); entity.setResultContent(result);
saveOrUpdate(entity); saveOrUpdate(entity);
saasReportManageService.updateEntity(dto.getId(),"sleep");
} }
@Override @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