Commit c1d67b01 authored by tianbo's avatar tianbo

代码修改

parent 5560ae62
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import java.util.List;
import java.util.Map;
......@@ -13,5 +14,14 @@ import java.util.Map;
* @date 2021-07-16
*/
public interface ISourceFileService {
public Map<String, List<AttachmentDto>> getAttachments(Long sourceId);
Map<String, List<AttachmentDto>> getAttachments(Long sourceId);
/**
* 批量保存附件
*
* @param sequenceNbr sourceId
* @param attachmentMap
* @return
*/
void saveAttachments(Long sequenceNbr, Map<String, List<AttachmentDto>> attachmentMap);
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -9,6 +10,8 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author tb
......@@ -68,9 +71,15 @@ public class ElevatorDto extends BaseDto {
@ApiModelProperty(value = "设备类别")
private String category;
@ApiModelProperty(value = "设备类别code")
private String categoryName;
@ApiModelProperty(value = "使用场所分类")
private String useSiteCategory;
@ApiModelProperty(value = "使用场所分类名称")
private String useSiteCategoryName;
@ApiModelProperty(value = "电梯型号")
private String model;
......@@ -98,6 +107,9 @@ public class ElevatorDto extends BaseDto {
@ApiModelProperty(value = "拖动方式")
private String dragMode;
@ApiModelProperty(value = "拖动方式名称")
private String dragModeName;
@ApiModelProperty(value = "电梯使用状态")
private Integer useStatus;
......@@ -116,9 +128,15 @@ public class ElevatorDto extends BaseDto {
@ApiModelProperty(value = "维保类型")
private String maintainType;
@ApiModelProperty(value = "维保类型名称")
private String maintainTypeName;
@ApiModelProperty(value = "维护周期")
private String maintainPeriod;
@ApiModelProperty(value = "维护周期名称")
private String maintainPeriodName;
@ApiModelProperty(value = "维保单位")
private String maintainUnit;
......@@ -194,4 +212,6 @@ public class ElevatorDto extends BaseDto {
@ApiModelProperty(value = "原始表id(来自历史数据库)")
private String originalId;
@ApiModelProperty(value = "附件")
private Map<String, List<AttachmentDto>> attachments;
}
......@@ -86,6 +86,7 @@ public class SourceFileServiceImpl extends BaseService<SourceFileDto, SourceFile
/**
* 保存附件
*/
@Override
public void saveAttachments(Long sequenceNbr, Map<String, List<AttachmentDto>> attachmentMap) {
if (!ValidationUtil.isEmpty(attachmentMap)) {
List<SourceFile> sourceFiles = Lists.newArrayList();
......
......@@ -16,7 +16,11 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -32,7 +36,7 @@ import java.util.Arrays;
*/
@RestController
@Api(tags = "电梯Api")
@RequestMapping(value = "/tzs/elevator")
@RequestMapping(value = "/elevator")
public class ElevatorController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(ElevatorController.class);
......@@ -46,7 +50,7 @@ public class ElevatorController extends BaseController {
* @param elevatorDto 新增参数
* @return 返回结果
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增电梯", notes = "新增电梯")
public ResponseModel<Boolean> saveElevator(@RequestBody ElevatorDto elevatorDto) {
......@@ -61,12 +65,12 @@ public class ElevatorController extends BaseController {
* @param id id
* @return 返回结果
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
@ApiOperation(httpMethod = "DELETE", value = "根据id删除", notes = "根据id删除")
public ResponseModel<Boolean> deleteById(@PathVariable Long id) {
boolean remove = iElevatorService.removeById(id);
return ResponseHelper.buildResponse(remove);
boolean removed = iElevatorService.removeById(id);
return ResponseHelper.buildResponse(removed);
}
/**
......@@ -75,7 +79,7 @@ public class ElevatorController extends BaseController {
* @param elevatorDto 修改参数
* @return 返回结果
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "修改电梯", notes = "修改电梯")
public ResponseModel<Boolean> updateByIdElevator(@RequestBody ElevatorDto elevatorDto) {
......@@ -160,7 +164,7 @@ public class ElevatorController extends BaseController {
* @param elevatorDto 查询参数
* @return 查询结果
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/query_elevator_list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页查询电梯信息", notes = "分页查询电梯信息")
public ResponseModel<IPage<ElevatorVo>> queryElevatorList(String pageNum, String pageSize,
......
......@@ -33,7 +33,7 @@ import java.util.Arrays;
*/
@RestController
@Api(tags = "维保单位Api")
@RequestMapping(value = "/tzs/maintenance-unit")
@RequestMapping(value = "/maintenance-unit")
public class MaintenanceUnitController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(MaintenanceUnitController.class);
......
......@@ -35,7 +35,7 @@ import java.util.Date;
*/
@RestController
@Api(tags = "救援站Api")
@RequestMapping(value = "/tzs/rescue-station")
@RequestMapping(value = "/rescue-station")
public class RescueStationController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(RescueStationController.class);
......
......@@ -8,7 +8,6 @@ import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit;
//import com.yeejoin.amos.boot.module.tzs.api.service.EquipFeignService;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.api.vo.UseUnitVo;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
......@@ -18,7 +17,11 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -26,6 +29,8 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Arrays;
//import com.yeejoin.amos.boot.module.tzs.api.service.EquipFeignService;
/**
* 使用单位
......@@ -35,7 +40,7 @@ import java.util.Arrays;
*/
@RestController
@Api(tags = "使用单位Api")
@RequestMapping(value = "/tzs/use-unit")
@RequestMapping(value = "/use-unit")
public class UseUnitController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(UseUnitController.class);
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.mapper.ElevatorMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 服务实现类
......@@ -13,6 +18,35 @@ import org.springframework.stereotype.Service;
* @date 2021-06-01
*/
@Service
public class ElevatorServiceImpl extends ServiceImpl<ElevatorMapper, Elevator> implements IElevatorService {
public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, ElevatorMapper> implements IElevatorService {
ISourceFileService sourceFileService;
/**
* 保存电梯信息
*
* @param elevatorDto
* @return
*/
public ElevatorDto saveElevator(ElevatorDto elevatorDto) {
elevatorDto = createWithModel(elevatorDto);
// TODO 保存附件
sourceFileService.saveAttachments(elevatorDto.getSequenceNbr(), elevatorDto.getAttachments());
return elevatorDto;
}
/**
* 更新电梯信息
*
* @param elevatorDto
* @return
*/
public ElevatorDto updateElevator(ElevatorDto elevatorDto) {
elevatorDto = updateWithModel(elevatorDto);
// TODO 保存附件
sourceFileService.saveAttachments(elevatorDto.getSequenceNbr(), elevatorDto.getAttachments());
return elevatorDto;
}
}
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.dto.RescueStationDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.RescueStation;
import com.yeejoin.amos.boot.module.tzs.api.mapper.RescueStationMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 服务实现类
......@@ -13,6 +14,6 @@ import org.springframework.stereotype.Service;
* @date 2021-06-01
*/
@Service
public class RescueStationServiceImpl extends ServiceImpl<RescueStationMapper, RescueStation> implements IRescueStationService {
public class RescueStationServiceImpl extends BaseService<RescueStationDto, RescueStation, RescueStationMapper> implements IRescueStationService {
}
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.dto.UseUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.UseUnit;
import com.yeejoin.amos.boot.module.tzs.api.mapper.UseUnitMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
/**
* 服务实现类
......@@ -13,6 +14,6 @@ import org.springframework.stereotype.Service;
* @date 2021-06-01
*/
@Service
public class UseUnitServiceImpl extends ServiceImpl<UseUnitMapper, UseUnit> implements IUseUnitService {
public class UseUnitServiceImpl extends BaseService<UseUnitDto, UseUnit, UseUnitMapper> implements IUseUnitService {
}
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 to comment