Browse Source

我的家庭相关接口

master
wanggongfeng 3 years ago
parent
commit
175b43ca6a
  1. 1
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java
  2. 18
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/controller/AppFamilyController.java
  3. 4
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/dao/EpidemicUnitOwnerDao.java
  4. 3
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/EpidemicBuildingUnitService.java
  5. 10
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/EpidemicUnitOwnerService.java
  6. 1
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/impl/EpidemicBuildingUnitServiceImpl.java
  7. 26
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/impl/EpidemicUnitOwnerServiceImpl.java
  8. 24
      epdc-cloud-vim-yushan/src/main/resources/mapper/personroom/EpidemicUnitOwnerDao.xml

1
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/epidemic/service/impl/EpidemicUserInfoServiceImpl.java

@ -1703,6 +1703,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf
formDTO.setDeptName(parentAndAllDeptDTO.getGrid());
// 新增epidemic_user_info
EpidemicUserInfoEntity epidemicUserInfoEntity = ConvertUtils.sourceToTarget(formDTO, EpidemicUserInfoEntity.class);
epidemicUserInfoEntity.setDeptId(Long.parseLong(formDTO.getDeptId()));
baseDao.insert(epidemicUserInfoEntity);
// 新增epidemic_user_inout_record

18
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/controller/AppFamilyController.java

@ -24,6 +24,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.personroom.form.*;
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService;
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicBuildingUnitService;
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicUnitOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -44,6 +45,9 @@ public class AppFamilyController {
@Autowired
private EpidemicBuildingUnitService epidemicBuildingUnitService;
@Autowired
private EpidemicUnitOwnerService epidemicUnitOwnerService;
/**
* 获取成员信息
*
@ -128,5 +132,19 @@ public class AppFamilyController {
return epidemicUserInfoService.bindingFamily(formDTO);
}
/**
* 获取跳转方向
*
* @param formDTO
* @return
* @Author wanggongfeng
*/
@GetMapping("getSkipDirection")
public Result getSkipDirection(@RequestBody GetSkipDirectionFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
return epidemicUnitOwnerService.getSkipDirection(formDTO);
}
}

4
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/dao/EpidemicUnitOwnerDao.java

@ -18,6 +18,7 @@
package com.elink.esua.epdc.vaccine.personroom.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.personroom.form.GetSkipDirectionFormDTO;
import com.elink.esua.epdc.dto.personroom.result.FamilyMemberInfoResultDTO;
import com.elink.esua.epdc.vaccine.personroom.entity.EpidemicUnitOwnerEntity;
import org.apache.ibatis.annotations.Mapper;
@ -82,4 +83,7 @@ public interface EpidemicUnitOwnerDao extends BaseDao<EpidemicUnitOwnerEntity> {
*/
List<FamilyMemberInfoResultDTO> getFamilyMemberInfoByUnitId(@Param("unitId") Long unitId);
Integer getCurrentBouseNum(GetSkipDirectionFormDTO formDTO);
Integer getNotCurrentBouseNum(GetSkipDirectionFormDTO formDTO);
}

3
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/EpidemicBuildingUnitService.java

@ -23,6 +23,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.epidemic.DictOptionDTO;
import com.elink.esua.epdc.dto.personroom.EpidemicBuildingUnitDTO;
import com.elink.esua.epdc.dto.personroom.form.GetHouseInfoFormDTO;
import com.elink.esua.epdc.dto.personroom.form.GetSkipDirectionFormDTO;
import com.elink.esua.epdc.dto.personroom.form.HouseInfoFormDTO;
import com.elink.esua.epdc.dto.personroom.form.HouseQrcodeZipFormDTO;
import com.elink.esua.epdc.dto.personroom.result.EpidemicBuildingUnitDetailResultDTO;
@ -210,4 +211,6 @@ public interface EpidemicBuildingUnitService extends CrudService<EpidemicBuildin
}

10
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/EpidemicUnitOwnerService.java

@ -20,7 +20,9 @@ package com.elink.esua.epdc.vaccine.personroom.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.personroom.EpidemicUnitOwnerDTO;
import com.elink.esua.epdc.dto.personroom.form.GetSkipDirectionFormDTO;
import com.elink.esua.epdc.vaccine.personroom.entity.EpidemicUnitOwnerEntity;
import java.util.List;
@ -125,4 +127,12 @@ public interface EpidemicUnitOwnerService extends BaseService<EpidemicUnitOwnerE
* @date 2022/6/6 10:12
*/
void deletePhysicalByIdCardAndUnitId(String idCard, Long unitId);
/**
* 获取跳转方向
* @param formDTO
* @return
*/
Result getSkipDirection(GetSkipDirectionFormDTO formDTO);
}

