• 大小: 15.08MB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2023-07-26
  • 语言: 其他
  • 标签: ssm框架  

资源简介

这项目是ssm框架的经典案例:北风客户关系管理源码,供大家学习

资源截图

代码片段和文件信息

package com.hj.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.hj.entity.CustomerInfo;
import com.hj.entity.CustomerLevel;
import com.hj.entity.DictionaryTypeInfo;
import com.hj.service.CustomerInfoService;
import com.opensymphony.xwork2.ActionSupport;

public class AddCustomerInfoAction  extends ActionSupport{


private static final long serialVersionUID = 1L;
private String customerName;
private Integer customerPropertiesId;
private Integer customerTypeId;
private Integer levelId;
private String customerCompanyWebsize;
private String customerCompanyPhone;
private String register;
private String customerAddress;
private String customerProvinces;
private String customerCity;
private String customerCode;
private Integer openBankId;
private String bankAccount;
private Integer customerSourceId;
private String noteInformation;
private CustomerInfoService customerInfoService;//注入Service 然后再设置set和get方法

@Override
public String execute() throws Exception {
CustomerInfo customerInfo=new CustomerInfo();
customerInfo.setCustomerName(customerName);
customerInfo.setCustomerCompanyWebsize(customerCompanyWebsize);
customerInfo.setCustomerCompanyPhone(customerCompanyPhone);
customerInfo.setRegister(register);
customerInfo.setCustomerAddress(customerAddress);
customerInfo.setCustomerProvinces(customerProvinces);
customerInfo.setCustomerCity(customerCity);
customerInfo.setCustomerCode(customerCode);
customerInfo.setBankAccount(bankAccount);
customerInfo.setNoteInformation(noteInformation);

CustomerLevel customerLevel=new CustomerLevel();
    customerLevel.setLevelId(levelId);
    customerInfo.setCustomerLevel(customerLevel);

DictionaryTypeInfo dictionaryTypeInfo1 = new DictionaryTypeInfo(); 
dictionaryTypeInfo1.setDataId(customerPropertiesId);
customerInfo.setDictionaryTypeInfoByCustomerProperties(dictionaryTypeInfo1);

DictionaryTypeInfo dictionaryTypeInfo2 = new DictionaryTypeInfo(); 
    dictionaryTypeInfo2.setDataId(customerTypeId);
customerInfo.setDictionaryTypeInfoByCustomerType(dictionaryTypeInfo2);

DictionaryTypeInfo dictionaryTypeInfo3 = new DictionaryTypeInfo(); 
    dictionaryTypeInfo3.setDataId(openBankId);
customerInfo.setDictionaryTypeInfoByOpenBank(dictionaryTypeInfo3);

DictionaryTypeInfo dictionaryTypeInfo4 = new DictionaryTypeInfo(); 
    dictionaryTypeInfo4.setDataId(customerSourceId);
customerInfo.setDictionaryTypeInfoByCustomerSource(dictionaryTypeInfo4);

//判断该公司是否存在,存在就不添加并提示该公司已经存在。
if(customerInfoService.findCustomerName(customerName)==null){
customerInfoService.saveCustomerInfo(customerInfo);
}else{
HttpServletRequest request=ServletActionContext.getRequest();
request.setAttribute(“error“ “该公司已经纯在!“);
}
return this.SUCCESS;
}

public String getCustomerName() {

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2589  2013-01-15 09:50  web65\.classpath

     文件        529  2013-01-09 12:37  web65\.myhibernatedata

     文件        289  2013-01-16 12:47  web65\.mymetadata

     文件         66  2013-01-11 17:18  web65\.myumldata

     文件       1425  2013-01-16 12:43  web65\.project

     文件       1040  2013-01-16 12:47  web65\.settings\com.genuitec.eclipse.j2eedt.core.prefs

     文件        120  2013-01-09 10:23  web65\.settings\com.genuitec.jboss.ide.eclipse.xdoclet.run.prefs

     文件        595  2013-01-16 11:53  web65\.settings\org.eclipse.core.resources.prefs

     文件       2228  2013-01-09 12:37  web65\hibernate.reveng.xml

     文件       5822  2012-12-17 09:15  web65\src\com\hj\action\AddCustomerInfoAction.java

     文件       2663  2013-01-11 10:56  web65\src\com\hj\action\ComplainInfoDetailAction.java

     文件       1384  2013-01-10 19:03  web65\src\com\hj\action\ComplainInfoFindAllAction.java

     文件       1975  2013-01-10 22:14  web65\src\com\hj\action\ComplainInfoSaveAction.java

     文件       4151  2012-12-27 17:08  web65\src\com\hj\action\ContactPersonInfoSaveAction.java

     文件       4279  2012-12-27 18:21  web65\src\com\hj\action\ContactPersonInfoUpdateAction.java

     文件       2996  2013-01-11 18:44  web65\src\com\hj\action\CreateBarChartAction.java

     文件       4847  2013-01-14 12:06  web65\src\com\hj\action\CreateBarChartComplainAction.java

     文件       1654  2013-01-11 17:01  web65\src\com\hj\action\CreateJFreeChartAction.java

     文件       4184  2013-01-14 11:49  web65\src\com\hj\action\CreatePieChartComplainAction.java

     文件       3024  2012-12-15 19:14  web65\src\com\hj\action\CustomerInfoAction.java

     文件       1153  2012-12-19 19:12  web65\src\com\hj\action\CustomerInfoDetailAction.java

     文件       2313  2012-12-21 14:25  web65\src\com\hj\action\CustomerInfoQueryAction.java

     文件       2049  2012-12-19 19:16  web65\src\com\hj\action\CustomerInfoUpdateAction.java

     文件        944  2012-12-13 16:41  web65\src\com\hj\action\CustomerLevelAction.java

     文件        935  2012-12-10 15:29  web65\src\com\hj\action\DictionaryTypeAction.java

     文件       2179  2012-12-12 18:31  web65\src\com\hj\action\DictionaryTypeInfoAction.java

     文件       1515  2012-12-26 13:59  web65\src\com\hj\action\FindAllContactPersonInfoAction.java

     文件       1631  2012-12-21 13:43  web65\src\com\hj\action\FindAllCustomerInfoAction.java

     文件       1442  2013-01-07 16:54  web65\src\com\hj\action\ImgCodeAction.java

     文件       2875  2013-01-08 18:00  web65\src\com\hj\action\LoginAction.java

............此处省略1520个文件信息

评论

共有 条评论