Parcourir la source

技淘BUG修复

anderx il y a 7 ans
Parent
commit
3e083f3cfa

+ 4 - 3
.settings/org.eclipse.wst.common.component

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
     <wb-module deploy-name="jitao-server">
+        <wb-resource deploy-path="/WEB-INF/web.xml" source-path="/src/main/webapp/WEB-INF/web.xml"/>
         <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
-        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
         <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
-        <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
-        <property name="context-root" value="jitao-server"/>
+        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
+        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
         <property name="java-output-path" value="/jitao-server/bin"/>
+        <property name="context-root" value="local"/>
     </wb-module>
 </project-modules>

+ 1 - 1
.settings/org.eclipse.wst.common.project.facet.core.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <faceted-project>
   <installed facet="java" version="1.8"/>
-  <installed facet="jst.web" version="3.0"/>
   <installed facet="wst.jsdt.web" version="1.0"/>
+  <installed facet="jst.web" version="3.1"/>
 </faceted-project>

+ 43 - 2
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -15,6 +15,7 @@ import org.springframework.http.HttpMethod;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 import com.alibaba.fastjson.JSONObject;
 import com.goafanti.achievement.bo.InputAchievement;
@@ -38,6 +39,9 @@ import com.goafanti.common.model.MessageProducer;
 import com.goafanti.common.model.User;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.PasswordUtil;
+import com.goafanti.common.utils.TimeUtils;
+import com.goafanti.common.utils.VerifyCodeUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.bo.InputDemand;
 import com.goafanti.demand.service.DemandService;
@@ -79,6 +83,10 @@ public class AppUserController extends BaseApiController {
 	AchievementInterestService achievementInterestService;
 	@Resource
 	private FieldGlossoryService fieldGlossoryService;
+	@Resource
+	private UserService	userService;
+	@Resource(name = "passwordUtil")
+	private PasswordUtil			passwordUtil;
 	
 	@RequestMapping(value = "/uploadImg",method = RequestMethod.POST)
 	public Result uploadAvatar(HttpServletRequest req){
@@ -130,10 +138,10 @@ public class AppUserController extends BaseApiController {
 	@RequestMapping(value = "/listMessage", method = RequestMethod.POST)
 	public Result listMessage(Integer subject,Integer sourceType,Integer pageNo,Integer pageSize){
 		Result res = new Result();
-		if(null == subject){
+		/*if(null == subject){
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "必须指定消息类型"));
 			return res;
-		}
+		}*/
 		User u = TokenManager.getUserToken();
 		if(u != null){
 			List<MessageBo> boList = messageService.selectSyncMessage(u.getId()); 
@@ -163,6 +171,8 @@ public class AppUserController extends BaseApiController {
 		return res;
 	}
 	
+	
+	
 	/**
 	 * 同步绑定账号
 	 * @param uuid
@@ -548,4 +558,35 @@ public class AppUserController extends BaseApiController {
 			return res().error(buildError("user only", "必须是登录会员才能访问。"));
 		}
 	}
+	
+	@RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
+	@ResponseBody
+	public Result resetPassword(String userName,String newPwd,String pwd) {
+		Result res=new Result();
+		if(null == TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE)){
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME, "", "页面超时失效,请重新获取!"));
+			cleanCodeSession();
+			return res;
+		}		
+		if (StringUtils.isBlank(newPwd)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "新密码"));
+			return res;
+		}
+		if (StringUtils.isBlank(userName)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户名"));
+			return res;
+		}
+		User user=userService.selectByNameAndType(userName, null);
+		user.setPassword(newPwd);
+		user.setPassword(passwordUtil.getEncryptPwd(user));
+		userService.updateByPrimaryKeySelective(user);
+		return res;
+		
+	}
+	private void cleanCodeSession() {
+		VerifyCodeUtils.clearResetCode();
+		VerifyCodeUtils.clearResetCodeTime();
+		VerifyCodeUtils.clearMobileCode();
+		VerifyCodeUtils.clearMobileCodeTime();
+	}
 }

+ 56 - 0
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -632,6 +632,62 @@ public class PublicController extends BaseController {
 		return result;
 		
 	}
+
+	/**
+	 * APP重置密码
+	 */
+	@RequestMapping(value = "/appResetPwd", method = RequestMethod.POST)
+	@ResponseBody
+	public Result resetPwd(String resetCode, String username,String mobile, Integer type, String newPwd) {
+		Result res = new Result();
+		if (TimeUtils.checkOverTime(VerifyCodeUtils.M_CODE)) {
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME, "", "页面超时失效,请重新获取验证码!"));
+			cleanCodeSession();
+			return res;
+		}
+		if(null == TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE)){
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_OVERTIME, "", "页面超时失效,请重新获取验证码!"));
+			cleanCodeSession();
+			return res;
+		}else if(!TokenManager.getSession().getAttribute(VerifyCodeUtils.RESET_CODE).equals(resetCode)){
+			res.getError().add(buildError(ErrorConstants.RESET_CODE_ERROR, "", "验证码错误,请重新获取验证码!"));
+			cleanCodeSession();
+			return res;
+		}
+		if (StringUtils.isBlank(newPwd)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "新密码"));
+			return res;
+		}
+
+		if (StringUtils.isBlank(mobile)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "mobile"));
+			return res;
+		}
+		if (StringUtils.isBlank(username)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "用户"));
+			return res;
+		}
+
+		if (!UserType.ORGANIZATION.getCode().equals(type) && !UserType.PERSONAL.getCode().equals(type)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "type"));
+			return res;
+		}
+
+		User user = userService.selectByNameAndType(username, null);
+		if (null == user) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "用户"));
+			return res;
+		}
+		user.setPassword(newPwd);
+		user.setPassword(passwordUtil.getEncryptPwd(user));
+		userService.updateByPrimaryKeySelective(user);
+		VerifyCodeUtils.clearResetCode();
+		VerifyCodeUtils.clearResetCodeTime();
+		return res;
+	}
+	
+	
+	
 	
 	
 	

