Commit c5c63e51 authored by lings's avatar lings

Merge branch 'master' into lings

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