Commit 3c5f82ce authored by 蔡镇泽's avatar 蔡镇泽

监管机构信息管理

parent dbe1fe67
package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data;
/**
* 监管机构人员信息列表VO
*/
@Data
public class SuperviseOrganVO {
/**
* 监管机构id
*/
private String spvOrganId;
/**
* 适用机构
*/
private String organName;
/**
* 机构代码
*/
private String spvOrganCode;
/**
* 所在省市区
*/
private String districtProvince;
private String districtCity;
private String districtArea;
/**
* 监管机构名称
*/
private String spvOrganName;
/**
* 机构联系人姓名
*/
private String contactName;
/**
* 联系人手机号
*/
private String contactTel;
/**
* 统一社会信用代码
*/
private String unifiedSocialCreditCode;
/**
* 机构联系人邮箱
*/
private String contactMail;
/**
* 银行账户名称
*/
private String accName;
/**
* 银行开户行名称
*/
private String bankAccName;
/**
* 银行账号
*/
private String bankNo;
}
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.SuperviseOrganEmpService; import com.hungraim.ltc.governance.service.SuperviseOrganEmpService;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan; import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan;
import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganEmpVO; import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganEmpVO;
import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganVO;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -92,13 +93,68 @@ public class SuperviseOrganEmpController { ...@@ -92,13 +93,68 @@ public class SuperviseOrganEmpController {
} }
/** /**
* 查询监管机构信息 * 监管机构信息列表
* *
* @param organId 适用机构id * @param organId 适用机构id
* @param spvOrganName 监管机构名称
*/ */
@RequestMapping("/superviseOrganEmpList") @RequestMapping("/superviseOrganEmpList")
public Result<List<ChSuperviseOrgan>> superviseOrganList(Long organId) { public Result<List<SuperviseOrganVO>> superviseOrganList(String organId, String spvOrganName) {
List<ChSuperviseOrgan> result = superviseOrganEmpService.superviseOrganList(organId); List<SuperviseOrganVO> result = superviseOrganEmpService.superviseOrganList(organId, spvOrganName);
return Result.success(result); return Result.success(result);
} }
/**
* 更改监管机构状态
*
* @param spvOrganId 监管机构id
* @param isLock 状态 有效:0;失效:1
*/
@DeleteMapping("/updateSpvStatus")
public Result updateSpvStatus(String spvOrganId, Short isLock) {
if (StringUtils.isBlank(spvOrganId) || isLock == null || (isLock != 1 && isLock != 0)) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
superviseOrganEmpService.updateSpvStatus(spvOrganId, isLock);
return Result.success();
}
/**
* 新增或编辑监管机构信息
*
* @param spvOrgan spvOrganId 监管机构id 没有就新增,有就编辑
* organId 适用机构id
* districtProvince 所在省
* districtCity 所在市
* districtArea 所在区
* spvOrganName 监管机构名称
* unifiedSocialCreditCode 统一社会信用代码
* contactName 机构联系人姓名
* contactTel 联系人手机号
* contactMail 机构联系人邮箱
* accName 银行账户名称
* bankAccName 银行开户行名称
* bankNo 银行账号
*/
@DeleteMapping("/insertOrUpdateSpvInfo")
public Result insertOrUpdateSpvInfo(ChSuperviseOrgan spvOrgan) {
//参数校验
if (StringUtils.isBlank(spvOrgan.getOrganId())) {//适用机构id
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(spvOrgan.getDistrictProvince()) || StringUtils.isBlank(spvOrgan.getDistrictCity()) || StringUtils.isBlank(spvOrgan.getDistrictArea())) {//所在省市区
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(spvOrgan.getSpvOrganName())) {//监管机构名称
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(spvOrgan.getContactName())) {//机构联系人姓名
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
if (StringUtils.isBlank(spvOrgan.getContactTel())) {//联系人手机号
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
superviseOrganEmpService.insertOrUpdateSpvInfo(spvOrgan);
return Result.success();
}
} }
...@@ -2,10 +2,14 @@ package com.hungraim.ltc.governance.dao; ...@@ -2,10 +2,14 @@ package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan; import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan;
import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper @Mapper
@Repository @Repository
public interface SuperviseOrganMapper extends BaseMapper<ChSuperviseOrgan> { public interface SuperviseOrganMapper extends BaseMapper<ChSuperviseOrgan> {
List<SuperviseOrganVO> superviseOrganList(List<String> organIds, String spvOrganName);
} }
...@@ -3,6 +3,7 @@ package com.hungraim.ltc.governance.service; ...@@ -3,6 +3,7 @@ package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan; import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan;
import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganEmpVO; import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganEmpVO;
import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganVO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -20,5 +21,9 @@ public interface SuperviseOrganEmpService { ...@@ -20,5 +21,9 @@ public interface SuperviseOrganEmpService {
void insertOrUpdateEmpInfo(Long empId, Long spvOrganId, String spvEmpName, String certifType, String certifNum, String gender, Short age, String superviseTel, Short status); void insertOrUpdateEmpInfo(Long empId, Long spvOrganId, String spvEmpName, String certifType, String certifNum, String gender, Short age, String superviseTel, Short status);
List<ChSuperviseOrgan> superviseOrganList(Long organId); List<SuperviseOrganVO> superviseOrganList(String organId, String spvOrganName);
void updateSpvStatus(String spvOrganId, Short isLock);
void insertOrUpdateSpvInfo(ChSuperviseOrgan spvOrgan);
} }
package com.hungraim.ltc.governance.service.impl; package com.hungraim.ltc.governance.service.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.dao.SuperviseOrganEmpMapper; import com.hungraim.ltc.governance.dao.SuperviseOrganEmpMapper;
import com.hungraim.ltc.governance.dao.SuperviseOrganMapper; import com.hungraim.ltc.governance.dao.SuperviseOrganMapper;
...@@ -9,6 +8,7 @@ import com.hungraim.ltc.governance.service.SuperviseOrganEmpService; ...@@ -9,6 +8,7 @@ import com.hungraim.ltc.governance.service.SuperviseOrganEmpService;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan; import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrgan;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrganEmp; import com.hungraim.ltc.pojo.entity.serviceManage.ChSuperviseOrganEmp;
import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganEmpVO; import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganEmpVO;
import com.hungraim.ltc.pojo.vo.governance.SuperviseOrganVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -74,11 +74,31 @@ public class SuperviseOrganServiceImpl implements SuperviseOrganEmpService { ...@@ -74,11 +74,31 @@ public class SuperviseOrganServiceImpl implements SuperviseOrganEmpService {
} }
@Override @Override
public List<ChSuperviseOrgan> superviseOrganList(Long organId) { public List<SuperviseOrganVO> superviseOrganList(String organId, String spvOrganName) {
if (organId == null) { List<String> organIds = null;
return superviseOrganMapper.selectList(new QueryWrapper<>()); if (StrUtil.isNotBlank(organId)) {
organIds = Arrays.asList(organId.split(","));
}
return superviseOrganMapper.superviseOrganList(organIds, spvOrganName);
}
@Override
public void updateSpvStatus(String spvOrganId, Short isLock) {
ChSuperviseOrgan chSuperviseOrgan = superviseOrganMapper.selectById(spvOrganId);
chSuperviseOrgan.setIsLock(isLock);
superviseOrganMapper.updateById(chSuperviseOrgan);
}
@Override
public void insertOrUpdateSpvInfo(ChSuperviseOrgan spvOrgan) {
if (spvOrgan.getSpvOrganId() != null) {
//更新
superviseOrganMapper.updateById(spvOrgan);
} else { } else {
return superviseOrganMapper.selectList(new QueryWrapper<ChSuperviseOrgan>().eq("ORGAN_ID", organId)); //新增
spvOrgan.setEffTime(new Date());
superviseOrganMapper.insert(spvOrgan);
} }
} }
} }
...@@ -31,8 +31,11 @@ ...@@ -31,8 +31,11 @@
LEFT JOIN ch_supervise_organ sOrgan ON emp.spv_organ_id = sOrgan.spv_organ_id --监管机构 LEFT JOIN ch_supervise_organ sOrgan ON emp.spv_organ_id = sOrgan.spv_organ_id --监管机构
LEFT JOIN ch_srv_organ organ ON sOrgan.organ_id = organ.organ_id --护理机构 LEFT JOIN ch_srv_organ organ ON sOrgan.organ_id = organ.organ_id --护理机构
<where> <where>
<if test="srvOrganId != null"> <if test="organIds != null">
and organ.SRV_ORGAN_ID = #{srvOrganId} and organ.SRV_ORGAN_ID in
<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
#{organId}
</foreach>
</if> </if>
<if test="organName != null and organName != ''"> <if test="organName != null and organName != ''">
and sOrgan.SPV_ORGAN_NAME = #{organName} and sOrgan.SPV_ORGAN_NAME = #{organName}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.governance.dao.SuperviseOrganMapper">
<!--监管机构人员信息列表-->
<select id="superviseOrganList" resultType="com.hungraim.ltc.pojo.vo.governance.SuperviseOrganVO">
SELECT--监管机构id
sOrgan.SPV_ORGAN_ID spvOrganId,
--适用机构
organ.srv_organ_name organName,
--机构代码
sOrgan.ORGAN_ID spvOrganCode,
--所在省市区
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE sOrgan.district_province = dis.DISTRICT_CODE) districtProvince,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE sOrgan.district_city = dis.DISTRICT_CODE) districtCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE sOrgan.district_area = dis.DISTRICT_CODE) districtArea,
--监管机构名称
sOrgan.SPV_ORGAN_NAME spvOrganName,
--机构联系人姓名
sOrgan.CONTACT_NAME contactName,
--联系人手机号
sOrgan.CONTACT_TEL contactTel,
--统一社会信用代码
sOrgan.UNIFIED_SOCIAL_CREDIT_CODE unifiedSocialCreditCode,
--机构联系人邮箱
sOrgan.CONTACT_MAIL contactMail,
--银行账户名称
sOrgan.ACC_NAME accName,
--银行开户行名称
sOrgan.BANK_ACC_NAME bankAccName,
--银行账号
sOrgan.BANK_NO bankNo
FROM
CH_SUPERVISE_ORGAN sOrgan --监管人员信息
LEFT JOIN ch_srv_organ organ ON sOrgan.organ_id = organ.organ_id --护理机构
where sOrgan.IS_LOCK = 0
<if test="organIds != null">
and sOrgan.organ_id in
<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
#{organId}
</foreach>
</if>
<if test="spvOrganName != null and spvOrganName != ''">
and sOrgan.SPV_ORGAN_NAME LIKE CONCAT('%',CONCAT( #{spvOrganName} ,'%'))
</if>
</select>
</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