Commit 2e8f45ff authored by Shen's avatar Shen

1. 机构端订单查询绑定管理员

2. 添加”获取全部机构列表“接口
parent c32a8d16
......@@ -85,7 +85,12 @@ public class PensionOrderController {
})
public Result<PageData<PensionOrderDTO>> organization(@ApiIgnore @RequestParam Map<String, Object> params){
//登录->查询登录人员所属机构ID->机构ID查询服务ID(List)->服务ID + 状态查询订单(List)
PageData<PensionOrderDTO> page = pensionOrderService.getOrganizationOrder(params, SecurityUser.getUserId());
PageData<PensionOrderDTO> page = null;
if (SecurityUser.getUserId() == 1067246875800000001L) {
page = pensionOrderService.page(params);
}else {
page = pensionOrderService.getOrganizationOrder(params, SecurityUser.getUserId());
}
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
......
......@@ -113,4 +113,12 @@ public class PensionOrganizationController {
ExcelUtils.exportExcelToTarget(response, null, list, PensionOrganizationExcel.class);
}
@GetMapping("getAllOrganization")
@ApiOperation("获取全部机构列表")
public Result<List<PensionOrganizationDTO>> getAllOrganization(){
List<PensionOrganizationDTO> organizationDTOList = pensionOrganizationService.getAllOrganization();
return new Result<List<PensionOrganizationDTO>>().ok(organizationDTOList);
}
}
\ No newline at end of file
......@@ -10,7 +10,9 @@ import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.security.user.SecurityUser;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationServiceDTO;
import io.hmit.modules.serviceOrder.dto.PensionServiceDTO;
import io.hmit.modules.serviceOrder.excel.PensionOrganizationServiceExcel;
import io.hmit.modules.serviceOrder.service.PensionOrganizationServiceService;
import io.swagger.annotations.Api;
......@@ -64,6 +66,18 @@ public class PensionOrganizationServiceController {
return new Result<PensionOrganizationServiceDTO>().ok(data);
}
@GetMapping("getOrganizationService")
@ApiOperation("获取机构下的服务信息")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int")
})
// @RequiresPermissions("serviceOrder:pensionorganizationservice:info")
public Result<PageData<PensionServiceDTO>> getOrganizationService(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionServiceDTO> pensionServiceDTO = pensionOrganizationServiceService.getOrganizationServiceByUserId(SecurityUser.getUserId(), params);
return new Result<PageData<PensionServiceDTO>>().ok(pensionServiceDTO);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
......
......@@ -4,6 +4,8 @@ import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 机构表
*
......@@ -13,4 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PensionOrganizationDao extends BaseDao<PensionOrganizationEntity> {
List<PensionOrganizationEntity> getAllOrganization();
}
\ No newline at end of file
......@@ -4,6 +4,8 @@ import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.entity.PensionServiceEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 服务表
*
......@@ -13,4 +15,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PensionServiceDao extends BaseDao<PensionServiceEntity> {
List<PensionServiceEntity> getAllService();
}
\ No newline at end of file
......@@ -31,6 +31,9 @@ public class PensionOrganizationDTO implements Serializable {
@ApiModelProperty(value = "机构描述")
private String description;
@ApiModelProperty(value = "服务区域")
private String serviceArea;
@ApiModelProperty(value = "创建者")
private Long creator;
......
......@@ -31,4 +31,8 @@ public class PensionOrganizationEntity extends BaseEntity {
* 机构描述
*/
private String description;
/**
* 服务区域
*/
private String serviceArea;
}
\ No newline at end of file
......@@ -15,4 +15,7 @@ import java.util.List;
public interface PensionOrganizationService extends CrudService<PensionOrganizationEntity, PensionOrganizationDTO> {
List<Long> findServiceIdListByServiceUserId(Long userId);
List<PensionOrganizationDTO> getAllOrganization();
}
package io.hmit.modules.serviceOrder.service;
import io.hmit.common.page.PageData;
import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationServiceDTO;
import io.hmit.modules.serviceOrder.dto.PensionServiceDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrganizationServiceEntity;
import java.util.List;
import java.util.Map;
/**
* 机构服务关系
*
......@@ -12,4 +17,6 @@ import io.hmit.modules.serviceOrder.entity.PensionOrganizationServiceEntity;
*/
public interface PensionOrganizationServiceService extends CrudService<PensionOrganizationServiceEntity, PensionOrganizationServiceDTO> {
PageData<PensionServiceDTO> getOrganizationServiceByUserId(Long userId, Map<String, Object> params);
}
\ No newline at end of file
......@@ -16,4 +16,7 @@ import java.util.Map;
public interface PensionServiceService extends CrudService<PensionServiceEntity, PensionServiceDTO> {
List<PensionServiceDTO> getServiceTree(Map<String, Object> params);
List<PensionServiceDTO> getAllService();
}
......@@ -2,6 +2,7 @@ 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.modules.serviceOrder.dao.PensionOrganizationDao;
import io.hmit.modules.serviceOrder.dao.PensionOrganizationServiceDao;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationDTO;
......@@ -26,6 +27,9 @@ public class PensionOrganizationServiceImpl extends CrudServiceImpl<PensionOrgan
@Autowired
private PensionOrganizationServiceDao pensionOrganizationServiceDao;
@Autowired
private PensionOrganizationDao pensionOrganizationDao;
@Override
public QueryWrapper<PensionOrganizationEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
......@@ -41,4 +45,9 @@ public class PensionOrganizationServiceImpl extends CrudServiceImpl<PensionOrgan
public List<Long> findServiceIdListByServiceUserId(Long userId) {
return pensionOrganizationServiceDao.findServiceIdListByServiceUserId(userId);
}
@Override
public List<PensionOrganizationDTO> getAllOrganization() {
return ConvertUtils.sourceToTarget(pensionOrganizationDao.getAllOrganization(), PensionOrganizationDTO.class);
}
}
package io.hmit.modules.serviceOrder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.SubListForPageUtil;
import io.hmit.modules.serviceOrder.dao.PensionOrganizationServiceDao;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationServiceDTO;
import io.hmit.modules.serviceOrder.dto.PensionServiceDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrganizationServiceEntity;
import io.hmit.modules.serviceOrder.service.PensionOrganizationServiceService;
import io.hmit.modules.serviceOrder.service.PensionServiceService;
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;
/**
......@@ -30,5 +38,25 @@ public class PensionOrganizationServiceServiceImpl extends CrudServiceImpl<Pensi
return wrapper;
}
@Autowired
private PensionOrganizationServiceDao pensionOrganizationServiceDao;
@Autowired
private PensionServiceService pensionServiceService;
@Override
public PageData<PensionServiceDTO> getOrganizationServiceByUserId(Long userId, Map<String, Object> params) {
List<Long> serviceIdListByServiceUserId = new ArrayList<>();
List<PensionServiceDTO> dtos = new ArrayList<>();
if (userId == 1067246875800000001L) {
dtos = pensionServiceService.getAllService();
} else {
serviceIdListByServiceUserId = pensionOrganizationServiceDao.findServiceIdListByServiceUserId(userId);
for (Long id : serviceIdListByServiceUserId) {
PensionServiceDTO pensionServiceDTO = pensionServiceService.get(id);
dtos.add(pensionServiceDTO);
}
}
return getPageData(SubListForPageUtil.getSubList(params, dtos), dtos.size(), PensionServiceDTO.class);
}
}
\ No newline at end of file
......@@ -28,6 +28,10 @@ public class PensionServiceServiceImpl extends CrudServiceImpl<PensionServiceDao
@Autowired
private PensionServiceService pensionServiceService;
@Autowired
private PensionServiceDao pensionServiceDao;
@Override
public QueryWrapper<PensionServiceEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
......@@ -52,4 +56,9 @@ public class PensionServiceServiceImpl extends CrudServiceImpl<PensionServiceDao
return TreeUtils.build(dtos);
}
@Override
public List<PensionServiceDTO> getAllService() {
return ConvertUtils.sourceToTarget(pensionServiceDao.getAllService(), PensionServiceDTO.class);
}
}
......@@ -12,5 +12,8 @@
<result property="createDate" column="create_date"/>
</resultMap>
<select id="getAllOrganization" resultType="io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity">
SELECT po.id, po.name, po.icon FROM pension_organization po
</select>
</mapper>
\ No newline at end of file
......@@ -12,8 +12,8 @@
</resultMap>
<select id="findServiceIdListByServiceUserId" resultType="Long">
SELECT pos.service_id FROM pension_organization_user pou, pension_organization_service pos,tb_user tu
WHERE pou.organization_id = pos.organization_id and tu.id= pou.user_id and tu.user_id= #{userId}
SELECT pos.service_id FROM pension_organization_user pou, pension_organization_service pos
WHERE pou.organization_id = pos.organization_id and pou.user_id = #{userId}
</select>
......
......@@ -23,5 +23,8 @@
<result property="updateDate" column="update_date"/>
</resultMap>
<select id="getAllService" resultType="io.hmit.modules.serviceOrder.entity.PensionServiceEntity">
SELECT * FROM pension_service
</select>
</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