Quellcode durchsuchen

Merge remote-tracking branch 'origin/dev' into dev

Conflicts:
	src/main/java/com/goafanti/common/mapper/CustomerMapper.xml
	src/main/java/com/goafanti/common/model/Customer.java
wanghui vor 8 Jahren
Ursprung
Commit
70407c3ee8

+ 31 - 5
src/main/java/com/goafanti/admin/controller/AdminCustomerApiController.java

@@ -14,7 +14,6 @@ import com.goafanti.admin.service.CustomerService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.Customer;
-import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 
 @RestController
@@ -34,7 +33,7 @@ public class AdminCustomerApiController extends CertifyApiController {
 	public Result addCustomer(String createTime, String companyName, String companyIndustry, String companyIntention,
 			String adress, String customerName, String mobile, String email, String qq, String wechat,
 			String customerPosition, String remark, String province, String fllowSituation, int sex,
-			String customerStatue, String department, int customerTyp, String telNum) throws ParseException {
+			String customerStatue, String department, Integer customerTyp, String telNum) throws ParseException {
 		Customer cus = new Customer();
 		Result res = new Result();
 		cus.setAdress(adress);
@@ -76,17 +75,44 @@ public class AdminCustomerApiController extends CertifyApiController {
 	}
 
 	/**
-	 * 查询客户信息
+	 * 查询客户列表
 	 * 
 	 * @return
 	 */
-	@RequestMapping(value = "/SearchCustomerList", method = RequestMethod.GET)
-	public Result SearchCustomerList(String companyName, Integer customerTyp, String province,
+	@RequestMapping(value = "/searchCustomerList", method = RequestMethod.GET)
+	public Result SearchCustomerList(String companyName, String customerTyp, String province,
 			String customerName, String telNum, String customerStatue, String CompanyIntention, String fllowSituation,Integer pageNo,Integer pageSize) {
 		Result res =new Result();
 		res.setData(customerService.findCustomerByPage(companyName, customerTyp, province, customerName, telNum, customerStatue,
 				CompanyIntention, fllowSituation,pageNo,pageSize));
 		return res;
 	}
+	
+	/**
+	 * 查询客户信息
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/findCustomer", method = RequestMethod.GET)
+	public Result SearchCustomerInfo(String id) {
+		Result res =new Result();
+		res.setData(customerService.searchCustomer(id));
+		return res;
+	}
+	
+	/**
+	 * 修改客户信息
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/updCustomerList", method = RequestMethod.GET)
+	public Result updCustomerInfo(String id,String aid,String createTime, String companyName, String companyIndustry, String companyIntention,
+			String adress, String customerName, String mobile, String email, String qq, String wechat,
+			String customerPosition, String remark, String province, String fllowSituation, int sex,
+			String customerStatue, String department, String customerTyp, String telNum) {
+		Result res =new Result();
+		customerService.updCustomer(id, aid, createTime, companyName, companyIndustry, companyIntention, adress, customerName, mobile, email, qq, wechat, customerPosition, remark, province, fllowSituation, sex, customerStatue, department, customerTyp, telNum);
+		return res;
+	}
 
 }

+ 8 - 2
src/main/java/com/goafanti/admin/service/CustomerService.java

@@ -10,7 +10,13 @@ public interface CustomerService {
 	
 	int deleteCustomer(String id);
 	
-	Pagination<Customer> findCustomerByPage(String companyName ,Integer customerTyp ,String province ,String customerName ,String telNum ,
+	Pagination<Customer> findCustomerByPage(String companyName ,String customerTyp ,String province ,String customerName ,String telNum ,
 			String customerStatue  ,String CompanyIntention  ,String fllowSituation,Integer pageNo, Integer pageSize);
-
+	
+	int updCustomer(String id,String aid,String createTime, String companyName, String companyIndustry, String companyIntention,
+			String adress, String customerName, String mobile, String email, String qq, String wechat,
+			String customerPosition, String remark, String province, String fllowSituation, int sex,
+			String customerStatue, String department, String customerTyp, String telNum);
+	
+	Customer searchCustomer(String id);
 }

+ 20 - 2
src/main/java/com/goafanti/admin/service/impl/CustomerServiceImpl.java

@@ -32,7 +32,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<Customer> findCustomerByPage(String companyName ,Integer customerTyp ,String province ,String customerName ,String telNum ,
+	public Pagination<Customer> findCustomerByPage(String companyName ,String customerTyp ,String province ,String customerName ,String telNum ,
 			String customerStatue  ,String CompanyIntention  ,String fllowSituation ,Integer pageNo, Integer pageSize) {
 		return (Pagination<Customer>) findPage("findSearchCustomerListByPage", "findSearchCustomerCount",
 				buildListParams(companyName, customerTyp, province, customerName, telNum, customerStatue, CompanyIntention, 
@@ -41,7 +41,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 	}
 	
 	
-	private Map<String, Object> buildListParams(String companyName, Integer customerTyp,String province,String customerName,String telNum,
+	private Map<String, Object> buildListParams(String companyName, String customerTyp,String province,String customerName,String telNum,
 			String customerStatue,String CompanyIntention,String fllowSituation,String aid) {
 		Map<String, Object> params = new HashMap<>();
 
@@ -72,5 +72,23 @@ public class CustomerServiceImpl extends BaseMybatisDao<CustomerMapper> implemen
 		
 		return params;
 	}
+
+
+	@Override
+	public int updCustomer(String id,String aid,String createTime, String companyName, String companyIndustry, String companyIntention,
+			String adress, String customerName, String mobile, String email, String qq, String wechat,
+			String customerPosition, String remark, String province, String fllowSituation, int sex,
+			String customerStatue, String department, String customerTyp, String telNum) {
+		
+		int res = customerMapper.updateByPrimaryKey(id,aid,createTime, companyName, companyIndustry, companyIntention, adress, customerName, mobile, 
+				email, qq, wechat, customerPosition,remark, province, fllowSituation, sex,customerStatue, department, customerTyp, telNum);
+		return res;
+	}
+
+
+	@Override
+	public Customer searchCustomer(String id) {
+		return customerMapper.selectByPrimaryKey(id);
+	}
 	
 }

+ 9 - 19
src/main/java/com/goafanti/common/dao/CustomerMapper.java

@@ -6,9 +6,8 @@ import com.goafanti.common.model.Customer;
 
 public interface CustomerMapper {
 
-
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * 删除客户信息
 	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
 	 */
 	int deleteByPrimaryKey(String id);
@@ -23,32 +22,23 @@ public interface CustomerMapper {
 	 * 分页查询客户信息
 	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
 	 */
-	List<Customer> findSearchCustomerListByPage(String companyName ,Integer customerTyp ,String province ,String customerName ,String telNum ,
+	List<Customer> findSearchCustomerListByPage(String companyName ,String customerTyp ,String province ,String customerName ,String telNum ,
 			String customerStatue  ,String CompanyIntention  ,String fllowSituation  ,String aid);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
-	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
-	 */
-	int insertSelective(Customer record);
-
 
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * 查询单个客户信息
 	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
 	 */
 	Customer selectByPrimaryKey(String id);
 
-
 	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
+	 * 修改客户信息
 	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
 	 */
-	int updateByPrimaryKeySelective(Customer record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table customer
-	 * @mbg.generated  Tue Oct 10 10:30:05 CST 2017
-	 */
-	int updateByPrimaryKey(Customer record);
+	
+	int updateByPrimaryKey(String id,String aid,String createTime, String companyName, String companyIndustry, String companyIntention,
+			String adress, String customerName, String mobile, String email, String qq, String wechat,
+			String customerPosition, String remark, String province, String fllowSituation, int sex,
+			String customerStatue, String department, String customerTyp, String telNum);
 }