出租屋清洗--第一版

develop
Angel 10 months ago
parent 597f18b651
commit d57ff4141b

@ -13,14 +13,15 @@ zdrySwitch=false
cyrySwitch=false
JjxxSwitch=false
#------------------------?????----------------------------
NewNsydwSwitch=true
metaImpUserSwitch=true
NewNalarminfoSwitch=true
metaHandleAlarmSwitch=true
metaActualUnitUserInfoSwitch=true
metaActualUserInfoSwitch=true
NewNsydwSwitch=false
metaImpUserSwitch=false
NewNalarminfoSwitch=false
metaHandleAlarmSwitch=false
metaActualUnitUserInfoSwitch=false
metaActualUserInfoSwitch=false
actualTimecjxxSwitch=false
actualTimejjxxSwitch=false
RentalHouseSwitch=true

@ -0,0 +1,177 @@
package com.ssf.mysqloracletest.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
* @TableName meta_rental_housing_info
*/
@TableName(value ="meta_rental_housing_info")
@Data
public class MetaRentalHousingInfo implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
*
*/
private String rentalHousingAddress;
/**
*
*/
private String homeowner;
/**
*
*/
private String homeownerIdCard;
/**
*
*/
private String homeownerHouseHoldRegister;
/**
*
*/
private String homeownerHouseHoldAddress;
/**
*
*/
private String homeownerHabitationRegister;
/**
*
*/
private String homeownerHabitationAddress;
/**
*
*/
private String homeownerPhone;
/**
* :0,1
*/
private Integer stateFlag;
/**
*
*/
private String rentalHousingEndDate;
/**
*
*/
private String policeStationCode;
/**
*
*/
private String policeDistrictCode;
/**
* ID
*/
private String floatingPopulationStandardAddressId;
/**
*
*/
private String floatingPopulationStandardAddress;
/**
*
*/
private Integer rentalHousingStatus;
/**
*
*/
private Integer isRentalHousing;
/**
*
*/
private Integer residentialType;
/**
*
*/
private Integer rentalHousingGrade;
/**
*
*/
private Integer impRentalHousing;
/**
*
*/
private Integer impUserRentalHousing;
/**
*
*/
private Integer isGroupRentalHousing;
/**
*
*/
private Integer rentalHousingType;
/**
*
*/
private String rentingHouseUserName;
/**
*
*/
private String rentingHouseUserPhone;
/**
*
*/
private String rentingHouseUserIdCard;
/**
*
*/
private Date createTime;
/**
*
*/
private Integer createBy;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer updateBy;
/**
* 0:,1:
*/
private Integer isActive;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

@ -1,6 +1,8 @@
package com.ssf.mysqloracletest.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
@ -12,140 +14,142 @@ import lombok.Data;
*/
@Data
@TableName(value = "v_sy_syfw")
public class VSySyfwMysql {
@TableField(value = "ZJLID")
private String ZJLID;
@TableField(value = "YSXTJRZJ")
private String YSXTJRZJ;
@TableField(value = "XXSC_PDBZ")
private String XXSC_PDBZ;
@TableField(value = "DAH")
private String DAH;
@TableField(value = "JCWH")
private String JCWH;
@TableField(value = "FWID")
private String FWID;
@TableField(value = "FWLX")
private String FWLX;
@TableField(value = "FWDZ")
private String FWDZ;
@TableField(value = "FWXZ")
private String FWXZ;
@TableField(value = "FWLB")
private String FWLB;
@TableField(value = "FWJG")
private String FWJG;
@TableField(value = "FJS")
private String FJS;
@TableField(value = "MJ")
private String MJ;
@TableField(value = "CZYT")
private String CZYT;
@TableField(value = "DJRQ")
private String DJRQ;
//姓名
@TableField(value = "XM")
private String XM;
@TableField(value = "SFZH")
private String SFZH;
@TableField(value = "XB")
private String XB;
@TableField(value = "HJDQX")
private String HJDQX;
@TableField(value = "HJDXZ")
private String HJDXZ;
@TableField(value = "XZDQX")
private String XZDQX;
@TableField(value = "XZDXZ")
private String XZDXZ;
@TableField(value = "DWMC")
private String DWMC;
@TableField(value = "DWXZ")
private String DWXZ;
@TableField(value = "LXDH")
private String LXDH;
@TableField(value = "LRRID")
private String LRRID;
@TableField(value = "LRR")
private String LRR;
@TableField(value = "LRSJ")
private String LRSJ;
@TableField(value = "XGRID")
private String XGRID;
@TableField(value = "XGRXM")
private String XGRXM;
@TableField(value = "XGSJ")
private String XGSJ;
@TableField(value = "TBBS")
private String TBBS;
@TableField(value = "TBSJ")
private String TBSJ;
@TableField(value = "MEMO")
private String MEMO;
@TableField(value = "BZ")
private String BZ;
@TableField(value = "DQRQ")
private String DQRQ;
@TableField(value = "SJFWID")
private String SJFWID;
@TableField(value = "DYHCODE")
private String DYHCODE;
@TableField(value = "PCSDM")
private String PCSDM;
@TableField(value = "JWQID")
private String JWQID;
@TableField(value = "SSYS")
private String SSYS;
@TableField(value = "SNO")
private String SNO;
@TableField(value = "ZXRQ")
private String ZXRQ;
@TableField(value = "ZXYY")
private String ZXYY;
@TableField(value = "LKBZDZID")
private String LKBZDZID;
@TableField(value = "LKBZDZMC")
private String LKBZDZMC;
@TableField(value = "FWZT")
private String FWZT;
@TableField(value = "CZFWBM")
private String CZFWBM;
@TableField(value = "CZFWQM")
private String CZFWQM;
@TableField(value = "TBMEMO")
private String TBMEMO;
@TableField(value = "SFCZ")
private String SFCZ;
@TableField(value = "JZLX")
private String JZLX;
@TableField(value = "FWDJ")
private String FWDJ;
@TableField(value = "ZDFW")
private String ZDFW;
@TableField(value = "ZDRY")
private String ZDRY;
@TableField(value = "SFQZ")
private String SFQZ;
@TableField(value = "ZJLX")
private String ZJLX;
@TableField(value = "ZFLX")
private String ZFLX;
@TableField(value = "CWS")
private String CWS;
@TableField(value = "CZRZJLX")
private String CZRZJLX;
@TableField(value = "CZRZJHM")
private String CZRZJHM;
@TableField(value = "CZRXM")
private String CZRXM;
@TableField(value = "CZRLXDH")
private String CZRLXDH;
@TableField(value = "CDC_JYM")
private String CDC_JYM;
@TableField(value = "YSBZK_RKSJ")
private String YSBZK_RKSJ;
@TableField(value = "YSBZK_GXSJ")
private String YSBZK_GXSJ;
@TableField(value = "STATUS")
private String STATUS;
}

