zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.changhong.epc.parsing;
 
import com.changhong.epc.bean.tenant.bill.OCRBillEntity;
import com.changhong.epc.constter.system.SystemClients;
import com.changhong.epc.constter.system.run.EpcApplication;
import com.changhong.epc.parsing.service.loop.impl.InitCompanysLoopServiceImpl;
import com.changhong.epc.parsing.service.loop.impl.LoopSuper;
import com.iemsoft.framework.cloud.core.tools.JSONTool;
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.context.annotation.ComponentScan;
 
@SpringBootApplication(exclude = {
        DataSourceAutoConfiguration.class
})
@SpringCloudApplication
@ComponentScan(basePackages={"com.changhong.epc","com.iemsoft.framework.cloud"})
public class ParsingApplication implements SystemClients{
 
    private static OCRBillEntity info = JSONTool.toObj("{\"billDatas\":[{\"allotTenant\":true,\"billBodyEntityList\":[{\"billCode\":\"a0f8bd35f3fa4ebdb712f589c7fdcd20\",\"billKeyCode\":{},\"billKeyName\":{},\"billMasterCode\":{},\"billMasterName\":{},\"billMoney\":0,\"bodyDataMap\":{\"560054\":\"169.00\",\"560081\":\"0.00\",\"560082\":\"0%\",\"590018\":\"*电信服务*电信业务使用费\"},\"ignore\":false},{\"billCode\":\"e668016ad58844deb7ba570c46b7bd43\",\"billKeyCode\":{},\"billKeyName\":{},\"billMasterCode\":{},\"billMasterName\":{},\"billMoney\":0,\"bodyDataMap\":{\"560054\":\"4.57\",\"560081\":\"0.00\",\"560082\":\"0%\",\"590018\":\"*电信服务*违约金\"},\"ignore\":false}],\"billCode\":\"101YXYX181200469-002-01\",\"billHeadMap\":{\"500002\":\"账期:2018年09月代表号码:08162571861\",\"520040\":\"四川\",\"540040\":\"发票专用章\",\"550025\":\"57467682\",\"550031\":\"915107036714224151\",\"550035\":\"91510700MA62FQNGP\",\"550044\":\"499099436722\",\"550055\":\"915107036714224151\",\"550099\":\"051001700111\",\"560038\":\"173.57\",\"560041\":\"0.00\",\"560133\":\"173.57\",\"560134\":\"173.57\",\"580006\":\"\",\"580010\":\"11354667128443409224\",\"590006\":\"四川增值税电子普通发票\",\"590010\":\"中国电信股份有限公司绵阳分公司\",\"590012\":\"四川云游互联科技有限公司\",\"590024\":\"中国电信股份有限公司绵阳分公司\",\"600042\":\"绵阳市科创区创新中心7号楼103号08162417523\",\"600043\":\"中国工商银行绵阳高新技术产业开发支行2308414109100129754\",\"600044\":\"四川省绵阳市绵州路中段243号,电话:10000\",\"600045\":\"中国银行绵阳市分行营业部123900465975\",\"610007\":\"管理员\",\"610012\":\"胡敏\",\"610014\":\"胡敏\",\"620024\":\"20181113\",\"640003\":\"国家税务局监制\"},\"billKeyCode\":{\"R_EAmout\":\"173.57\"},\"billKeyName\":{\"R_EAmout\":\"173.57\"},\"billMasterCode\":{},\"billMasterName\":{},\"billModelCode\":\"B00000000004\",\"ignore\":false,\"ruleMsg\":[]},{\"allotTenant\":true,\"billBodyEntityList\":[{\"billCode\":\"f341fcc36a86440dbfe62021d9c60487\",\"billKeyCode\":{},\"billKeyName\":{},\"billMasterCode\":{},\"billMasterName\":{},\"billMoney\":0,\"bodyDataMap\":{\"560054\":\"169.00\",\"560081\":\"0.00\",\"560082\":\"0%\",\"590018\":\"*电信服务*电信业务使用费\"},\"ignore\":false}],\"billCode\":\"101YXYX181200469-001-02\",\"billHeadMap\":{\"500002\":\"账期:2018年10月代表号码:08162571816\",\"520040\":\"四川绵阳市\",\"540040\":\"发票专用章\",\"550025\":\"57385807\",\"550031\":\"915107036714224151\",\"550035\":\"91510700MA62FQNGP\",\"550044\":\"499099436714\",\"550055\":\"915107036714224151\",\"550099\":\"051001700111\",\"560038\":\"169.00\",\"560041\":\"0.00\",\"560133\":\"169.00\",\"560134\":\"169.0\",\"580006\":\"\",\"580010\":\"07634568675859131704\",\"590006\":\"四川增值税电子普通发票\",\"590010\":\"中国电信股份有限公司绵阳分公司\",\"590012\":\"四川云游互联科技有限公司\",\"590024\":\"中国电信股份有限公司绵阳分公司\",\"600042\":\"绵阳市科创区创新中心7号楼103号8162A17523\",\"600043\":\"中国工商银行绵阳高新技术产业开发支行2308414109100129754\",\"600044\":\"四川省绵阳市绵州路中段243号,电话:10000\",\"600045\":\"中国银行绵阳市分行营业部123900465975\",\"610007\":\"管理员\",\"610012\":\"胡敢\",\"610014\":\"胡敏\",\"620024\":\"20181113\",\"640003\":\"国家税务局监制\"},\"billKeyCode\":{\"R_EAmout\":\"169.00\"},\"billKeyName\":{\"R_EAmout\":\"169.00\"},\"billMasterCode\":{},\"billMasterName\":{},\"billModelCode\":\"B00000000004\",\"ignore\":false,\"ruleMsg\":[]},{\"allotTenant\":true,\"billBodyEntityList\":[],\"billCode\":\"101YXYX181200469-001-01\",\"billHeadMap\":{\"550122\":\"YSX0000000059062\"},\"billKeyCode\":{},\"billKeyName\":{},\"billMasterCode\":{},\"billMasterName\":{},\"billModelCode\":\"B00600010000\",\"ignore\":false,\"ruleMsg\":[]}],\"formId\":\"521a8ff3e3d0101f3a1946f2503cf79e\",\"orderCode\":\"101YXYX181200469\",\"tenantId\":9}"
            , OCRBillEntity.class);
 
    public static void main(String[] args) throws Exception {
        new EpcApplication(SERVER_PARSING, ParsingApplication.class).run(args);
        SpringUtil.getBeans(LoopSuper.class).stream()
//                .filter(loop->loop instanceof InitCompanysLoopServiceImpl)
                .forEach(LoopSuper::init);
 
//        ThreadData.set(Keys.TENANT_ID, "100000001");
//        ThreadData.set(BaseConst.TENANT_ID, "100000001");
//
//        TravelTypeTransverterBillInfo typeTransverterBillInfo = SpringUtil.getBean(TravelTypeTransverterBillInfo.class);
//        System.out.println(typeTransverterBillInfo.exeConvert(info));
//        System.out.println(JSONTool.toJson(info));
    }
 
}