Commit b15b8e0c authored by Shen's avatar Shen

1. 修复查看修改服务详情时机构关联信息

parent 3897d658
......@@ -100,6 +100,7 @@ public class PensionServiceController {
param.put("serviceId",data.getId());
List<PensionServiceDocumentDTO> pensionServiceDocumentDTOList = pensionServiceDocumentService.list(param);
data.setPensionServiceDocumentDTOList(pensionServiceDocumentDTOList);
data.setServiceOrgId(pensionOrganizationServiceService.getOrgIdByServiceId(data.getId()));
return new Result<PensionServiceDTO>().ok(data);
}
......@@ -150,6 +151,17 @@ public class PensionServiceController {
pensionServiceDocumentService.save(pensionServiceDocumentDTO);
}
}
//修改机构服务关系
PensionOrganizationServiceDTO pensionOrganizationServiceDTO = pensionOrganizationServiceService.getByServiceId(dto.getId());
if (null == pensionOrganizationServiceDTO) {
pensionOrganizationServiceDTO = new PensionOrganizationServiceDTO();
pensionOrganizationServiceDTO.setServiceId(dto.getId());
pensionOrganizationServiceDTO.setOrganizationId(dto.getServiceOrgId());
pensionOrganizationServiceService.save(pensionOrganizationServiceDTO);
} else {
pensionOrganizationServiceDTO.setOrganizationId(dto.getServiceOrgId());
pensionOrganizationServiceService.update(pensionOrganizationServiceDTO);
}
return new Result();
}
......
......@@ -23,6 +23,10 @@ public interface PensionOrganizationServiceDao extends BaseDao<PensionOrganizati
Long getUserOrgId(Long userId);
Long findOrgIdByServiceId(Long orgId);
Long findOrgIdByServiceId(Long serviceId);
Long findOrgIdByServiceIdForAdmin(Long serviceId);
PensionOrganizationServiceEntity getByServiceId(Long serviceId);
}
......@@ -19,4 +19,7 @@ public interface PensionOrganizationServiceService extends CrudService<PensionOr
PageData<PensionServiceDTO> getOrganizationServiceByUserId(Long userId, Map<String, Object> params);
Long getOrgIdByServiceId(Long serviceId);
PensionOrganizationServiceDTO getByServiceId(Long serviceId);
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ 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.ConvertUtils;
import io.hmit.common.utils.SubListForPageUtil;
import io.hmit.modules.serviceOrder.dao.PensionOrganizationServiceDao;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
......@@ -59,4 +60,14 @@ public class PensionOrganizationServiceServiceImpl extends CrudServiceImpl<Pensi
}
return getPageData(SubListForPageUtil.getSubList(params, dtos), dtos.size(), PensionServiceDTO.class);
}
@Override
public Long getOrgIdByServiceId(Long serviceId) {
return pensionOrganizationServiceDao.findOrgIdByServiceIdForAdmin(serviceId);
}
@Override
public PensionOrganizationServiceDTO getByServiceId(Long serviceId) {
return ConvertUtils.sourceToTarget(pensionOrganizationServiceDao.getByServiceId(serviceId), PensionOrganizationServiceDTO.class);
}
}
\ No newline at end of file
......@@ -23,7 +23,17 @@
<select id="findOrgIdByServiceId" resultType="Long">
SELECT pos.organization_id FROM pension_order po, pension_organization_service pos
WHERE po.service_id = pos.service_id AND po.id = #{orderId}
WHERE po.service_id = pos.service_id AND po.id = #{serviceId}
</select>
<select id="findOrgIdByServiceIdForAdmin" resultType="Long">
SELECT pos.organization_id FROM pension_organization_service pos
WHERE pos.service_id = #{serviceId}
</select>
<select id="getByServiceId" resultType="io.hmit.modules.serviceOrder.entity.PensionOrganizationServiceEntity">
SELECT * FROM pension_organization_service pos
WHERE pos.service_id = #{serviceId}
</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