@ -0,0 +1,22 @@
package com.ssf.mysqloracletest.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ssf.mysqloracletest.domain.MetaRentalHousingInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author 10503
* @description meta_rental_housing_info()Mapper
* @createDate 2023-12-04 10:11:22
* @Entity com.ssf.mysqloracletest.domain.MetaRentalHousingInfo
*/
@Mapper
public interface MetaRentalHousingInfoMapper extends BaseMapper<MetaRentalHousingInfo> {
}

@ -20,5 +20,6 @@ public interface VSySyfwMysqlMapper extends BaseMapper<VSySyfwMysql> {
public int insertVSySyfw(VSySyfwMysql bean);
public int updateVSySyfwById(VSySyfwMysql bean);
public int countSyfw();
}

@ -0,0 +1,13 @@
package com.ssf.mysqloracletest.service;
import com.ssf.mysqloracletest.domain.MetaRentalHousingInfo;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author 10503
* @description meta_rental_housing_info()Service
* @createDate 2023-12-04 10:11:22
*/
public interface MetaRentalHousingInfoService extends IService<MetaRentalHousingInfo> {
}

@ -16,5 +16,8 @@ public interface VSySyfwMysqlService extends IService<VSySyfwMysql> {
public int insertVSySyfw(VSySyfwMysql syfw);
public int updateVSySyfwById(VSySyfwMysql syfw);
public int countSyfw();
}

@ -0,0 +1,23 @@
package com.ssf.mysqloracletest.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ssf.mysqloracletest.domain.MetaRentalHousingInfo;
import com.ssf.mysqloracletest.service.MetaRentalHousingInfoService;
import com.ssf.mysqloracletest.mapper.MetaRentalHousingInfoMapper;
import org.springframework.stereotype.Service;
/**
* @author 10503
* @description meta_rental_housing_info()Service
* @createDate 2023-12-04 10:11:22
*/
@Service
public class MetaRentalHousingInfoServiceImpl extends ServiceImpl<MetaRentalHousingInfoMapper, MetaRentalHousingInfo>
implements MetaRentalHousingInfoService{
}

@ -40,5 +40,10 @@ public class VSySyfwMysqlServiceImpl extends ServiceImpl<VSySyfwMysqlMapper, VSy
public int updateVSySyfwById(VSySyfwMysql syfw) {
return sySyfwMysqlMapper.updateVSySyfwById(syfw);
}
@Override
public int countSyfw() {
return sySyfwMysqlMapper.countSyfw();
}
}

