Commit c5c63e51 authored by lings's avatar lings

Merge branch 'master' into lings

parents 0081eee7 d2594ab7
......@@ -72,6 +72,18 @@ public class PensionServiceController {
return new Result<List<PensionServiceDTO>>().ok(pensionServiceDTOList);
}
@GetMapping("getServiceTree")
@ApiOperation("获取服务list不分页")
@ApiImplicitParams({
@ApiImplicitParam(name = "keyword", value = "查询字段,", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "serviceType", value = "服务类型", paramType = "query", dataType="String")
})
public Result<List<PensionServiceDTO>> getServiceTree(@ApiIgnore @RequestParam Map<String, Object> params){
List<PensionServiceDTO> pensionServiceDTOList = pensionServiceService.getServiceTree(params);
return new Result<List<PensionServiceDTO>>().ok(pensionServiceDTOList);
}
@GetMapping("{id}")
@ApiOperation("信息")
@RequiresPermissions("serviceOrder:pensionservice:info")
......
package io.hmit.modules.serviceOrder.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.hmit.common.utils.TreeNode;
import io.hmit.modules.sys.dto.SysMenuDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -19,14 +21,18 @@ import java.util.List;
*/
@Data
@ApiModel(value = "服务表")
public class PensionServiceDTO implements Serializable {
public class PensionServiceDTO extends TreeNode<PensionServiceDTO> implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "pid")
private Long pid;
@ApiModelProperty(value = "服务名称")
private String name;
private String serviceName;
@ApiModelProperty(value = "服务内容介绍")
private String serviceContent;
......
package io.hmit.modules.serviceOrder.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import lombok.Data;
......@@ -23,7 +24,10 @@ public class PensionServiceEntity extends BaseEntity {
/**
* 服务名称
*/
private String name;
private String serviceName;
private Long pid;
/**
* 服务类型
*/
......@@ -77,4 +81,4 @@ public class PensionServiceEntity extends BaseEntity {
*/
private String serviceContent;
}
\ No newline at end of file
}
......@@ -4,6 +4,9 @@ import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionServiceDTO;
import io.hmit.modules.serviceOrder.entity.PensionServiceEntity;
import java.util.List;
import java.util.Map;
/**
* 服务表
*
......@@ -12,4 +15,5 @@ import io.hmit.modules.serviceOrder.entity.PensionServiceEntity;
*/
public interface PensionServiceService extends CrudService<PensionServiceEntity, PensionServiceDTO> {
}
\ No newline at end of file
List<PensionServiceDTO> getServiceTree(Map<String, Object> params);
}
......@@ -2,13 +2,19 @@ package io.hmit.modules.serviceOrder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.common.utils.TreeUtils;
import io.hmit.modules.serviceOrder.dao.PensionServiceDao;
import io.hmit.modules.serviceOrder.dto.PensionServiceDTO;
import io.hmit.modules.serviceOrder.entity.PensionServiceEntity;
import io.hmit.modules.serviceOrder.service.PensionServiceService;
import io.hmit.modules.sys.dto.SysMenuDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
......@@ -20,17 +26,18 @@ import java.util.Map;
@Service
public class PensionServiceServiceImpl extends CrudServiceImpl<PensionServiceDao, PensionServiceEntity, PensionServiceDTO> implements PensionServiceService {
@Autowired
private PensionServiceService pensionServiceService;
@Override
public QueryWrapper<PensionServiceEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
String keyword = (String)params.get("keyword");
String serviceType = (String)params.get("serviceType");
QueryWrapper<PensionServiceEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
wrapper.eq(StringUtils.isNotBlank(serviceType), "service_type_id", serviceType);
wrapper.like(StringUtils.isNotBlank(keyword), "name", keyword);
wrapper.like(StringUtils.isNotBlank(keyword), "service_name", keyword);
......@@ -38,4 +45,11 @@ public class PensionServiceServiceImpl extends CrudServiceImpl<PensionServiceDao
}
@Override
public List<PensionServiceDTO> getServiceTree(Map<String, Object> params) {
List<PensionServiceEntity> list = baseDao.selectList(getWrapper(params));
List<PensionServiceDTO> dtos = ConvertUtils.sourceToTarget(list,PensionServiceDTO.class);
return TreeUtils.build(dtos);
}
}
......@@ -5,8 +5,9 @@
<resultMap type="io.hmit.modules.serviceOrder.entity.PensionServiceEntity" id="pensionServiceMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="serviceTypeId" column="service_type_id"/>
<result property="serviceName" column="service_name"/>
<result property="serviceParentId" column="service_parent_id"/>
<result property="pid" column="pid"/>
<result property="sort" column="sort"/>
<result property="icon" column="icon"/>
<result property="detailPicture" column="detail_picture"/>
......@@ -23,4 +24,4 @@
</resultMap>
</mapper>
\ No newline at end of file
</mapper>
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