use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class EnterpriseServiceImpl method updateEnterprise.
/**
* 更新企业信息(设置对应的认证项和认证等级)
*
* @param enterpriseId
* 企业id
* @param authenticationLevel
* 认证等级
* @param businessId
* 营业执照id
* @param orgCodeId
* 组织机构代码id
* @param taxRegisterCertId
* 税务登记id
* @param IdentityCardId
* 法人id
* @param AgentId
* 代理人id
* @return
*/
public Enterprise updateEnterprise(Long enterpriseId, Long authenticationLevel, Long businessId, Long orgCodeId, Long taxRegisterCertId, Long IdentityCardId, Long AgentId) {
Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByPrimaryKey", enterpriseId);
// 认证等级
enterprise.setAuthenticationLevel(authenticationLevel);
// 营业执照
enterprise.setHasBl(businessId);
// 组织机构代码
enterprise.setHasOrgCode(orgCodeId);
// 税务登记
enterprise.setHasTaxCert(taxRegisterCertId);
// 法人
enterprise.setHasIdCard(IdentityCardId);
// 代理人
enterprise.setHasAgent(AgentId);
sqlSession.update("com.itrus.portal.db.EnterpriseMapper.updateByPrimaryKey", enterprise);
sqlSession.flushStatements();
return enterprise;
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class EnterpriseServiceImpl method addEnterPrise.
/**
* 如果根据企业名称能查询到企业,就修改 如果查不到就新建企业 szy 2016年8月22日 下午3:10:30
*
* @param enterprise
* @return Enterprise
*/
public Enterprise addEnterPrise(Enterprise enterprise) {
EnterpriseExample example = new EnterpriseExample();
EnterpriseExample.Criteria criteria = example.or();
criteria.andEnterpriseNameEqualTo(enterprise.getEnterpriseName());
Enterprise enterprise0 = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByExample", example);
if (null != enterprise0) {
enterprise0.setEnterpriseSn(enterprise.getEnterpriseSn());
enterprise0.setEnterpriseNature(enterprise.getEnterpriseNature());
enterprise0.setOrgIndustry(enterprise.getOrgIndustry());
sqlSession.update("com.itrus.portal.db.EnterpriseMapper.updateByPrimaryKey", enterprise0);
sqlSession.flushStatements();
return enterprise0;
} else {
// 新增
enterprise.setCreateTime(new Date());
// 设置企业标识
sqlSession.insert("com.itrus.portal.db.EnterpriseMapper.insert", enterprise);
sqlSession.flushStatements();
return enterprise;
}
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class EnterpriseServiceImpl method getEntByEnterpriseSn.
/**
* 根据企业sn,查找企业
* @param enterpriseSn
* @return
*/
public Enterprise getEntByEnterpriseSn(String enterpriseSn) {
EnterpriseExample example = new EnterpriseExample();
EnterpriseExample.Criteria criteria = example.or();
criteria.andEnterpriseSnEqualTo(enterpriseSn);
Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByExample", example);
return enterprise;
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class EnterpriseServiceImpl method saveOrUpdateEnterprise.
/**
* 根据企业名称查看企业是否已经存在,存在则修改,不存在则添加
*
* @param enterprise
* @return
*/
public Enterprise saveOrUpdateEnterprise(Enterprise enterprise) {
EnterpriseExample example = new EnterpriseExample();
EnterpriseExample.Criteria criteria = example.or();
enterprise.setEnterpriseName(enterprise.getEnterpriseName().trim());
criteria.andEnterpriseNameEqualTo(enterprise.getEnterpriseName());
Enterprise enterprise0 = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByExample", example);
if (null != enterprise0) {
// 修改
enterprise0.setEnterpriseNature(enterprise.getEnterpriseNature());
enterprise0.setOrgIndustry(enterprise.getOrgIndustry());
enterprise0.setAuthenticationLevel(null);
enterprise0.setHasBl(null);
enterprise0.setHasOrgCode(null);
enterprise0.setHasTaxCert(null);
enterprise0.setHasIdCard(null);
enterprise0.setHasAgent(null);
sqlSession.update("com.itrus.portal.db.EnterpriseMapper.updateByPrimaryKey", enterprise0);
sqlSession.flushStatements();
return enterprise0;
} else {
// 新增
enterprise.setCreateTime(new Date());
// 修复新增企业自动给企业生成唯一标识的bug
if (StringUtils.isBlank(enterprise.getEnterpriseSn())) {
// 设置企业标识
enterprise.setEnterpriseSn(UniqueIDUtils.genEnterpriseUID(sqlSession));
}
sqlSession.insert("com.itrus.portal.db.EnterpriseMapper.insert", enterprise);
sqlSession.flushStatements();
return enterprise;
}
}
use of com.itrus.portal.db.Enterprise in project portal by ixinportal.
the class EnterpriseServiceImpl method getEntByName.
/**
* 根据企业名称获取企业信息 szy 2016年8月24日 下午4:49:11
*
* @param enterpriseName
* @return Enterprise
*/
public Enterprise getEntByName(String enterpriseName) {
EnterpriseExample example = new EnterpriseExample();
EnterpriseExample.Criteria criteria = example.or();
criteria.andEnterpriseNameEqualTo(enterpriseName);
example.setOrderByClause("create_time desc");
example.setLimit(1);
Enterprise enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterpriseMapper.selectByExample", example);
return enterprise;
}
Aggregations