@ -0,0 +1,157 @@
package com.ssf.mysqloracletest.task;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ssf.mysqloracletest.domain.MetaRentalHousingInfo;
import com.ssf.mysqloracletest.domain.VSySyfwMysql;
import com.ssf.mysqloracletest.service.MetaRentalHousingInfoService;
import com.ssf.mysqloracletest.service.VSySyfwMysqlService;
import com.ssf.mysqloracletest.utils.ConfigParam;
import com.ssf.mysqloracletest.utils.NumKit;
import com.ssf.mysqloracletest.utils.StringKit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Component
public class RentalHousingTask {
private static final Logger logger = LoggerFactory.getLogger(RentalHousingTask.class);
@Resource
private VSySyfwMysqlService syfwMysqlService;
@Resource
private MetaRentalHousingInfoService rentalHousingInfoService;
final int oncesCounts = NumKit.checkInt(ConfigParam.oncesCounts) == 0 ? 10000 : NumKit.checkInt(ConfigParam.oncesCounts);
private boolean rentalhouseTag = false;
@Scheduled(initialDelay = 100, fixedDelay = 3000)
public void transRentalHouse() {
if (rentalhouseTag) {
return;
}
if (!"true".equals(ConfigParam.RentalHouseSwitch)) {
return;
}
try {
int countRentalHouse = syfwMysqlService.countSyfw();
logger.info("countRentalHouse:" + countRentalHouse);
if (countRentalHouse > 0) {
rentalhouseTag = true;
int count = countRentalHouse / oncesCounts;
CountDownLatch latch = new CountDownLatch(count);
ExecutorService RentalHousePool = Executors.newFixedThreadPool(50);
for (int i = 0; i <= count; i++) {
Map HouseMap = new HashMap();
HouseMap.put("rowStart", i * oncesCounts);
HouseMap.put("rowEnd", (i + 1) * oncesCounts);
RentalHousePool.submit(() -> {
try {
//List<VSySyfwMysql> RentalHouses = syfwMysqlService.lambdaQuery().isNull(VSySyfwMysql::getSTATUS).list();
// 创建分页参数
Page<VSySyfwMysql> page = new Page<>(1, 1000);
// 构建查询条件
QueryWrapper<VSySyfwMysql> queryWrapper = new QueryWrapper<>();
queryWrapper.isNull("STATUS");
// 进行分页查询
syfwMysqlService.page(page, queryWrapper);
// 获取分页查询结果
List<VSySyfwMysql> rentalHouses = page.getRecords();
if (rentalHouses == null) {
return;
}
for (VSySyfwMysql House : rentalHouses) {
MetaRentalHousingInfo metaRentalHousingInfo = new MetaRentalHousingInfo();
//rental_housing_address出租房屋地址<-----FWDZ房屋地址
metaRentalHousingInfo.setRentalHousingAddress(House.getFWDZ());
//homeowner房主<-----XM
metaRentalHousingInfo.setHomeowner(House.getXM());
//homeowner_id_card房主身份证<-----SFZH
metaRentalHousingInfo.setHomeownerIdCard(House.getSFZH());
//homeowner_house_hold_register房主户籍地区县<-----HJDQX户籍辖区
metaRentalHousingInfo.setHomeownerHouseHoldRegister(House.getHJDQX());
//homeowner_house_hold_address户籍地址详情<-----HJDXZ户籍地详址
metaRentalHousingInfo.setHomeownerHouseHoldAddress(House.getHJDXZ());
//homeowner_habitation_register房主现居住地区县<-----XZDQX现住地辖区
metaRentalHousingInfo.setHomeownerHabitationRegister(House.getXZDQX());
//homeowner_habitation_address房主现居住地<-----XZDXZ现住地详址
metaRentalHousingInfo.setHomeownerHabitationAddress(House.getXZDXZ());
//homeowner_phone房主联系方式<-----LXDH联系电话
metaRentalHousingInfo.setHomeownerPhone(House.getLXDH());
//state_flag表示状态:0有效1无效<-----BZ
metaRentalHousingInfo.setStateFlag(Integer.parseInt(House.getBZ()));
//rental_housing_end_date出租房到期时间<-----DQRQ
metaRentalHousingInfo.setRentalHousingEndDate(House.getDQRQ());
//police_station_code派出所代码<-----PCSDM
metaRentalHousingInfo.setPoliceStationCode(House.getPCSDM());
//police_district_code警务区编码<-----JWQID
metaRentalHousingInfo.setPoliceDistrictCode(House.getJWQID());
//floating_population_standard_address_id流动人口标准地址id<-----LKBZDZID
metaRentalHousingInfo.setFloatingPopulationStandardAddressId(House.getLKBZDZID());
//floating_population_standard_address流动人口标准地址<-----LKBZDZMC
metaRentalHousingInfo.setFloatingPopulationStandardAddress(House.getLKBZDZMC());
//rental_housing_status出租房状态<-----FWZT
metaRentalHousingInfo.setRentalHousingStatus(Integer.parseInt(House.getFWZT()));
//is_rental_housing是否出租<-----SFCZY,N
metaRentalHousingInfo.setIsRentalHousing(Integer.parseInt(House.getSFCZ()));
//residential_type居住类型<-----JZLX
metaRentalHousingInfo.setResidentialType(Integer.parseInt(House.getJZLX()));
//rental_housing_grade房屋等级<-----FWDJ
metaRentalHousingInfo.setRentalHousingGrade(Integer.parseInt(House.getFWDJ()));
//imp_rental_housing重点房屋<-----ZDFW
metaRentalHousingInfo.setImpRentalHousing(Integer.parseInt(House.getZDFW()));
//imp_user_rental_housing重点人员<-----ZDRY
metaRentalHousingInfo.setImpUserRentalHousing(Integer.parseInt(House.getZDRY()));
//is_group_rental_housing是否群租房<-----SFQZ
metaRentalHousingInfo.setIsGroupRentalHousing(Integer.parseInt(House.getSFQZ()));
//rental_housing_type住房类型<-----ZFLX
metaRentalHousingInfo.setRentalHousingType(Integer.parseInt(House.getZFLX()));
//renting_house_user_name租房人姓名<----- CZRXM
metaRentalHousingInfo.setRentingHouseUserName(House.getCZRXM());
//renting_house_user_phone租房人联系方式<-----CZRLXDH
metaRentalHousingInfo.setRentingHouseUserPhone(House.getCZRLXDH());
//renting_house_user_id_card租房人证件号码<-----CZRZJHM
metaRentalHousingInfo.setRentingHouseUserIdCard(House.getCZRZJHM());
//将STATUS设成1
House.setSTATUS("1");
logger.info("插入成功");
}
} catch (Exception e) {
logger.info("rentalHouses"+ StringKit.getTrace(e));
}
latch.countDown();
});
logger.info("rentalhouseTag数据总理:" + countRentalHouse + "," + "当前处理下标:" + HouseMap.get("rowStart") + "/" + HouseMap.get("rowEnd"));
}
try {
//Wait for all threads to complete
latch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
//关闭线程池
RentalHousePool.shutdown();
}
} catch (Exception e) {
logger.info(StringKit.getTrace(e));
}
}
}

@ -36,5 +36,8 @@ public class ConfigParam {
//CJ实时数据开关
public static String actualTimecjxxSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("actualTimecjxxSwitch"));
public static String actualTimejjxxSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("actualTimejjxxSwitch"));
//rentalHouse数据清洗开关
public static String RentalHouseSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("RentalHouseSwitch"));
}

