Browse Source

Merge branch 'feature/rentalRevision'

master
wanggongfeng 3 years ago
parent
commit
dff5450cdf
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  2. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java
  3. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiRentContractInfoDao.java
  4. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java
  5. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java
  6. 75
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  7. 6
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiRentContractInfoDao.xml
  8. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml
  9. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -1050,7 +1050,7 @@
and LEVEL = 'community' and LEVEL = 'community'
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}
<if test="staffAgencyId != null and staffAgencyId != ''"> <if test="staffAgencyId != null and staffAgencyId != ''">
AND PIDS like concat('%',#{staffAgencyId},'%') AND (PIDS like concat('%',#{staffAgencyId},'%') or ID = #{staffAgencyId})
</if> </if>

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RentTenantFormDTO.java

@ -52,5 +52,4 @@ public class RentTenantFormDTO implements Serializable {
* 合同结束日期 * 合同结束日期
*/ */
private String endDate; private String endDate;
} }

3
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiRentContractInfoDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcResiRentContractInfoEntity; import com.epmet.entity.IcResiRentContractInfoEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 居民租房信息 * 居民租房信息
@ -13,4 +14,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface IcResiRentContractInfoDao extends BaseDao<IcResiRentContractInfoEntity> { public interface IcResiRentContractInfoDao extends BaseDao<IcResiRentContractInfoEntity> {
IcResiRentContractInfoEntity selectDetailByUserId(@Param("userId") String userId);
} }

4
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineDao.java

@ -87,4 +87,8 @@ public interface IcVaccineDao extends BaseDao<IcVaccineEntity> {
*/ */
List<YTVaccineListDTO> getExistVaccine(@Param("list")List<YTVaccineListDTO> list); List<YTVaccineListDTO> getExistVaccine(@Param("list")List<YTVaccineListDTO> list);
void deleteByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId);
List<String> setDeleteByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId);
} }

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVaccineRelationDao.java

@ -5,6 +5,8 @@ import com.epmet.entity.IcVaccineRelationEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 疫苗接种记录关系表 * 疫苗接种记录关系表
* *
@ -17,5 +19,11 @@ public interface IcVaccineRelationDao extends BaseDao<IcVaccineRelationEntity> {
void updateRelationInfoByVaccineId(IcVaccineRelationEntity icVaccineRelationEntity); void updateRelationInfoByVaccineId(IcVaccineRelationEntity icVaccineRelationEntity);
/**
* 根据ID删除数据
* @param delList
*/
void deleteByIdList(@Param("delList")List<String> delList);
} }

