Browse Source

新增客户新增省市区字段

anderx 7 years ago
parent
commit
0db89e1980

+ 1 - 1
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -26,7 +26,7 @@ public class ReleaseUserTask {
 	/**
 	 * 每天凌晨一点释放客户和业务
 	 */
-	@Scheduled(cron = "0 0 1 * * ?") 
+	@Scheduled(cron = "0 0 9 * * ?") 
 //	@RequestMapping(value = "/releaseUser")
 	public void releaseUser(){
 		Date releaseTime = new Date();

+ 6 - 5
src/main/java/com/goafanti/customer/controller/AdminCustomerApiController.java

@@ -50,7 +50,7 @@ import com.goafanti.customer.bo.UserDetailBo;
 import com.goafanti.customer.service.CustomerService;
 
 @RestController
-@RequestMapping("/api/admin/customer")
+@RequestMapping("/open/api/admin/customer")
 public class AdminCustomerApiController extends BaseApiController{
 	@Resource
 	private CustomerService customerService;
@@ -177,14 +177,15 @@ public class AdminCustomerApiController extends BaseApiController{
 	 * @throws Exception 
 	 * @throws NumberFormatException **/
 	@RequestMapping(value = "/addCustomer", method = RequestMethod.POST)
-	public Result addCustomer(String name,String contacts,String contactMobile,Integer type,Integer source,String societyTag) throws Exception{
+	public Result addCustomer(String name,String contacts,String contactMobile,Integer type,
+			 Integer province ,Integer city, Integer area,Integer source,String societyTag) throws Exception{
 		Result res = new Result();
 		if(StringUtils.isBlank(name) || StringUtils.isBlank(contacts)
-				|| StringUtils.isBlank(contactMobile) || StringUtils.isBlank(societyTag)){
-			res.getError().add(buildError("","客户名称、联系人、联系电话、社会性质不能为空"));
+				|| StringUtils.isBlank(contactMobile) || StringUtils.isBlank(societyTag)||null==province||null==city||null==area){
+			res.getError().add(buildError("","客户名称、联系人、联系电话、社会性质、地址不能为空"));
 			return res;
 		}
-		customerService.addCustomer(name, contacts, contactMobile,type,source,societyTag);
+		customerService.addCustomer(name, contacts, contactMobile,type,source,societyTag,province,city,area);
 		return res;
 	}
 	

+ 4 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -133,9 +133,12 @@ public interface CustomerService {
 	 * @param contactMobile 联系电话
 	 * @param type 客户类型
 	 * @param societyTag 社会属性
+	 * @param area 
+	 * @param city 
+	 * @param province 
 	 * @return
 	 */
-	int addCustomer(String name,String contacts,String contactMobile,Integer type,Integer source,String societyTag)  throws BusinessException;
+	int addCustomer(String name,String contacts,String contactMobile,Integer type,Integer source,String societyTag, Integer province, Integer city, Integer area)  throws BusinessException;
 	
 	
 	/**

+ 8 - 1
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -210,7 +210,8 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 
 	@Override
 	@Transactional
-	public int addCustomer(String name, String contacts, String contactMobile, Integer type, Integer source,String societyTag)  throws BusinessException{
+	public int addCustomer(String name, String contacts, String contactMobile, Integer type, Integer source,String societyTag, 
+			Integer province ,Integer city, Integer area)  throws BusinessException{
 		User user = new User();
 		Date now = new Date();
 		String uid = UUID.randomUUID().toString();
@@ -240,6 +241,9 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 			ui.setContacts(contacts);
 			ui.setContactMobile(contactMobile);
 			ui.setUsername(name);
+			ui.setProvince(province);
+			ui.setCity(city);
+			ui.setArea(area);
 			ui.setExpert(AFTConstants.NO);
 			ui.setCelebrity(AFTConstants.NO);
 			ui.setInternational(AFTConstants.NO);
@@ -254,6 +258,9 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 			oi.setUid(uid);
 			oi.setContacts(contacts);
 			oi.setContactMobile(contactMobile);
+			oi.setLocationProvince(province);
+			oi.setLocationCity(city);
+			oi.setLocationArea(area);
 			oi.setHighTechZone(AFTConstants.NO);
 			oi.setInternational(AFTConstants.NO);
 			oi.setListed(AFTConstants.NO);