宜都城投资产数据同步插件 修复一些问题
This commit is contained in:
@@ -11,6 +11,8 @@ public enum YdzbdataSyncConstants {
|
||||
contractFormNo("zcbd3","合同表单编号"),
|
||||
feeTable("formmain_0018","费用表表名"),
|
||||
feeFormNo("zcbd2","费用表单编号"),
|
||||
zcRootEnumPCode("9039506777142151368","资产档案枚举编码"),
|
||||
cwRootEnumPCode("-8314591789812725552","财务档案枚举编码")
|
||||
;
|
||||
YdzbdataSyncConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FormExportUtil {
|
||||
for (String key : keys) {
|
||||
valueExport = new ValueExport();
|
||||
valueExport.setDisplayName(key);
|
||||
valueExport.setValue(map.get(key));
|
||||
valueExport.setValue("null".equals(map.get(key)) ? "" : map.get(key));
|
||||
valueExports.add(valueExport);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,19 +3,32 @@ package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
import com.seeyon.ctp.util.JDBCAgent;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class AbstractAssetDataMapMode extends AbstractDataMapMode{
|
||||
|
||||
protected JDBCAgent agent;
|
||||
protected String zcRootPcode;
|
||||
|
||||
public String getZcRootPcode() {
|
||||
return zcRootPcode;
|
||||
}
|
||||
|
||||
public void setZcRootPcode(String zcRootPcode) {
|
||||
this.zcRootPcode = zcRootPcode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
Object houseStatus = map.get("house_status");
|
||||
Object propertyMortgage = map.get("property_mortgage");
|
||||
String zcStatus = houseStatus == null ? "" : EnumMapUtils.getEnumItemValue(agent,"资产状态", (String) houseStatus);
|
||||
String isPublicAsset = EnumMapUtils.getEnumItemValue(agent,"是否公用产权","否");
|
||||
String assetBacked = propertyMortgage == null ? "" : EnumMapUtils.getEnumItemValue(agent,"是否产权抵押", (String) propertyMortgage);
|
||||
String zcStatus = houseStatus == null ? "" : EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产状态", (String) houseStatus);
|
||||
String isPublicAsset = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"是否公用产权","否");
|
||||
String assetBacked = propertyMortgage == null ? "" : EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"是否产权抵押", (String) propertyMortgage);
|
||||
map.put("house_status",zcStatus);
|
||||
map.put("isPublicAsset",isPublicAsset);
|
||||
map.put("assetBacked",assetBacked);
|
||||
@@ -49,17 +62,22 @@ public abstract class AbstractAssetDataMapMode extends AbstractDataMapMode{
|
||||
}
|
||||
stringBuilder.append(sourceMap.get("room_number"));
|
||||
}
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
targetMap.put("资产名称",stringBuilder.toString()); //填充资产名称
|
||||
targetMap.put("资产状态",sourceMap.get("house_status"));//填充资产状态
|
||||
targetMap.put("产权证号",sourceMap.get("property_certificate_no"));//填充产权证号
|
||||
targetMap.put("充产权人",sourceMap.get("property_owner"));//填充产权人
|
||||
targetMap.put("登记时间",sourceMap.get("property_registration_time"));//填充登记时间
|
||||
try {
|
||||
targetMap.put("资产获取日期",df.format((Date)sourceMap.get("house_receipt_date")));//填充资产获取日期
|
||||
targetMap.put("登记时间",df.format((Date)sourceMap.get("property_registration_time")));//填充登记时间
|
||||
}catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
targetMap.put("是否公用产权",sourceMap.get("isPublicAsset"));//填充是否公用产权
|
||||
targetMap.put("是否产权抵押",sourceMap.get("property_mortgage"));//填充是否产权抵押
|
||||
targetMap.put("是否产权抵押",sourceMap.get("assetBacked"));//填充是否产权抵押
|
||||
targetMap.put("建筑面积",sourceMap.get("house_area"));//填充建筑面积
|
||||
targetMap.put("备注-资产信息",sourceMap.get("remark"));//填充备注资产信息
|
||||
targetMap.put("数公基19位编码",sourceMap.get("sgjbm"));//填充数公基19位编码
|
||||
targetMap.put("资产获取日期",sourceMap.get("house_receipt_date"));//填充资产获取日期
|
||||
targetMap.put("账面价值",sourceMap.get("paper_value"));//填充账面价值
|
||||
targetMap.put("租赁基准价格",sourceMap.get("rent_benchmark"));//填充租赁基准价格
|
||||
// targetMap.put("field0061",sourceMap.get(""));//填充管理单位编号
|
||||
|
||||
@@ -5,6 +5,15 @@ import com.seeyon.ctp.util.JDBCAgent;
|
||||
public abstract class AbstractContractDataMapMode extends AbstractDataMapMode{
|
||||
|
||||
protected JDBCAgent agent;
|
||||
protected String zcRootPcode;
|
||||
|
||||
public String getZcRootPcode() {
|
||||
return zcRootPcode;
|
||||
}
|
||||
|
||||
public void setZcRootPcode(String zcRootPcode) {
|
||||
this.zcRootPcode = zcRootPcode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commonAttrTransfer(Object target, Object source) {
|
||||
|
||||
@@ -7,6 +7,15 @@ import java.util.Map;
|
||||
public abstract class AbstractFeeDataMapMode extends AbstractDataMapMode{
|
||||
|
||||
protected JDBCAgent agent;
|
||||
protected String cwRootPcode;
|
||||
|
||||
public String getCwRootPcode() {
|
||||
return cwRootPcode;
|
||||
}
|
||||
|
||||
public void setCwRootPcode(String cwRootPcode) {
|
||||
this.cwRootPcode = cwRootPcode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
|
||||
@@ -12,6 +12,8 @@ import com.seeyon.ctp.util.JDBCAgent;
|
||||
import com.seeyon.v3x.services.form.FormFactory;
|
||||
import com.seeyon.v3x.services.form.bean.FormExport;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -45,22 +47,22 @@ public class BzfAssetMode extends AbstractAssetDataMapMode{
|
||||
}
|
||||
|
||||
private void enumMap(Map<String, Object> sourceMap) {
|
||||
String xqzcpLevelValue = EnumMapUtils.getEnumItemValue(agent,"资产层级","父级");
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(agent,"资产类型","房屋");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(agent,"资产二级类型","保障性住房");
|
||||
String xqzcBlock = EnumMapUtils.getEnumItemValue(agent,"资产板块","03不动产");
|
||||
String xqzcStatus = EnumMapUtils.getEnumItemValue(agent,"资产状态","待出租");
|
||||
String xqzcFeature = EnumMapUtils.getEnumItemValue(agent,"资产性质","非流动资产");
|
||||
String xqzz = EnumMapUtils.getEnumItemValue(agent,"用途","住宅");
|
||||
String house_use = EnumMapUtils.getEnumItemValue(agent,"用途", (String) sourceMap.get("house_use"));
|
||||
String rental_type = EnumMapUtils.getEnumItemValue(agent,"租售类型",(String) sourceMap.get("rental_type"));
|
||||
String xqrental_type = EnumMapUtils.getEnumItemValue(agent,"租售类型","只租不售");
|
||||
String xqhs = EnumMapUtils.getEnumItemValue(agent,"房屋体系","保租房");
|
||||
String hs = EnumMapUtils.getEnumItemValue(agent,"房屋体系",(String) sourceMap.get("house_system"));
|
||||
String land_nature = EnumMapUtils.getEnumItemValue(agent,"土地性质", (String) sourceMap.get("land_nature"));
|
||||
String house_type = EnumMapUtils.getEnumItemValue(agent,"户型", (String) sourceMap.get("house_type"));
|
||||
String has_lift = EnumMapUtils.getEnumItemValue(agent,"有无电梯", (String) sourceMap.get("has_lift"));
|
||||
String raise_way = EnumMapUtils.getEnumItemValue(agent,"筹集方式", (String) sourceMap.get("raise_way"));
|
||||
String xqzcpLevelValue = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产层级","父级");
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产类型","房屋");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产二级类型","保障性住房");
|
||||
String xqzcBlock = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产板块","03不动产");
|
||||
String xqzcStatus = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产状态","待出租");
|
||||
String xqzcFeature = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产性质","非流动资产");
|
||||
String xqzz = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"用途","住宅");
|
||||
String house_use = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"用途", (String) sourceMap.get("house_use"));
|
||||
String rental_type = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"租售类型",(String) sourceMap.get("rental_type"));
|
||||
String xqrental_type = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"租售类型","只租不售");
|
||||
String xqhs = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"房屋体系","保租房");
|
||||
String hs = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"房屋体系",(String) sourceMap.get("house_system"));
|
||||
String land_nature = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"土地性质", (String) sourceMap.get("land_nature"));
|
||||
String house_type = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"户型", (String) sourceMap.get("house_type"));
|
||||
String has_lift = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"有无电梯", (String) sourceMap.get("has_lift"));
|
||||
String raise_way = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"筹集方式", (String) sourceMap.get("raise_way"));
|
||||
sourceMap.put("xqzcpLevel",xqzcpLevelValue);
|
||||
sourceMap.put("zcTypeFwValue",zcTypeFwValue);
|
||||
sourceMap.put("zcTypeLevel2",zcTypeLevel2);
|
||||
@@ -96,12 +98,13 @@ public class BzfAssetMode extends AbstractAssetDataMapMode{
|
||||
String villageQuerySql = "SELECT 1 FROM "+ table +" WHERE field0027 = ? and field0023 = ? and field0037 =?;";
|
||||
agent.execute(villageQuerySql, params);
|
||||
List resList = agent.resultSetToList();
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if(resList == null || resList.size() == 0) {
|
||||
//保障性住房小区的资产信息若不存在,则插入
|
||||
Map<String,String> villageInsertInfo = new HashMap<>();
|
||||
villageInsertInfo.put("建档部门",getCreatorDept(agent,loginName));//建档部门
|
||||
villageInsertInfo.put("建档人员","系统管理员");//建档人员
|
||||
villageInsertInfo.put("建档日期",new Date()+"");//建档日期
|
||||
villageInsertInfo.put("建档日期",df.format(new Date()));//建档日期
|
||||
villageInsertInfo.put("资产板块",sourceMap.get("xqzcBlock")+"");//资产板块
|
||||
villageInsertInfo.put("建档单位","住保置业");//建档单位
|
||||
villageInsertInfo.put("资产层级",sourceMap.get("xqzcpLevelValue")+"");//资产层级
|
||||
@@ -115,7 +118,7 @@ public class BzfAssetMode extends AbstractAssetDataMapMode{
|
||||
villageInsertInfo.put("所属小区",sourceMap.get("village_name") +"");//小区
|
||||
villageInsertInfo.put("用途",sourceMap.get("house_use") +"");//用途
|
||||
villageInsertInfo.put("租售类型",sourceMap.get("xqrental_type") +"");//租售类型
|
||||
villageInsertInfo.put("/房屋体系",sourceMap.get("house_system") +"");//房屋体系
|
||||
villageInsertInfo.put("房屋体系",sourceMap.get("house_system") +"");//房屋体系
|
||||
// villageInsertInfo.put("field0058",sourceMap.get(""));//坐落位置
|
||||
villageInsertInfo.put("土地性质",sourceMap.get("land_nature") +"");//土地性质
|
||||
villageInsertInfo.put("是否产权抵押",sourceMap.get("assetBacked") +""); //是否产权抵押
|
||||
@@ -152,6 +155,7 @@ public class BzfAssetMode extends AbstractAssetDataMapMode{
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
targetMap.put("资产类型",sourceMap.get("zcTypeFwValue"));//填充资产类型
|
||||
|
||||
@@ -11,8 +11,8 @@ public class ContractBillMode extends AbstractFeeDataMapMode{
|
||||
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
String recordBill = EnumMapUtils.getEnumItemValue(agent,"是否入账","未入");
|
||||
String incomeOrCost = EnumMapUtils.getEnumItemValue(agent,"收支类型","收");
|
||||
String recordBill = EnumMapUtils.getEnumItemValue(cwRootPcode,agent,"是否入账","未入");
|
||||
String incomeOrCost = EnumMapUtils.getEnumItemValue(cwRootPcode,agent,"收支类型","收");
|
||||
map.put("recordBill",recordBill);
|
||||
map.put("incomeOrCost",incomeOrCost);
|
||||
}
|
||||
@@ -29,6 +29,7 @@ public class ContractBillMode extends AbstractFeeDataMapMode{
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
targetMap.put("是否入账",sourceMap.get("recordBill")); //填充是否入账
|
||||
|
||||
@@ -3,6 +3,10 @@ package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
import com.seeyon.apps.src_ydctdatasync.dao.KsQueryDao;
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -11,8 +15,8 @@ public class ContractMode extends AbstractContractDataMapMode {
|
||||
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
String zcType = EnumMapUtils.getEnumItemValue(agent,"资产类型","房屋");
|
||||
String zcBlock = EnumMapUtils.getEnumItemValue(agent,"资产板块","03不动产");
|
||||
String zcType = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产类型","房屋");
|
||||
String zcBlock = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产板块","03不动产");
|
||||
String ksName = (String) map.get("b_name");
|
||||
String zcTypeLevel2 = (String) map.get("asset_type_name");
|
||||
if(zcTypeLevel2.equals("保障房")){
|
||||
@@ -24,7 +28,7 @@ public class ContractMode extends AbstractContractDataMapMode {
|
||||
}
|
||||
map.put("zcType",zcType);
|
||||
map.put("zcBlock",zcBlock);
|
||||
map.put("asset_type_name",EnumMapUtils.getEnumItemValue(agent,"资产二级类型", (String) map.get("asset_type_name")));
|
||||
map.put("asset_type_name",EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产二级类型", (String) map.get("asset_type_name")));
|
||||
KsQueryDao ksQueryDao = new KsQueryDao();
|
||||
try {
|
||||
Map<String, Object> ksMap = ksQueryDao.queryByName(ksName, "where field0006 = ?", ksName);
|
||||
@@ -49,18 +53,23 @@ public class ContractMode extends AbstractContractDataMapMode {
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
Map<String,Object> subTableMap = new HashMap<>();
|
||||
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
targetMap.put("subTable",subTableMap);
|
||||
targetMap.put("合同ID",sourceMap.get("contract_id")); //填充合同ID
|
||||
targetMap.put("合同编号",sourceMap.get("contract_no")); //填充合同编号
|
||||
targetMap.put("签订单位编号",sourceMap.get("signCorpNo")); //填充签订单位编号
|
||||
targetMap.put("签订单位",sourceMap.get("a_name"));//填充签订单位
|
||||
targetMap.put("合同金额",sourceMap.get("contract_total_amount"));//合同金额
|
||||
targetMap.put("合同开始日期",sourceMap.get("tenant_start_time"));//合同开始日期
|
||||
targetMap.put("合同截止日期",sourceMap.get("tenant_end_time"));//合同截止日期
|
||||
try {
|
||||
targetMap.put("合同开始日期",df.format((Date)sourceMap.get("tenant_start_time")));//合同开始日期
|
||||
targetMap.put("合同截止日期",df.format((Date)sourceMap.get("tenant_end_time")));//合同截止日期
|
||||
}catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
targetMap.put("U8C客商编号",sourceMap.get("u8ccode"));//U8C客商编号
|
||||
targetMap.put("客商名称",sourceMap.get("b_name"));//客商名称
|
||||
targetMap.put("联系方式",sourceMap.get("b_connect"));//联系方式
|
||||
|
||||
@@ -11,10 +11,10 @@ public class GzcfAssetMode extends AbstractAssetDataMapMode{
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
super.preProcess(map);
|
||||
String has_lift = EnumMapUtils.getEnumItemValue(agent,"有无电梯", (String) map.get("has_lift"));
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(agent,"资产类型","房屋");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(agent,"资产二级类型","厂房");
|
||||
String house_use = EnumMapUtils.getEnumItemValue(agent,"用途", (String) map.get("house_use"));
|
||||
String has_lift = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"有无电梯", (String) map.get("has_lift"));
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产类型","房屋");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产二级类型","厂房");
|
||||
String house_use = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"用途", (String) map.get("house_use"));
|
||||
map.put("zcTypeFwValue",zcTypeFwValue);
|
||||
map.put("zcTypeLevel2",zcTypeLevel2);
|
||||
map.put("has_lift",has_lift);
|
||||
@@ -33,6 +33,7 @@ public class GzcfAssetMode extends AbstractAssetDataMapMode{
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
targetMap.put("资产类型",sourceMap.get("zcTypeFwValue"));//填充资产类型
|
||||
|
||||
@@ -12,11 +12,11 @@ public class GzfwAssetMode extends AbstractAssetDataMapMode{
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
super.preProcess(map);
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(agent,"资产类型","房屋");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(agent,"资产二级类型","住宅");
|
||||
String has_lift = EnumMapUtils.getEnumItemValue(agent,"有无电梯", (String) map.get("has_lift"));
|
||||
String house_use = EnumMapUtils.getEnumItemValue(agent,"用途", (String) map.get("house_use"));
|
||||
String house_type = EnumMapUtils.getEnumItemValue(agent,"房屋类型", (String) map.get("variable_002"));
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产类型","房屋");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产二级类型","住宅");
|
||||
String has_lift = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"有无电梯", (String) map.get("has_lift"));
|
||||
String house_use = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"用途", (String) map.get("house_use"));
|
||||
String house_type = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"房屋类型", (String) map.get("variable_002"));
|
||||
map.put("zcTypeFwValue",zcTypeFwValue);
|
||||
map.put("zcTypeLevel2",zcTypeLevel2);
|
||||
map.put("has_lift",has_lift);
|
||||
@@ -36,6 +36,7 @@ public class GzfwAssetMode extends AbstractAssetDataMapMode{
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
targetMap.put("资产类型",sourceMap.get("zcTypeFwValue"));//填充资产类型
|
||||
|
||||
@@ -11,9 +11,9 @@ public class GztdAssetMode extends AbstractAssetDataMapMode{
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
super.preProcess(map);
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(agent,"资产类型","土地");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(agent,"资产二级类型","自用出让地");
|
||||
String land_nature = EnumMapUtils.getEnumItemValue(agent,"土地性质", (String) map.get("land_nature"));
|
||||
String zcTypeFwValue = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产类型","土地");
|
||||
String zcTypeLevel2 = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"资产二级类型","自用出让地");
|
||||
String land_nature = EnumMapUtils.getEnumItemValue(zcRootPcode,agent,"土地性质", (String) map.get("land_nature"));
|
||||
map.put("zcTypeFwValue",zcTypeFwValue);
|
||||
map.put("zcTypeLevel2",zcTypeLevel2);
|
||||
map.put("land_nature",land_nature);
|
||||
@@ -31,6 +31,7 @@ public class GztdAssetMode extends AbstractAssetDataMapMode{
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
targetMap.put("资产类型",sourceMap.get("zcTypeFwValue"));//填充资产类型
|
||||
|
||||
@@ -2,7 +2,11 @@ package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -11,7 +15,7 @@ public class HydropowerRechargeDataMapMode extends AbstractFeeDataMapMode{
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
super.preProcess(map);
|
||||
String incomeOrCost = EnumMapUtils.getEnumItemValue(agent,"收支类型","收");
|
||||
String incomeOrCost = EnumMapUtils.getEnumItemValue(cwRootPcode,agent,"收支类型","收");
|
||||
map.put("incomeOrCost",incomeOrCost);
|
||||
}
|
||||
|
||||
@@ -27,13 +31,20 @@ public class HydropowerRechargeDataMapMode extends AbstractFeeDataMapMode{
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
targetMap.put("收支类型",sourceMap.get("incomeOrCost")); //填充收支类型
|
||||
targetMap.put("到账日期",sourceMap.get("recharge_time")); //填充到账日期
|
||||
try {
|
||||
targetMap.put("到账日期",df.format( sourceMap.get("recharge_time"))); //填充到账日期
|
||||
targetMap.put("住保-账单生成日期",df.format(sourceMap.get("recharge_time"))); //填充账单生成日期
|
||||
targetMap.put("实收日期",df.format((Date)sourceMap.get("recharge_time"))); //填充实收日期
|
||||
}catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
targetMap.put("住保-费用类型","水电费"); //填充费用类型
|
||||
targetMap.put("住保-账单生成日期",sourceMap.get("recharge_time")); //填充账单生成日期
|
||||
targetMap.put("实收日期",sourceMap.get("recharge_time")); //填充实收日期
|
||||
targetMap.put("住保-支付订单状态",sourceMap.get("recharge_status")); //填充订单状态
|
||||
targetMap.put("订单描述说明",sourceMap.get("recharge_desc")); //填充订单说明
|
||||
}
|
||||
|
||||
@@ -2,7 +2,11 @@ package com.seeyon.apps.src_ydctdatasync.datamap;
|
||||
|
||||
import com.seeyon.apps.src_ydctdatasync.utils.EnumMapUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -11,7 +15,7 @@ public class RefundDataMapMode extends AbstractFeeDataMapMode{
|
||||
@Override
|
||||
public void preProcess(Map<String, Object> map) {
|
||||
super.preProcess(map);
|
||||
String incomeOrCost = EnumMapUtils.getEnumItemValue(agent,"收支类型","支");
|
||||
String incomeOrCost = EnumMapUtils.getEnumItemValue(cwRootPcode,agent,"收支类型","支");
|
||||
map.put("incomeOrCost",incomeOrCost);
|
||||
}
|
||||
|
||||
@@ -27,14 +31,20 @@ public class RefundDataMapMode extends AbstractFeeDataMapMode{
|
||||
|
||||
@Override
|
||||
public void transfer(Object target, Object source) {
|
||||
commonAttrTransfer(target,source);
|
||||
Map<String, Object> targetMap = (Map<String, Object>) target;
|
||||
Map<String, Object> sourceMap = (Map<String, Object>) source;
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
targetMap.put("收支类型",sourceMap.get("incomeOrCost")); //填充收支类型
|
||||
targetMap.put("住保-费用类型",sourceMap.get("refund_type")); //填充费用类型
|
||||
targetMap.put("住保-支付订单状态",sourceMap.get("refund_status")); //填充订单状态
|
||||
targetMap.put("订单描述说明",sourceMap.get("recharge_desc")); //填充订单说明
|
||||
targetMap.put("本次实付金额",sourceMap.get("refund_amount")); //填充本次实付金额
|
||||
targetMap.put("住保-退还账单时间",sourceMap.get("refund_bill_time")); //填充退还账单时间
|
||||
targetMap.put("实付日期",sourceMap.get("refund_time")); //填充实付日期
|
||||
try {
|
||||
targetMap.put("住保-退还账单时间",df.format((Date) sourceMap.get("refund_bill_time"))); //填充退还账单时间
|
||||
targetMap.put("实付日期",df.format((Date)sourceMap.get("refund_time"))); //填充实付日期
|
||||
} catch (NullPointerException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
private FormFactory formFactory;
|
||||
private DataSource ydzbThirdDataSource = (DataSource) AppContext.getBean("ydzbThirdDataSource");
|
||||
private JDBCAgent agent = new JDBCAgent();
|
||||
private JDBCAgent agent = null;
|
||||
private boolean prod;
|
||||
|
||||
public boolean isProd() {
|
||||
@@ -76,12 +76,16 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
log.info("宜都城投资产数据同步任务任务开始");
|
||||
long startTime = System.currentTimeMillis();
|
||||
try (Connection connection = ydzbThirdDataSource.getConnection()){
|
||||
agent = new JDBCAgent();
|
||||
processZcData(connection);
|
||||
processContractData(connection);
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (!arg0.equals("-1")) {
|
||||
if (!"-1".equals(arg0)) {
|
||||
try {
|
||||
Date date = df.parse(arg0);
|
||||
Date date = null;
|
||||
if(arg0 != null) {
|
||||
date = df.parse(arg0);
|
||||
}
|
||||
processFeeData(connection, date);
|
||||
}catch (ParseException e) {
|
||||
throw e;
|
||||
@@ -90,6 +94,10 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
} catch (Exception e) {
|
||||
log.error("宜都城投资产数据同步任务执行失败");
|
||||
log.error(e.getMessage(),e);
|
||||
}finally {
|
||||
if(agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
log.info("宜都城投资产数据同步任务任务结束,耗时:"+ (System.currentTimeMillis() - startTime)+ " ms");
|
||||
return null;
|
||||
@@ -102,6 +110,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zzb_contract limit 100 OFFSET ?;";
|
||||
ContractMode contractMode = new ContractMode();
|
||||
contractMode.setAgent(agent);
|
||||
contractMode.setZcRootPcode(getBizConfigByKey(YdzbdataSyncConstants.zcRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection, null);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
@@ -147,6 +156,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zb_contract_bill where limit 100 OFFSET ?;";
|
||||
ContractBillMode contractBillMode = new ContractBillMode();
|
||||
contractBillMode.setAgent(agent);
|
||||
contractBillMode.setCwRootPcode(getBizConfigByKey(YdzbdataSyncConstants.cwRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection,null);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
@@ -176,6 +186,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zb_hydropower_recharge where recharge_time >= ? and recharge_time <= ? limit 100 OFFSET ?;";
|
||||
HydropowerRechargeDataMapMode rechargeDataMapMode = new HydropowerRechargeDataMapMode();
|
||||
rechargeDataMapMode.setAgent(agent);
|
||||
rechargeDataMapMode.setCwRootPcode(getBizConfigByKey(YdzbdataSyncConstants.cwRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection, startDate,endDate);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
@@ -197,6 +208,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zb_contract_bill where create_time >= ? and create_time <= ? limit 100 OFFSET ?;";
|
||||
RefundDataMapMode refundDataMapMode = new RefundDataMapMode();
|
||||
refundDataMapMode.setAgent(agent);
|
||||
refundDataMapMode.setCwRootPcode(getBizConfigByKey(YdzbdataSyncConstants.cwRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection, startDate,endDate);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
@@ -227,6 +239,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zb_gztd_house limit 100 OFFSET ?;";
|
||||
GztdAssetMode gztdAssetMode = new GztdAssetMode();
|
||||
gztdAssetMode.setAgent(agent);
|
||||
gztdAssetMode.setZcRootPcode(getBizConfigByKey(YdzbdataSyncConstants.zcRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection, null);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
@@ -251,6 +264,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zb_gzfw_house limit 100 OFFSET ?;";
|
||||
GzfwAssetMode gzfwAssetMode = new GzfwAssetMode();
|
||||
gzfwAssetMode.setAgent(agent);
|
||||
gzfwAssetMode.setZcRootPcode(getBizConfigByKey(YdzbdataSyncConstants.zcRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection, null);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
@@ -275,6 +289,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zb_gzcf_house limit 100 OFFSET ?;";
|
||||
GzcfAssetMode gzcfAssetMode = new GzcfAssetMode();
|
||||
gzcfAssetMode.setAgent(agent);
|
||||
gzcfAssetMode.setZcRootPcode(getBizConfigByKey(YdzbdataSyncConstants.zcRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection, null);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
@@ -299,6 +314,7 @@ public class YdzbDataSyncQuartz extends AbstractQuartzTask implements Disposable
|
||||
String pageQuerySql = "SELECT * FROM zb_bzf_house limit 100 OFFSET ?;";
|
||||
BzfAssetMode bzfAssetMode = new BzfAssetMode();
|
||||
bzfAssetMode.setAgent(agent);
|
||||
bzfAssetMode.setZcRootPcode(getBizConfigByKey(YdzbdataSyncConstants.zcRootEnumPCode));
|
||||
long count = StatementQueryUtil.queryCount(countQuerySql,connection, null);
|
||||
int totalPage = (int)Math.ceil((double)count / 100);
|
||||
for(int i = 0; i < totalPage;i++) {
|
||||
|
||||
@@ -6,15 +6,16 @@ import com.seeyon.ctp.common.po.ctpenumnew.CtpEnumBean;
|
||||
import com.seeyon.ctp.common.po.ctpenumnew.CtpEnumItem;
|
||||
import com.seeyon.ctp.util.JDBCAgent;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class EnumMapUtils {
|
||||
public static String getEnumItemValue(JDBCAgent agent,String groupValue,String targetValue) {
|
||||
String queryIdSql = "SELECT ID FROM ctp_enum WHERE `ENUMNAME` = ?";
|
||||
public static String getEnumItemValue(String rootPCode,JDBCAgent agent,String groupValue,String targetValue) {
|
||||
String queryIdSql = "SELECT ce.ID FROM ctp_enum ce inner join ctp_enum cei on ce.`PARENT_ID` = cei.ID where CEI.`PROGRAM_COD`E = ? and ce.`ENUMNAME` = ?";
|
||||
Long enumId = null;
|
||||
try {
|
||||
agent.execute(queryIdSql,groupValue);
|
||||
agent.execute(queryIdSql, Arrays.asList(rootPCode,groupValue));
|
||||
Map map = agent.resultSetToMap();
|
||||
enumId = (Long)map.get("id");
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user