75
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -80,6 +80,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
@ -173,6 +174,15 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
@Autowired @Autowired
private DataReportOpenFeignClient dataReportOpenFeignClient; private DataReportOpenFeignClient dataReportOpenFeignClient;
@Autowired
private IcResiRentContractInfoDao icResiRentContractInfoDao;
@Autowired
private IcVaccineDao icVaccineDao;
@Autowired
private IcVaccineRelationDao icVaccineRelationDao;
private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) { private QueryWrapper<IcResiUserEntity> getWrapper(Map<String, Object> params) {
@ -2183,6 +2193,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return ConvertUtils.sourceToTarget(entityList, RentTenantDataResultDTO.class); return ConvertUtils.sourceToTarget(entityList, RentTenantDataResultDTO.class);
} }
@SneakyThrows
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String updateImage(TokenDto tokenDto, RentTenantFormDTO formDTO) { public String updateImage(TokenDto tokenDto, RentTenantFormDTO formDTO) {
@ -2222,6 +2233,70 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
images.forEach(item -> icResiUserAttachmentService.save(item)); images.forEach(item -> icResiUserAttachmentService.save(item));
} }
// 同步疫苗接种记录信息
IcResiUserDTO user = formDTO.getUser();
List<VaccineLogDetailDTO> vaccineLog = user.getVaccineLog();
if(vaccineLog != null && vaccineLog.size() > 0){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 根据身份证号,客户ID删除旧记录
icVaccineDao.deleteByIdCard(user.getIdCard(),user.getCustomerId());
// 删除疫苗接种记录关系表数据
List<String> delList = icVaccineDao.setDeleteByIdCard(user.getIdCard(),user.getCustomerId());
if(delList != null && delList.size() > 0){
icVaccineRelationDao.deleteByIdList(delList);
}
for(VaccineLogDetailDTO vaccineLogDetailDTO : vaccineLog){
// 插入疫苗接种记录数据
IcVaccineEntity icVaccineEntity = new IcVaccineEntity();
icVaccineEntity.setCustomerId(user.getCustomerId());
icVaccineEntity.setName(user.getName());
icVaccineEntity.setMobile(user.getMobile());
icVaccineEntity.setIdCard(user.getIdCard());
icVaccineEntity.setIsResiUser("1");
icVaccineEntity.setUserType("import");
icVaccineEntity.setUserId(resiUserId);
icVaccineEntity.setInoculateTime(sdf.parse(vaccineLogDetailDTO.getVacTime()));
icVaccineEntity.setInoculateAddress(vaccineLogDetailDTO.getVacSite());
icVaccineDao.insert(icVaccineEntity);
// 插入疫苗接种记录关系表数据
IcVaccineRelationEntity icVaccineRelationEntity = new IcVaccineRelationEntity();
icVaccineRelationEntity.setCustomerId(user.getCustomerId());
icVaccineRelationEntity.setAgencyId(formDTO.getUser().getAgencyId());
icVaccineRelationEntity.setPids(formDTO.getUser().getPids());
icVaccineRelationEntity.setIcVaccineId(icVaccineEntity.getId());
icVaccineRelationEntity.setUserType("prarmeter");
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo) {
logger.warn("未查询到工作人员信息" + resiUserId);
}
if(staffInfo.getAgencyId().equals(formDTO.getUser().getAgencyId())){
icVaccineRelationEntity.setIsLocalResiUser("1");
}else{
icVaccineRelationEntity.setIsLocalResiUser("0");
}
icVaccineRelationDao.insert(icVaccineRelationEntity);
}
}
// 同步合同信息
IcResiRentContractInfoEntity rentEntityOne = icResiRentContractInfoDao.selectDetailByUserId(resiUserId);
if(rentEntityOne == null){
IcResiRentContractInfoEntity rentEntity = new IcResiRentContractInfoEntity();
rentEntity.setIcResiUser(resiUserId);
rentEntity.setCustomerId(formDTO.getCustomerId());
rentEntity.setContractStartDate(formDTO.getStartDate());
rentEntity.setContractEndDate(formDTO.getEndDate());
icResiRentContractInfoDao.insert(rentEntity);
}else{
rentEntityOne.setCustomerId(formDTO.getCustomerId());
rentEntityOne.setContractStartDate(formDTO.getStartDate());
rentEntityOne.setContractEndDate(formDTO.getEndDate());
icResiRentContractInfoDao.updateById(rentEntityOne);
}
return resiUserId; return resiUserId;
} }

6
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiRentContractInfoDao.xml

@ -16,6 +16,12 @@
<result property="updatedBy" column="UPDATED_BY"/> <result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/> <result property="updatedTime" column="UPDATED_TIME"/>
</resultMap> </resultMap>
<select id="selectDetailByUserId" resultType="com.epmet.entity.IcResiRentContractInfoEntity">
select * from ic_resi_rent_contract_info where DEL_FLAG = 0 and IC_RESI_USER = #{userId} limit 1
</select>
</mapper> </mapper>

8
epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml

@ -244,4 +244,12 @@
<!-- </foreach>--> <!-- </foreach>-->
<!-- )--> <!-- )-->
</select> </select>
<delete id="deleteByIdCard">
update ic_vaccine set DEL_FLAG = '1' where CUSTOMER_ID = #{customerId} and ID_CARD = #{idCard}
</delete>
<select id="setDeleteByIdCard" resultType="java.lang.String">
select ID from ic_vaccine where CUSTOMER_ID = #{customerId} and ID_CARD = #{idCard}
</select>
</mapper> </mapper>

8
epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineRelationDao.xml

@ -17,5 +17,13 @@
set CUSTOMER_ID = #{customerId},USER_TYPE = #{userType} set CUSTOMER_ID = #{customerId},USER_TYPE = #{userType}
where IC_VACCINE_ID = #{icVaccineId} where IC_VACCINE_ID = #{icVaccineId}
</update> </update>
<delete id="deleteByIdList">
update ic_vaccine_relation set DEL_FLAG = '1' where ID in
<foreach collection="delList" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>

Loading…
Cancel
Save