瀏覽代碼

手机、APP运用首页新增品牌建设下项目
APP新增修改头像、昵称、个人资料

anderx 7 年之前
父節點
當前提交
e5c5c4e913

+ 25 - 3
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -5,6 +5,9 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
@@ -113,9 +116,19 @@ public class AppUserController extends CertifyApiController {
 	@RequestMapping(value = "/updateUser",method = RequestMethod.POST)
 	public Result updateUser(User u){
 		Result res = new Result();
-		if(StringUtils.isBlank(u.getNickname())){
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"用户昵称不能为空"));
-			return res;
+		if(u!=null&&StringUtils.isNotEmpty(u.getMobile())){
+			//验证手机号码格式是否正确
+			Pattern p = Pattern.compile("^(1[1-9][0-9])\\d{8}$"); // 验证手机号           
+			Matcher m = p.matcher(u.getMobile());   
+			if(!m.matches()){
+				res.getError().add(buildError("电话号码格式不对","电话号码格式不对"));
+			}else{
+				//验证手机是否存在
+				int i = userService.getCountByMobile(u.getId(),u.getMobile(),u.getType());
+				if(i>0){
+					res.getError().add(buildError("电话号码重复","电话号码重复"));
+				}
+			}
 		}
 		u.setId(TokenManager.getUserId());
 		userServiceImpl.updateByPrimaryKeySelective(u);
@@ -862,4 +875,13 @@ public class AppUserController extends CertifyApiController {
 		result.setData(messageService.updateAppReadMessage(id));
 		return result;
 	}
+	
+	/** 图片上传 **/
+	@RequestMapping(value = "/uploadHeadPortrait", method = RequestMethod.POST)
+	public Result uploadCustomerImg(HttpServletRequest req,String sign){
+		Result res = new Result();
+		res.setData(handleFile(res, "/customer_head_portrait/", false, req, sign));
+		return res;
+	}
+	
 }

+ 1 - 1
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -206,7 +206,7 @@ public class OpenAppHomeController extends BaseApiController{
 	@RequestMapping(value = "/getApplicationData" , method = RequestMethod.GET)
 	public Result getApplicationData() {
 		Result result=new Result();
-		Map<String, Object> map=jtTagService.getApplicationData(3,1,3,3,3,1,2);
+		Map<String, Object> map=jtTagService.getApplicationData(3,1,3,3,3,1,2,2);
 		map.put("technologyProject", jtBusinessService.getCategoryByModule(5,2,6));
 		result.setData(map);
 		return result;

+ 1 - 1
src/main/java/com/goafanti/business/service/JtTagService.java

@@ -18,7 +18,7 @@ public interface JtTagService {
 
 	Pagination<JtTagBo> selectListJtTag(JtTag a, Integer pageNo, Integer pageSize);
 	
-	Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 );
+	Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 ,Integer size8 );
 
 	
 

+ 2 - 1
src/main/java/com/goafanti/business/service/impl/JtTagServiceImpl.java

@@ -52,7 +52,7 @@ public class JtTagServiceImpl   extends BaseMybatisDao<JtTagMapper> implements J
 	}
 
 	@Override
-	public Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 ) {
+	public Map<String,Object> getApplicationData(Integer size1,Integer size2,Integer size3,Integer size4,Integer size5 ,Integer size6 ,Integer size7 ,Integer size8) {
 		Map<String, Object> map=new HashMap<>();
 		map.put("military", jtBusinessProjectMapper.getProjectByTag("军工市场采购",size1));
 		map.put("government", jtBusinessProjectMapper.getProjectByTag("政府市场采购", size2));
@@ -61,6 +61,7 @@ public class JtTagServiceImpl   extends BaseMybatisDao<JtTagMapper> implements J
 		map.put("financingLease", jtBusinessProjectMapper.getProjectByTag("融资租售", size5));
 		map.put("defenseWeapon", jtBusinessProjectMapper.getProjectByTag("攻防利器", size6));
 		map.put("ownUse", jtBusinessProjectMapper.getProjectByTag("他山己用", size7));
+		map.put("brandBuilding", jtBusinessProjectMapper.getProjectByTag("品牌建设",size8));
 		return map;
 	}
 }

+ 2 - 1
src/main/java/com/goafanti/common/utils/FileUtils.java

@@ -97,7 +97,8 @@ public class FileUtils {
 		String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
 		boolean uniq = false;
 		if (sign.indexOf("demand_picture") != -1|| sign.indexOf("achievement_picture") != -1 || sign.indexOf("user_picture")!=-1
-				|| sign.indexOf("jt_project_picture")!=-1 || sign.indexOf("jt_business_picture")!=-1 || sign.indexOf("honor_picture")!=-1|| sign.indexOf("banners")!=-1) {
+				|| sign.indexOf("jt_project_picture")!=-1 || sign.indexOf("jt_business_picture")!=-1 || sign.indexOf("honor_picture")!=-1
+				|| sign.indexOf("banners")!=-1|| sign.indexOf("head_portrait")!=-1) {
 			uniq = true;
 		}
 		String fileName = "";