use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class UIDInfoUtils method getUidInfo.
/**
* 获取指定表中指定记录的指定属性值
*
* @param billId
* 订单id
* @param fields
* 表名.属性名(businessLicense.enterpriseName)
* @return 未找到返回null
*/
public String getUidInfo(Long billId, String fields) {
// str[0]表名,str[1]字段名
String[] strs = fields.split("\\.");
BusinessLicense businessLicense = null;
OrgCode orgCode = null;
TaxRegisterCert taxRegisterCert = null;
IdentityCard identityCard = null;
UserInfo userInfo = null;
Enterprise enterprise = null;
switch(strs[0]) {
case "businessLicense":
businessLicense = blCache.get(billId);
if (null == businessLicense) {
businessLicense = businessService.getBusinessByBillId(billId, null);
blCache.put(billId, businessLicense);
}
break;
case "orgCode":
orgCode = ocCache.get(billId);
if (null == orgCode) {
orgCode = orgCodeService.getOrgCodeByBillId(billId, null);
ocCache.put(billId, orgCode);
}
break;
case "taxRegisterCert":
taxRegisterCert = trcCache.get(billId);
if (null == taxRegisterCert) {
taxRegisterCert = taxCertService.getTaxRegisterCertByBillId(billId, null);
trcCache.put(billId, taxRegisterCert);
}
break;
case "identityCard":
identityCard = icCache.get(billId);
if (null == identityCard) {
identityCard = identityCardService.getIdentityCardByBillId(billId, null);
icCache.put(billId, identityCard);
}
break;
case "userInfo":
userInfo = uiCache.get(billId);
if (null == userInfo) {
userInfo = userInfoService.getUserInfoByBillId(billId);
uiCache.put(billId, userInfo);
}
break;
case "enterprise":
enterprise = eCache.get(billId);
if (null == enterprise) {
enterprise = enterpriseService.getEnterpriseByBillId(billId);
eCache.put(billId, enterprise);
}
break;
default:
return null;
}
if (null != businessLicense) {
return getBlFieldValue(businessLicense, strs[1]);
}
if (null != orgCode) {
return getOcFieldValue(orgCode, strs[1]);
}
if (null != taxRegisterCert) {
return getTcrFieldValue(taxRegisterCert, strs[1]);
}
if (null != identityCard) {
return getIcFieldValue(identityCard, strs[1]);
}
if (null != userInfo) {
return getUiFieldValue(userInfo, strs[1]);
}
if (null != enterprise) {
return getEFieldValue(enterprise, strs[1]);
}
return null;
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class PayWebControllerTest method multiNotfiyUrl.
@Test
public void multiNotfiyUrl() {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
System.out.println("开始时间:" + df.format(System.currentTimeMillis()));
TestRunnable[] testRunnable = new TestRunnable[20];
List<Bill> bills = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByExample");
for (int i = 0; i < testRunnable.length; i++) {
if (i % 2 == 0) {
System.out.println(bills.get(i).getBillId());
Map<String, String> packageParams = new HashMap<String, String>();
packageParams.put("appid", "112223");
packageParams.put("nonce_str", "nonce_str");
packageParams.put("body", "body");
packageParams.put("out_trade_no", bills.get(i).getBillId());
packageParams.put("transaction_id", UniqueIDUtils.genUUID());
packageParams.put("pay_type", "1");
packageParams.put("return_code", "SUCCESS");
testRunnable[i] = new NotifyUrl(packageParams);
} else {
UserInfo userInfo = new UserInfo();
userInfo.setmPhone("13yyy88986" + i);
Enterprise enterprise = new Enterprise();
enterprise.setEnterpriseName("yaliqiyeyy" + i);
testRunnable[i] = new RegisterUserThread2(userInfo, enterprise);
}
}
MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(testRunnable);
try {
mttr.runTestRunnables();
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable e) {
e.printStackTrace();
}
System.out.println("结束时间:" + df.format(System.currentTimeMillis()));
System.out.println("成功数量" + SUCCESS_COUNT);
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class EnterpriseServiceTest method test.
@Test
public void test() {
try {
Enterprise enterprise = enterpriseServiceImpl.getEnterpriseById(606L);
Enterprise enterprise2 = new Enterprise();
enterprise2.setId(enterprise.getId());
// enterprise2.setEnterpriseName(enterprise.getEnterpriseName());
enterpriseServiceImpl.updateByPrimaryKeySelective(enterprise2);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
/**
* org.springframework.jdbc.UncategorizedSQLException:
*### Error updating database. Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'
* where id = ?',expect SET, actual WHERE where : update enterprise
*
* where id = ?
*### SQL: update enterprise where id = ?
*### Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'
* where id = ?',expect SET, actual WHERE where : update enterprise
*
* where id = ?
*; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; sql injection violation, syntax error: syntax error, error in :'
* where id = ?',expect SET, actual WHERE where : update enterprise
*
* where id = ?; nested exception is java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'
* where id = ?',expect SET, actual WHERE where : update enterprise
*
* where id = ?
*/
}
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class ReadJsonStr method testGetJsonObject.
@Test
public void testGetJsonObject() throws JsonProcessingException, IOException {
jsonTool.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
String jsonStr = "{\"editEnterpriseInfo\" : {\"enterpriseName\" : \"企业名称\",\"enterpriseNature\" : \"1\",\"orgIndustry\" : \"1\"},\"editUserInfo\" : {\"realName\" : \"姓名\",\"mPhone\" : \"1234\",\"email\" : \"邮箱\",\"telephone\" : \"固定电话\",\"userPosition\" : \"职位\",\"editUID\" : \"证书uid\"},\"editDelivery\" : {\"courier\" : \"快递方式\",\"cost\" : \"费用\",\"regionCodes\" : \"省市区代码\",\"detailAdds\" : \"详细地址\"},\"editInvoice\" : {\"name\" : \"企业名称\",\"receipt\" : \"发票类型\"},\"editBusinessLicense\" : {\"enterpriseName\" : \"企业名称\",\"licenseNo\" : \"营业执照号\",\"businessType\" : \"1三证合一0不是\",\"imgFile\" : \"图片base64或url\",\"id\" : \"12\"},\"editOrgCode\" : {\"enterpriseName\" : \"企业名称\",\"orgCode\" : \"组织机构代码\",\"imgFile\" : \"图片base64或url\",\"id\" : \"组织机构代码id\"},\"editTaxregisterCert\" : {\"enterpriseName\" : \"企业名称\",\"certNo\" : \"税务登记号\",\"imgFile\" : \"图片base64或url\",\"id\" : \"税务登记号id\"},\"editIdentityCard\" : {\"enterpriseName\" : \"企业名称\",\"name\" : \"法人姓名\",\"idCode\" : \"证件号\",\"frontImg\" : \"证件正面图片\",\"backImg\" : \"证件反面图片\",\"cardType\" : \"证件类型\",\"id\" : \"法代表人id\"},\"editProxy\" : {\"id\" : \"授权书id\",\"imgFile\" : \"图片base或url\"},\"editUID\" : \"证书uid\"}";
JsonNode jsonNode = jsonTool.readTree(jsonStr);
JsonNode editEnterpriseInfo = jsonNode.get("editEnterpriseInfo");
Enterprise enterprise = jsonTool.readValue(editEnterpriseInfo, Enterprise.class);
System.out.println(enterprise.getEnterpriseName());
JsonNode editUserInfo = jsonNode.get("editUserInfo");
UserInfo userInfo = jsonTool.readValue(editUserInfo, UserInfo.class);
System.out.println(userInfo.getmPhone());
}
Aggregations