1
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/impl/EpidemicBuildingUnitServiceImpl.java

@ -38,6 +38,7 @@ import com.elink.esua.epdc.dto.house.result.EpdcPopulationErrorResultDTO;
import com.elink.esua.epdc.dto.personroom.EpidemicBuildingUnitDTO;
import com.elink.esua.epdc.dto.personroom.EpidemicUnitOwnerDTO;
import com.elink.esua.epdc.dto.personroom.form.GetHouseInfoFormDTO;
import com.elink.esua.epdc.dto.personroom.form.GetSkipDirectionFormDTO;
import com.elink.esua.epdc.dto.personroom.form.HouseInfoFormDTO;
import com.elink.esua.epdc.dto.personroom.form.HouseQrcodeZipFormDTO;
import com.elink.esua.epdc.dto.personroom.result.*;

26
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/personroom/service/impl/EpidemicUnitOwnerServiceImpl.java

@ -23,7 +23,10 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.personroom.EpidemicUnitOwnerDTO;
import com.elink.esua.epdc.dto.personroom.form.GetSkipDirectionFormDTO;
import com.elink.esua.epdc.dto.personroom.result.GetSkipDirectionResultDTO;
import com.elink.esua.epdc.vaccine.personroom.dao.EpidemicUnitOwnerDao;
import com.elink.esua.epdc.vaccine.personroom.entity.EpidemicUnitOwnerEntity;
import com.elink.esua.epdc.vaccine.personroom.redis.EpidemicUnitOwnerRedis;
@ -121,4 +124,27 @@ public class EpidemicUnitOwnerServiceImpl extends BaseServiceImpl<EpidemicUnitOw
public void deletePhysicalByIdCardAndUnitId(String idCard, Long unitId) {
baseDao.deletePhysicalByIdCardAndUnitId(idCard, unitId);
}
@Override
public Result<GetSkipDirectionResultDTO> getSkipDirection(GetSkipDirectionFormDTO formDTO) {
/**
* 1. 留在当前页面进行注册绑定
* 2. 跳转到 该房屋信息的页面
* 3. 显示 无权访问
*/
GetSkipDirectionResultDTO getSkipDirectionResultDTO = new GetSkipDirectionResultDTO();
// 获取是否绑定当前房屋
Integer isCurrentBouse = baseDao.getCurrentBouseNum(formDTO);
// 获取是否绑定非当前房屋
Integer isNotCurrentBouse = baseDao.getNotCurrentBouseNum(formDTO);
if(isCurrentBouse > 0){
getSkipDirectionResultDTO.setType("2");
}else if(isNotCurrentBouse > 0){
getSkipDirectionResultDTO.setType("3");
}else{
getSkipDirectionResultDTO.setType("1");
}
return new Result<GetSkipDirectionResultDTO>().ok(getSkipDirectionResultDTO);
}
}

24
epdc-cloud-vim-yushan/src/main/resources/mapper/personroom/EpidemicUnitOwnerDao.xml

@ -83,4 +83,28 @@
where ui.DEL_FLAG = '0'
and ui.ID_CARD in (select euo.ID_CARD from epidemic_unit_owner euo where euo.DEL_FLAG = '0' and euo.UNIT_ID = #{unitId})
</select>
<select id="getCurrentBouseNum" resultType="java.lang.Integer"
parameterType="com.elink.esua.epdc.dto.personroom.form.GetSkipDirectionFormDTO">
select
count(ow.ID)
from epidemic_unit_owner ow
left join epidemic_building_unit un on ow.UNIT_ID = un.ID and un.DEL_FLAG = '0'
where ow.DEL_FLAG = '0'
and ow.ID_CARD = #{idCard}
and un.ROOM_CODE = #{roomCode}
</select>
<select id="getNotCurrentBouseNum" resultType="java.lang.Integer"
parameterType="com.elink.esua.epdc.dto.personroom.form.GetSkipDirectionFormDTO">
select
count(ow.ID)
from epidemic_unit_owner ow
left join epidemic_building_unit un on ow.UNIT_ID = un.ID and un.DEL_FLAG = '0'
where ow.DEL_FLAG = '0'
and ow.ID_CARD = #{idCard}
and un.ROOM_CODE != #{roomCode}
</select>
</mapper>

Loading…
Cancel
Save