+ 1 - 1
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -650,7 +650,7 @@
   and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
   </if>
   <if test="orderType!=null and orderType==0">
-  order by release_date
+  order by release_date desc
   </if>
   <if test="orderType!=null and orderType==1">
   order by jtbp.price

+ 2 - 2
src/main/java/com/goafanti/common/mapper/NewsMapper.xml

@@ -265,8 +265,8 @@
 			a.content,
 			release_date as releaseDate
 		from news a
-		where
-		(a.type = 0 or a.type = 99 or a.type =98)
+		where 1=1
+		<!-- and (a.type = 0 or a.type = 99 or a.type =98) -->
 		<if test="provinceId != null">
 			and a.province_id = #{provinceId,jdbcType=INTEGER}
 		</if>

+ 1 - 1
src/main/java/com/goafanti/message/service/impl/MessageServiceImpl.java

@@ -362,8 +362,8 @@ public class MessageServiceImpl  extends BaseMybatisDao<MessageFromSystemMapper>
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<MessageListBo> listPersonalMessage(Integer subject, Integer resourceType,Integer pageNo,Integer pageSize) {
-		if(subject == SubjectType.KE_HU.getTypeCode() || subject == SubjectType.TUI_JIAN.getTypeCode()){
 			Map<String,Object> params = new HashMap<String, Object>();
+			if(subject == SubjectType.KE_HU.getTypeCode() || subject == SubjectType.TUI_JIAN.getTypeCode()){
 			if(null != subject) params.put("subject", subject);
 			if(null != resourceType) params.put("resourceType", resourceType);
 			params.put("uid", TokenManager.getUserId());

+ 11 - 7
src/main/java/com/goafanti/user/controller/UserLoginController.java

@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.UnknownAccountException;
 import org.apache.shiro.web.util.SavedRequest;
 import org.apache.shiro.web.util.WebUtils;
 import org.springframework.stereotype.Controller;
@@ -45,6 +46,7 @@ public class UserLoginController extends BaseController {
 	@Resource
 	private MessageService messageService;
 	
+	
 	@RequestMapping(value = "/login", method = RequestMethod.GET)
 	@ResponseBody
 	public Result login(HttpServletRequest request, Model model) {
@@ -89,16 +91,18 @@ public class UserLoginController extends BaseController {
 	public Result mLogin(User user, Boolean remember, HttpServletRequest request) {
 		Result res = new Result();
 		JSONObject jo = (JSONObject) JSON.toJSON(TokenManager.login(user, remember));
-		
-		UserBasicInfo ubi=userService.selectBaseInfo();
-		jo.put("easemobName",ubi.getEasemobName());
-		jo.put("easemobPass",ubi.getEasemobPass());
+		SavedRequest sr = WebUtils.getAndClearSavedRequest(request);
+		if (sr != null) {
+			jo.put("requestURI", sr.getRequestURI());
+			jo.put("queryString", sr.getQueryString());
+		}
 		res.setToken(SecurityUtils.getSubject().getSession().getId());
 		res.setData(jo);
 		// 发送推送消息
-		sendMessageAfterLogin(); 
+		//sendMessageAfterLogin(); 
 		return res;
 	}
+	
 
 	/**
 	 * 管理端登录
@@ -154,7 +158,7 @@ public class UserLoginController extends BaseController {
 	
 	/**
 	 * 登陆时查询未发送消息指定发送 
-	 */
+	 
 	private void sendMessageAfterLogin(){
 		//更新 message_producer
 		User u = TokenManager.getUserToken();
@@ -183,5 +187,5 @@ public class UserLoginController extends BaseController {
 			}
 			messageService.updateJpushEasemobAccount(null, null, null,null);
 		}
-	}
+	}*/
 }

+ 3 - 3
src/main/java/com/goafanti/user/controller/UserRegisterController.java

@@ -121,7 +121,7 @@ public class UserRegisterController extends BaseController {
 		}
 		User u = userService.selectByNameAndType(user.getUsername().trim(), null);
 		if (null != u) {
-				res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
+			res.getError().add(buildError(ErrorConstants.USER_ALREADY_EXIST, "用户已存在"));
 		}
 		// 验证码15分钟有效
 		if (TimeUtils.checkOverTime("register")) {
@@ -150,9 +150,9 @@ public class UserRegisterController extends BaseController {
 			us.setShareType(AFTConstants.USER_SHARE_PUBLIC);
 			us.setIdentifyName(StringUtils.isBlank(user.getUnitName())?"":user.getUnitName());
 			us.setLvl(UserLevel.GENERAL.getCode());
+			us.setAuthentication(UserAuthentication.UN_AUTHENTICATION.getCode());
+			us.setTransferTime(now.getTime());
 			userService.insertRegister(us,user.getUnitName(),user.getUsername());
-//			User currentUser = userService.selectByPrimaryKey(us.getId()); 			
-//			registerEasemobAfterRegister(uuid,currentUser);//开通环信账号
 		}
 		return res;
 	}

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/index.html


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/patent.html


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceDetails.html


+ 4 - 4
src/main/webapp/WEB-INF/views/portal/technologyTrading/achievementDetail.html

@@ -30,10 +30,10 @@
 			<div class="detail_center">
 				<div class="detail_centerimg" th:each="achievementdetail:${achievementdetail}">
 					<div class="big_text">
-						<h3 th:text="${achievementdetail.name}" type="2"  class="orderType"></h3>
+						<h3 th:text="${achievementdetail.name}" type="2"  class="cname orderType"></h3>
 					</div>
 					<div class="big_img">
-						<div th:if="${achievementdetail.firstPicture} == null ">
+						<div class ="serviceDetailsImg" th:if="${achievementdetail.firstPicture} == null ">
 							<img th:src="${portalHost+'/img/initPic/achievementInit.jpg'}" alt=""/>
 						</div>
 						<div th:if="${achievementdetail.firstPicture} != null ">
@@ -59,9 +59,9 @@
 						<div class="inline_span">
 							<span>类型:</span> <span th:text="${achievementdetail.categoryS}?${achievementdetail.categoryS}:暂无分类信息"></span>
 						</div>
-						<div class="inline_span">
+						<!-- <div class="inline_span">
    							  <span>价格:</span> <span class="price">212</span>
-						</div>
+						</div> -->
 						<div class="inline_span">
    							  <span>所属公司:</span> <span class="companyName" th:text="${achievementdetail.ownerName}==null?'佚名':${achievementdetail.ownerName}"></span>
 						</div>

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/technologyTrading/demandDetail.html

@@ -26,7 +26,7 @@
 						<h3 th:text="${#strings.abbreviate(demand.name,11)}" type="3"  class="orderType cname"></h3>
 					</div>
 					<div class="big_img">
-						<div th:if="${demand.firstPic} == null " >
+						<div class="serviceDatailsImg" th:if="${demand.firstPic} == null " >
 							<img th:src="${portalHost+'/img/initPic/demandInit.jpg'}" alt=""/>
 						</div>
 						<div th:if="${demand.firstPic} != null " >
@@ -45,7 +45,7 @@
 							<span>行业:</span>  <span th:text="${demand.industryCategory1}?${demand.industryCategory1}:暂无行业分类"></span>
 						</div>
 						<div class="inline_span" >
-							<span th:text="${demand.demandType}==3?'需求资金:':'需求预算:'">需求预算:</span> <span class="price" th:text="${demand.budgetCost}?${demand.budgetCost}:价格面议"></span>
+							<span th:text="${demand.demandType}==3?'需求资金:':'需求预算:'">需求预算:</span> <span class="price" th:text="${demand.budgetCost}?${demand.budgetCost}万元:价格面议"></span>
 						</div>
 						<div class="inline_span">
    							  <span>所属公司:</span> <span class="companyName" th:text="${demand.employerName}==null?'佚名':${demand.employerName}"></span>