@ -71,6 +71,7 @@
<result property="YSBZK_RKSJ" column="YSBZK_RKSJ"/>
<result property="YSBZK_GXSJ" column="YSBZK_GXSJ"/>
<result property="STATUS" column="STATUS"/>
</resultMap>
<select id="selectVSySyfwById" parameterType="java.lang.String" resultMap="VSySyfwResult">
@ -151,6 +152,7 @@
<if test="CDC_JYM != null and CDC_JYM != '' ">CDC_JYM,</if>
<if test="YSBZK_RKSJ != null and YSBZK_RKSJ != '' ">YSBZK_RKSJ,</if>
<if test="YSBZK_GXSJ != null and YSBZK_GXSJ != '' ">YSBZK_GXSJ,</if>
<if test="STATUS != null and STATUS != '' ">STATUS,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -221,7 +223,7 @@
<if test="CDC_JYM != null and CDC_JYM != '' ">#{CDC_JYM},</if>
<if test="YSBZK_RKSJ != null and YSBZK_RKSJ != '' ">#{YSBZK_RKSJ},</if>
<if test="YSBZK_GXSJ != null and YSBZK_GXSJ != '' ">#{YSBZK_GXSJ},</if>
</trim>
c </trim>
</insert>
<update id="updateVSySyfwById" parameterType="com.ssf.mysqloracletest.domain.VSySyfwMysql">
@ -294,8 +296,15 @@
<if test="CDC_JYM != null and CDC_JYM != '' ">CDC_JYM=#{CDC_JYM},</if>
<if test="YSBZK_RKSJ != null and YSBZK_RKSJ != '' ">YSBZK_RKSJ=#{YSBZK_RKSJ},</if>
<if test="YSBZK_GXSJ != null and YSBZK_GXSJ != '' ">YSBZK_GXSJ=#{YSBZK_GXSJ},</if>
<if test="STATUS != null and STATUS != '' ">STATUS=#{STATUS},</if>
</trim>
where ZJLID = #{ZJLID}
</update>
<select id="countSyfw" resultType="int">
select count(*)
from V_SY_SYFW
</select>
</mapper>
Loading…
Cancel
Save