📄 actionent_customer_enterprise.java
字号:
.findByCondition(new DbAccess(), EnENT_CUSTOMER_LINKMAN.class
.getName(), where, ""));
StringBuffer linkman = new StringBuffer();
StringBuffer tel = new StringBuffer();
for (int i = 0; i < aEnENT_CUSTOMER_LINKMAN.length; i++) {
linkman.append(aEnENT_CUSTOMER_LINKMAN[i].getChName() + ",");
tel.append(aEnENT_CUSTOMER_LINKMAN[i].getCHBUSINESS_TEL() + ",");
}
cEnEnt_Customer_Enterprise.setChEnterpriseLinkman(linkman.toString());
cEnEnt_Customer_Enterprise.setLinkmanTel(tel.toString());
return cEnEnt_Customer_Enterprise;
}
public String qianyue(HttpServletRequest request,
HttpServletResponse response) throws Exception {
String id = request.getParameter("id");
EnEnt_Customer_Enterprise cEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise) DAOBase
.findByPK(new DbAccess(), EnEnt_Customer_Enterprise.class
.getName(), id);
cEnEnt_Customer_Enterprise.setChIsAudited("1");
DbAccess db = new DbAccess();
Date now = new Date(System.currentTimeMillis());
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd",
Locale.SIMPLIFIED_CHINESE);
String timestamp = sdf.format(now);
cEnEnt_Customer_Enterprise.setDtCommitTime(timestamp);
String sql = "update ent_customer_enterprise set chIsAudited ='1',dtCommitTime = to_date('"
+ timestamp + "','yyyyMMdd') where id =" + id;
try {
db.beginTransaction();
db.executeUpdate(sql);
// DAOBase.update(db, cEnEnt_Customer_Enterprise);
db.commit();
} catch (Exception ex) {
db.rollback();
throw ex;
}
// "openTop(\"GDPE.customer.enterprise.ActionEnt_Customer_Enterprise.do?doType=summary\");");
String sql2 = "update ent_record_Following set chFollowResult = '4' where iEnterpriseId ='"
+ cEnEnt_Customer_Enterprise.getId() + "'";
try {
db.beginTransaction();
db.executeUpdate(sql2);
// DAOBase.update(db, cEnEnt_Customer_Enterprise);
db.commit();
} catch (Exception ex) {
db.rollback();
throw ex;
}
String strOpen = "openTop(\"GDPE.customer.latent.ActionEnt_Customer_Enterprise.do?doType=summary\");";
levin.iMessage msg = levin.iMessage.getNewInstance("潜在客户管理",
"已经放进签约企业库!", strOpen);
msg.save(request);
return this.getTargetPage("Message");
}
public String lixian(HttpServletRequest request,
HttpServletResponse response) throws Exception {
HttpSession session = request.getSession(false);
UserInfo userInfor = (UserInfo) session.getAttribute("UserInfo_Object");
// String operatorId = userInfor.getId();// 当前操作员ID
String cId = userInfor.getId();// 当前操作员ID
String cName = userInfor.getName();
EnAuditor cEnAuditor = (EnAuditor) DAOBase.findByPK(new DbAccess(),
EnAuditor.class.getName(), cId);
String chStationCode = cEnAuditor.getChDeptCode();
EnDepartment cEnDepartment = (EnDepartment) DAOBase.findByPK(
new DbAccess(), EnDepartment.class.getName(), chStationCode);
String chStation = cEnDepartment.getChDeptName();
String id = request.getParameter("id");
String flag = request.getParameter("flag");
List al = new ArrayList();
EnEnt_Customer_Enterprise cEnEnt_Customer_Enterprise = null;
DbAccess db = new DbAccess();
try {
db.beginTransaction();
StringTokenizer st = new StringTokenizer(id, ",");
while (st.hasMoreElements()) {
String index = (String) st.nextElement();
// DAOBase.delete(db,
// EnEnt_Customer_Enterprise.class.getName(),index);
cEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise) DAOBase
.findByPK(new DbAccess(),
EnEnt_Customer_Enterprise.class.getName(),
index);
al.add(cEnEnt_Customer_Enterprise);
db.commit();
}
// System.out.println("-----9");
} catch (Exception ex) {
db.rollback();
throw ex;
}
EnEnt_Record_Following cEnEnt_Record_Following = new EnEnt_Record_Following();
Date now = new Date(System.currentTimeMillis());
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd",
Locale.SIMPLIFIED_CHINESE);
String timestamp = sdf.format(now);
DbAccess db1 = new DbAccess();
EnEnt_Record_Following aEnEnt_Record_Following[] = null;
String where3 = "";
java.util.Calendar c1 = Calendar.getInstance(java.util.Locale.CHINA);
java.util.Calendar c2 = Calendar.getInstance(java.util.Locale.CHINA);
java.util.Date d1 = new java.util.Date(System.currentTimeMillis());
c1.setTime(d1);
c2.setTime(d1);
// java.util.Calendar c2 = c1;
c1.set(Calendar.DATE, 1);
c2.roll(Calendar.MONTH, 1);
c2.set(Calendar.DATE, -1);
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMdd",
Locale.SIMPLIFIED_CHINESE);
java.sql.Date d2 = new java.sql.Date(c1.getTimeInMillis());
java.sql.Date d3 = new java.sql.Date(c2.getTimeInMillis());
String s1 = sf.format(d2);
String s2 = sf.format(d3);
int i1 = Integer.parseInt(s1);
int i2 = Integer.parseInt(s2);
// System.out.println("--------" + s1 + " ------" + s2);
try {
db.beginTransaction();
for (int i = 0; i < al.size(); i++) {
cEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise) al
.get(i);
String where4 = " iEnterpriseId = '"
+ cEnEnt_Customer_Enterprise.getId() + "'";
aEnEnt_Record_Following = (EnEnt_Record_Following[]) (DAOBase
.findByCondition(new DbAccess(),
EnEnt_Record_Following.class.getName(), where4,
""));
if (aEnEnt_Record_Following.length != 0) {
for (int t = 0; t < aEnEnt_Record_Following.length; t++) {
if (!aEnEnt_Record_Following[t].getDtTrackingDate()
.equals("")) {
if (aEnEnt_Record_Following[t].getDtTrackingDate()
.startsWith("1900")) {
aEnEnt_Record_Following[t]
.setDtTrackingDate("");
} else {
String year = aEnEnt_Record_Following[t]
.getDtTrackingDate().substring(0, 4);
String month = aEnEnt_Record_Following[t]
.getDtTrackingDate().substring(5, 7);
String day = aEnEnt_Record_Following[t]
.getDtTrackingDate().substring(8, 10);
aEnEnt_Record_Following[t]
.setDtTrackingDate(year + month + day);
}
}
if (!aEnEnt_Record_Following[t].getDtPlanTrackingDate()
.equals("")) {
if (aEnEnt_Record_Following[t]
.getDtPlanTrackingDate().startsWith("1900")) {
aEnEnt_Record_Following[t]
.setDtPlanTrackingDate("");
} else {
String year = aEnEnt_Record_Following[t]
.getDtPlanTrackingDate()
.substring(0, 4);
String month = aEnEnt_Record_Following[t]
.getDtPlanTrackingDate()
.substring(5, 7);
String day = aEnEnt_Record_Following[t]
.getDtPlanTrackingDate().substring(8,
10);
aEnEnt_Record_Following[t]
.setDtPlanTrackingDate(year + month
+ day);
}
}
String st = aEnEnt_Record_Following[t]
.getDtTrackingDate();
int st1 = Integer.parseInt(st);
String s = "你现在立项的企业"
+ aEnEnt_Record_Following[t]
.getChEnterpriseName() + "在本月已经立项过了!";
if (i1 < st1 && st1 < i2) {
String str = "openTop(\"GDPE.customer.latent.ActionEnt_Customer_Enterprise.do?doType=summary\");";
levin.iMessage msg = levin.iMessage.getNewInstance(
"客户管理", s, str);
msg.save(request);
return this.getTargetPage("Message");
} else if (st1 < i1 && st1 > 19700101) {
aEnEnt_Record_Following[t]
.setDtTrackingDate(timestamp);
DbAccess db3 = new DbAccess();
try {
db3.beginTransaction();
DAOBase.update(db3, aEnEnt_Record_Following[t]);
db3.commit();
} catch (Exception ex) {
db.rollback();
throw ex;
}
continue;
} else {
cEnEnt_Record_Following
.setChEnterpriseName(cEnEnt_Customer_Enterprise
.getChEnterpriseFullName());
cEnEnt_Record_Following
.setChCustomerName(cEnEnt_Customer_Enterprise
.getChEnterpriseLinkman());
cEnEnt_Record_Following
.setChCustomerTel(cEnEnt_Customer_Enterprise
.getLinkmanTel());
cEnEnt_Record_Following
.setChSeatCode(cEnEnt_Customer_Enterprise
.getChSeatCode());
cEnEnt_Record_Following
.setChCustomerAddr(cEnEnt_Customer_Enterprise
.getChEnterpriseAddress());
cEnEnt_Record_Following
.setChStationCode(chStationCode);
cEnEnt_Record_Following.setChStation(chStation);
cEnEnt_Record_Following.setChCommitCode(cId);
cEnEnt_Record_Following.setChCommitName(cName);
cEnEnt_Record_Following
.setDtTrackingDate(timestamp);
cEnEnt_Record_Following
.setIEnterpriseId(cEnEnt_Customer_Enterprise
.getId());
cEnEnt_Record_Following
.setChCustomerAddr(cEnEnt_Customer_Enterprise
.getChPostAddress());
if (flag.equals("qianyue")) {
cEnEnt_Record_Following.setChFollowResult("4");
} else {
cEnEnt_Record_Following.setChFollowResult("0");
}
DAOBase.insert(db1, cEnEnt_Record_Following);
}
}
} else {
cEnEnt_Record_Following
.setChEnterpriseName(cEnEnt_Customer_Enterprise
.getChEnterpriseFullName());
cEnEnt_Record_Following
.setChCustomerName(cEnEnt_Customer_Enterprise
.getChEnterpriseLinkman());
cEnEnt_Record_Following
.setChCustomerTel(cEnEnt_Customer_Enterprise
.getLinkmanTel());
cEnEnt_Record_Following
.setChSeatCode(cEnEnt_Customer_Enterprise
.getChSeatCode());
cEnEnt_Record_Following
.setChCustomerAddr(cEnEnt_Customer_Enterprise
.getChEnterpriseAddress());
cEnEnt_Record_Following.setChStationCode(chStationCode);
cEnEnt_Record_Following.setChStation(chStation);
cEnEnt_Record_Following.setChCommitCode(cId);
cEnEnt_Record_Following.setChCommitName(cName);
cEnEnt_Record_Following.setDtTrackingDate(timestamp);
cEnEnt_Record_Following
.setIEnterpriseId(cEnEnt_Customer_Enterprise
.getId());
cEnEnt_Record_Following
.setChCustomerAddr(cEnEnt_Customer_Enterprise
.getChPostAddress());
if (flag.equals("qianyue")) {
cEnEnt_Record_Following.setChFollowResult("4");
} else {
cEnEnt_Record_Following.setChFollowResult("0");
}
DAOBase.insert(db1, cEnEnt_Record_Following);
}
db.commit();
}
} catch (Exception ex) {
db.rollback();
throw ex;
}
if (flag.equals("qianyue")) {
String str = "openTop(\"GDPE.customer.enterprise.ActionEnt_Customer_Enterprise.do?doType=summary\");";
levin.iMessage msg = levin.iMessage.getNewInstance("客户管理", "成功立项!",
str);
msg.save(request);
return this.getTargetPage("Message");
} else if (flag.equals("qianzai")) {
String str = "openTop(\"GDPE.customer.latent.ActionEnt_Customer_Enterprise.do?doType=summary\");";
levin.iMessage msg = levin.iMessage.getNewInstance("客户管理", "成功立项!",
str);
msg.save(request);
return this.getTargetPage("Message");
} else {
String str = "openTop(\"GDPE.customer.latent.ActionEnt_Customer_Enterprise.do?doType=summary\");";
levin.iMessage msg = levin.iMessage.getNewInstance("客户管理", "成功立项!",
str);
msg.save(request);
return this.getTargetPage("Message");
}
}
// public String check(HttpServletRequest request, HttpServletResponse
// response)
// throws Exception {
// //String chEnterpriseFullName =
// request.getParameter("chEnterpriseFullName");
// String chEnterpriseFullName = new
// String(request.getParameter("chEnterpriseFullName").getBytes("ISO8859_1"),"GBK");
// //String sqlCondition = "chEnterpriseFullName = '" + chEnterpriseFullName
// // + "'";
// //System.out.println("----"+chEnterpriseFullName);
// //String order = "chEnterpriseFullName desc";
// String sql = "select * from Ent_Customer_Enterprise where
// chEnterpriseFullName like '%"+chEnterpriseFullName+"%'" ;
// DbAccess db = new DbAccess();
// EnEnt_Customer_Enterprise[] aEnEnt_Customer_Enterprise;
// try {
// db.beginTransaction();
// DataSet ds = db.executeQuery(sql);
// aEnEnt_Customer_Enterprise = (EnEnt_Customer_Enterprise[])
// DAOBase.resumeFromDataSet(ds, EnEnt_Customer_Enterprise.class.getName());
// db.commit();
// }catch(Exception ex){
// db.rollback();
// throw ex;
// }
//
// if (aEnEnt_Customer_Enterprise.length == 0) {
// levin.iMessage msg = levin.iMessage.getNewInstance("企业客户管理|企业信息",
// "没有相同名称,该企业没有被收藏.", "closeSelf();");
// msg.save(request);
// return this.getTargetPage("Message");
//
// } else {
// int i;
// boolean b=true;
// StringBuffer sb = new StringBuffer();
// for(i=0;i<aEnEnt_Customer_Enterprise.length;i++) {
// if(aEnEnt_Customer_Enterprise[i].getChIsAudited().equals("1")) {
// b=true;
// }else {
// b=false;
// sb.append(aEnEnt_Customer_Enterprise[i].getChCommitName());
// }
// }
// if(b) {
// levin.iMessage msg = levin.iMessage.getNewInstance("企业信息",
// "该企业已经签约.", "closeSelf()");
// msg.save(request);
// return this.getTargetPage("Message");
//
// }else {
//
// levin.iMessage msg = levin.iMessage.getNewInstance("企业信息",
// "该企业未签约但已经被"+sb.toString()+"收藏!", "closeSelf()");
// msg.save(request);
// return this.getTargetPage("Message");
// }
// }
//
//
//
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -