Commit 02e960da by 朱淼
parents c288bcef 00ec355b
Showing with 181 additions and 20 deletions
...@@ -2,18 +2,19 @@ package com.makeit.controller.analysis; ...@@ -2,18 +2,19 @@ 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;
import com.makeit.global.annotation.Action; import com.makeit.global.annotation.Action;
import com.makeit.module.admin.dto.plat.PlatMenuQueryDTO;
import com.makeit.service.saas.SaasModelManageService; import com.makeit.service.saas.SaasModelManageService;
import com.makeit.utils.old.StringUtils; import com.makeit.utils.old.StringUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -39,7 +40,7 @@ public class SaasModelManageController { ...@@ -39,7 +40,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 PlatMenuQueryDTO 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,20 +2,18 @@ package com.makeit.controller.analysis; ...@@ -2,20 +2,18 @@ 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;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -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())));
} }
......
...@@ -17,7 +17,7 @@ public class HeaderInfo { ...@@ -17,7 +17,7 @@ public class HeaderInfo {
@Data @Data
public class Bind { public static class Bind {
private String id; private String id;
private String type; private String type;
} }
......
...@@ -39,6 +39,7 @@ public class MailMsgSender implements IMsgSender { ...@@ -39,6 +39,7 @@ public class MailMsgSender implements IMsgSender {
helper.setSubject(msgDTO.getSubject()); helper.setSubject(msgDTO.getSubject());
helper.setText(msgDTO.getOriContent(), false); helper.setText(msgDTO.getOriContent(), false);
mailSender.send(message); mailSender.send(message);
log.info("发送邮箱成功");
} catch (Exception e) { } catch (Exception e) {
log.error("发送邮箱异常:",msgDTO,e); log.error("发送邮箱异常:",msgDTO,e);
} }
......
...@@ -76,6 +76,7 @@ public class SmsVoiceSender implements IMsgSender{ ...@@ -76,6 +76,7 @@ public class SmsVoiceSender implements IMsgSender{
log.error("发送语音短信失败:"+jsonObject.get("status_code")); log.error("发送语音短信失败:"+jsonObject.get("status_code"));
throw new BusinessException((String) jsonObject.get("status_code")); throw new BusinessException((String) jsonObject.get("status_code"));
} }
log.info("发送语音短信成功");
}catch (Exception e){ }catch (Exception e){
log.error("发送语音异常:",msgDTO,e); log.error("发送语音异常:",msgDTO,e);
} }
......
...@@ -7,7 +7,6 @@ import com.makeit.common.page.PageVO; ...@@ -7,7 +7,6 @@ import com.makeit.common.page.PageVO;
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.platform.auth.PlatOrg; import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.global.annotation.Action;
import com.makeit.service.platform.auth.PlatOrgService; import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.vo.platform.auth.PlatOrgQueryDTO; import com.makeit.vo.platform.auth.PlatOrgQueryDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -29,28 +28,24 @@ public class PlatOrgChildrenController { ...@@ -29,28 +28,24 @@ public class PlatOrgChildrenController {
@Autowired @Autowired
private PlatOrgService platOrgService; private PlatOrgService platOrgService;
@Action(module = "子女端小程序-组织", name = "分页列表", code = "plat:org:page")
@ApiOperation("树形列表") @ApiOperation("树形列表")
@PostMapping("page") @PostMapping("page")
public ApiResponseEntity<PageVO<PlatOrg>> page(@RequestBody PageReqDTO<PlatOrgQueryDTO> pageReqDTO){ public ApiResponseEntity<PageVO<PlatOrg>> page(@RequestBody PageReqDTO<PlatOrgQueryDTO> pageReqDTO){
return ApiResponseUtils.success(platOrgService.page(pageReqDTO)); return ApiResponseUtils.success(platOrgService.page(pageReqDTO));
} }
@Action(module = "子女端小程序-组织", name = "不分页列表", code = "plat:org:list")
@ApiOperation("树形列表") @ApiOperation("树形列表")
@PostMapping("list") @PostMapping("list")
public ApiResponseEntity<List<PlatOrg>> list(@RequestBody PlatOrgQueryDTO platOrgQueryDTO){ public ApiResponseEntity<List<PlatOrg>> list(@RequestBody PlatOrgQueryDTO platOrgQueryDTO){
return ApiResponseUtils.success(platOrgService.subOrgList(platOrgQueryDTO)); return ApiResponseUtils.success(platOrgService.subOrgList(platOrgQueryDTO));
} }
@Action(module = "子女端小程序-组织", name = "新增", code = "plat:org:add")
@ApiOperation("新增") @ApiOperation("新增")
@PostMapping("add") @PostMapping("add")
public ApiResponseEntity<String> add(@Validated @RequestBody PlatOrg tntDept){ public ApiResponseEntity<String> add(@Validated @RequestBody PlatOrg tntDept){
return ApiResponseUtils.success(platOrgService.add(tntDept)); return ApiResponseUtils.success(platOrgService.add(tntDept));
} }
@Action(module = "子女端小程序-组织", name = "编辑", code = "plat:org:edit")
@ApiOperation("编辑") @ApiOperation("编辑")
@PostMapping("edit") @PostMapping("edit")
public ApiResponseEntity<Void> edit(@Validated @RequestBody PlatOrg tntDept){ public ApiResponseEntity<Void> edit(@Validated @RequestBody PlatOrg tntDept){
...@@ -58,14 +53,12 @@ public class PlatOrgChildrenController { ...@@ -58,14 +53,12 @@ public class PlatOrgChildrenController {
return ApiResponseUtils.success(); return ApiResponseUtils.success();
} }
@Action(module = "平台端-组织", name = "详情", code = "plat:org:view")
@ApiOperation("详情") @ApiOperation("详情")
@PostMapping("view") @PostMapping("view")
public ApiResponseEntity<PlatOrg> view(@RequestBody BaseIdDTO baseIdDTO){ public ApiResponseEntity<PlatOrg> view(@RequestBody BaseIdDTO baseIdDTO){
return ApiResponseUtils.success(platOrgService.view(baseIdDTO.getId())); return ApiResponseUtils.success(platOrgService.view(baseIdDTO.getId()));
} }
@Action(module = "平台端-组织", name = "删除", code = "plat:org:del")
@ApiOperation("删除") @ApiOperation("删除")
@PostMapping("del") @PostMapping("del")
public ApiResponseEntity<PlatOrg> del(@RequestBody BaseIdDTO baseIdDTO){ public ApiResponseEntity<PlatOrg> del(@RequestBody BaseIdDTO baseIdDTO){
......
...@@ -6,12 +6,16 @@ import com.makeit.common.page.PageReqDTO; ...@@ -6,12 +6,16 @@ import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO; import com.makeit.common.page.PageVO;
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.platform.auth.PlatOrg;
import com.makeit.entity.saas.PlatTenant; import com.makeit.entity.saas.PlatTenant;
import com.makeit.global.annotation.AuthIgnore; import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.module.admin.dto.plat.PlatTenantDTOVO; import com.makeit.module.admin.dto.plat.PlatTenantDTOVO;
import com.makeit.module.admin.vo.plat.PlatTenantVO; import com.makeit.module.admin.vo.plat.PlatTenantVO;
import com.makeit.service.platform.auth.PlatOrgService;
import com.makeit.service.saas.PlatTenantService; import com.makeit.service.saas.PlatTenantService;
import com.makeit.service.saas.SaasOperationLogService; import com.makeit.service.saas.SaasOperationLogService;
import com.makeit.vo.platform.auth.PlatOrgQueryDTO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -39,11 +43,15 @@ public class PlatTenantChildrenController { ...@@ -39,11 +43,15 @@ public class PlatTenantChildrenController {
private PlatTenantService platTenantService; private PlatTenantService platTenantService;
@Autowired @Autowired
private SaasOperationLogService saasOperationLogService; private SaasOperationLogService saasOperationLogService;
@Autowired
private PlatOrgService platOrgService;
@ApiOperation("分页列表") @ApiOperation("分页列表")
@PostMapping("page") @PostMapping("page")
public ApiResponseEntity<PageVO<PlatTenantVO>> page(@RequestBody PageReqDTO<PlatTenantVO> page){ @TenantIdIgnore
return ApiResponseUtils.success(platTenantService.page(page)); @AuthIgnore
public ApiResponseEntity<PageVO<PlatOrg>> page(@RequestBody PageReqDTO<PlatOrgQueryDTO> pageReqDTO){
return ApiResponseUtils.success(platOrgService.childPage(pageReqDTO));
} }
@ApiOperation("列表") @ApiOperation("列表")
......
...@@ -20,7 +20,6 @@ import com.makeit.entity.platform.space.PlatRegionSetting; ...@@ -20,7 +20,6 @@ import com.makeit.entity.platform.space.PlatRegionSetting;
import com.makeit.entity.platform.space.PlatRoom; import com.makeit.entity.platform.space.PlatRoom;
import com.makeit.entity.platform.space.PlatRoomBedDevice; import com.makeit.entity.platform.space.PlatRoomBedDevice;
import com.makeit.enums.CommonEnum; import com.makeit.enums.CommonEnum;
import com.makeit.enums.platform.device.PlatDeviceEnum;
import com.makeit.exception.BusinessException; import com.makeit.exception.BusinessException;
import com.makeit.global.aspect.tenant.TenantIdIgnore; import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.mapper.platform.alarm.PlatAlarmRecordMapper; import com.makeit.mapper.platform.alarm.PlatAlarmRecordMapper;
...@@ -370,7 +369,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe ...@@ -370,7 +369,7 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
throw new BusinessException("设备没绑定房间:"+platDevice.getId()); throw new BusinessException("设备没绑定房间:"+platDevice.getId());
} }
if(StringUtils.equals(platDevice.getCategory(), PlatDeviceEnum.CategoryEnum.SPACE.getValue())) { if(StringUtils.isNotBlank(platRoomBedDevice.getRoomId())) {
PlatRoom platRoom = platRoomService.getById(platRoomBedDevice.getRoomId()); PlatRoom platRoom = platRoomService.getById(platRoomBedDevice.getRoomId());
platAlarmCheckDTO.setPlatRoom(platRoom); platAlarmCheckDTO.setPlatRoom(platRoom);
......
...@@ -106,4 +106,6 @@ public interface PlatOrgService extends IService<PlatOrg> { ...@@ -106,4 +106,6 @@ public interface PlatOrgService extends IService<PlatOrg> {
* @return * @return
*/ */
PlatOrgSplitDTO getOrgSplitVO(String orgId); PlatOrgSplitDTO getOrgSplitVO(String orgId);
PageVO<PlatOrg> childPage(PageReqDTO<PlatOrgQueryDTO> pageReqDTO);
} }
...@@ -27,6 +27,7 @@ import com.makeit.service.platform.auth.PlatRoleService; ...@@ -27,6 +27,7 @@ import com.makeit.service.platform.auth.PlatRoleService;
import com.makeit.service.platform.auth.PlatUserRoleService; import com.makeit.service.platform.auth.PlatUserRoleService;
import com.makeit.service.platform.auth.PlatUserService; import com.makeit.service.platform.auth.PlatUserService;
import com.makeit.service.platform.space.PlatSpaceService; import com.makeit.service.platform.space.PlatSpaceService;
import com.makeit.service.saas.PlatTenantService;
import com.makeit.utils.data.convert.PageUtil; import com.makeit.utils.data.convert.PageUtil;
import com.makeit.utils.data.convert.StreamUtil; import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.user.plat.PlatUserUtil; import com.makeit.utils.user.plat.PlatUserUtil;
...@@ -76,6 +77,8 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg> ...@@ -76,6 +77,8 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
private PlatAlarmConfigService platAlarmConfigService; private PlatAlarmConfigService platAlarmConfigService;
@Autowired @Autowired
private PlatSpaceService platSpaceService; private PlatSpaceService platSpaceService;
@Autowired
private PlatTenantService platTenantService;
@Override @Override
public List<PlatOrg> filter(List<PlatOrg> deptList, PlatOrgQueryDTO dto) { public List<PlatOrg> filter(List<PlatOrg> deptList, PlatOrgQueryDTO dto) {
...@@ -585,6 +588,28 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg> ...@@ -585,6 +588,28 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
return orgTree; return orgTree;
} }
/**
* 返回parentId的 树
* @param platOrgQueryDTO
* @return
*/
public List<PlatOrg> subOrgList2(PlatOrgQueryDTO platOrgQueryDTO) {
LambdaQueryWrapper<PlatOrg> queryWrapper = getLambdaQueryWrapper(platOrgQueryDTO);
List<PlatOrg> list = list(queryWrapper);
if(CollectionUtils.isEmpty(list)){
return new ArrayList<>();
}
Set<String> filterSet = list.stream().flatMap(vo -> {
String path = vo.getPath()+","+vo.getId();
String[] split = path.split(",");
return Stream.of(split);
}).collect(Collectors.toSet());
List<PlatOrg> total = list();
List<PlatOrg> orgTree = createOrgTree3(total,filterSet, platOrgQueryDTO.getParentId());
return orgTree;
}
private List<PlatOrg> createOrgTree2(List<PlatOrg> orgList,Set<String> filterSet){ private List<PlatOrg> createOrgTree2(List<PlatOrg> orgList,Set<String> filterSet){
if(CollectionUtils.isEmpty(orgList)){ if(CollectionUtils.isEmpty(orgList)){
return new ArrayList<>(); return new ArrayList<>();
...@@ -600,6 +625,26 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg> ...@@ -600,6 +625,26 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
} }
/** /**
* 返回父节点
* @param orgList
* @param filterSet
* @return
*/
private List<PlatOrg> createOrgTree3(List<PlatOrg> orgList,Set<String> filterSet,String parentId){
if(CollectionUtils.isEmpty(orgList)){
return new ArrayList<>();
}
Map<String, List<PlatOrg>> parentMap = orgList.stream()
.filter(vo->filterSet.contains(vo.getId()))
.collect(Collectors.groupingBy(PlatOrg::getParentId));
orgList.forEach(vo->{
vo.setChildren(parentMap.get(vo.getId()));
});
return orgList.stream().filter(vo->StringUtils.equals(vo.getParentId(),parentId)).collect(Collectors.toList());
}
/**
* 组织表增加一条数据 * 组织表增加一条数据
* 增加告警配置 * 增加告警配置
* @param platOrg * @param platOrg
...@@ -637,4 +682,23 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg> ...@@ -637,4 +682,23 @@ public class PlatOrgServiceImpl extends ServiceImpl<PlatOrgMapper, PlatOrg>
} }
return platOrgSplitDTO; return platOrgSplitDTO;
} }
@Override
public PageVO<PlatOrg> childPage(PageReqDTO<PlatOrgQueryDTO> pageReqDTO) {
PlatOrgQueryDTO dto = pageReqDTO.getData();
Page<PlatOrg> p = PageUtil.toMpPage(pageReqDTO);
dto.setParentId(TreeConst.TOP_LEVEL);
dto.setStatus(CommonEnum.YES.getValue());
LambdaQueryWrapper<PlatOrg> queryWrapper = getLambdaQueryWrapper(dto);
Page<PlatOrg> pageList = page(p, queryWrapper);
List<PlatOrg> records = pageList.getRecords();
records.forEach(vo -> {
dto.setParentId(vo.getId());
List<PlatOrg> subOrgList = subOrgList2(dto);
vo.setChildren(subOrgList);
});
return PageUtil.toPageVO(pageList.getRecords(), pageList);
}
} }
...@@ -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,17 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +22,17 @@ 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());
updateById(saasModelManage);
}
}
} }
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,17 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +23,17 @@ 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());
updateById(saasReportManage);
}
}
} }
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