Преглед изворни кода

Merge branch 'test' of jishutao/kede-server into prod

anderx пре 1 година
родитељ
комит
4d65718c77

+ 15 - 20
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -1,18 +1,5 @@
 package com.goafanti.common.controller;
 
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Random;
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.view.RedirectView;
 import com.goafanti.achievement.bo.AchievementListBo;
 import com.goafanti.achievement.bo.AchievementPartnerListBo;
 import com.goafanti.achievement.service.AchievementService;
@@ -20,11 +7,7 @@ import com.goafanti.app.bo.ProjectBo;
 import com.goafanti.app.bo.ProjectDetailBo;
 import com.goafanti.app.bo.ServiceImages;
 import com.goafanti.business.service.BusinessProjectService;
-import com.goafanti.common.enums.AchievementBargainingMode;
-import com.goafanti.common.enums.AchievementMaturity;
-import com.goafanti.common.enums.AchievementTransferMode;
-import com.goafanti.common.enums.UserLevel;
-import com.goafanti.common.enums.UserType;
+import com.goafanti.common.enums.*;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -40,6 +23,20 @@ import com.goafanti.portal.bo.DemandPortalSimilarListBo;
 import com.goafanti.user.bo.UserPartnerDetailBo;
 import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.view.RedirectView;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
 
 @Controller
 public class PortalController extends BaseController {
@@ -52,8 +49,6 @@ public class PortalController extends BaseController {
 	@Resource
 	private UserIdentityService	userIdentityService;
 	@Resource
-	private FieldGlossoryService fieldGlossoryService;
-	@Resource
 	private DemandInterestService  demandInterestService;
 	@Resource
 	private UserService userService;

+ 0 - 52
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -4,7 +4,6 @@ import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.banners.enums.BannersType;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.model.Banners;
-import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.news.bo.NewsPortalList;
 import com.goafanti.news.enums.NewsType;
@@ -60,57 +59,6 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 
-	@RequestMapping(value = "/user/account/set", method = RequestMethod.GET)
-	public ModelAndView userSet(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/account/set");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/account/achievement", method = RequestMethod.GET)
-	public ModelAndView userAchievement(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/account/achievement");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/account/demand", method = RequestMethod.GET)
-	public ModelAndView userDemand(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/account/demand");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/login", method = RequestMethod.GET)
-	public String userLogin(HttpServletRequest request, ModelAndView modelview) {
-		return "/user/login";
-	}
-
-	@RequestMapping(value = "/user/logout", method = RequestMethod.GET)
-	public String userLogout(HttpServletRequest request, ModelAndView modelview) {
-		TokenManager.logout();
-		//return userLogin(request, modelview);
-		return "redirect:/admin/login";
-	}
-
-	@RequestMapping(value = "/user/signIn", method = RequestMethod.GET)
-	public String userSignin(HttpServletRequest request, ModelAndView modelview) {
-		return "/user/signIn";
-	}
-
-	@RequestMapping(value = "/user/msignIn", method = RequestMethod.GET)
-	public String mSignin(HttpServletRequest request, ModelAndView modelview) {
-		return "/user/msignIn";
-	}
-
-	@RequestMapping(value = "/user/certify", method = RequestMethod.GET)
-	public ModelAndView userCertify(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/certify");
-		return modelview;
-	}
-
-	@RequestMapping(value = "/user/groupCertify", method = RequestMethod.GET)
-	public ModelAndView userGroupCertify(HttpServletRequest request, ModelAndView modelview) {
-		modelview.setViewName("/user/groupCertify");
-		return modelview;
-	}
 
 	@RequestMapping(value = "/admin/login", method = RequestMethod.GET)
 	public String adminLogin(HttpServletRequest request, ModelAndView modelview) {

+ 13 - 3
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -298,9 +298,19 @@
 
     <select id="selectByMobile" parameterType="java.lang.String" resultMap="BaseResultMap">
         select
-        <include refid="Base_Column_List" />
-        from admin
-        where mobile = #{mobile,jdbcType=VARCHAR}
+            a.id,a.mobile,a.name,
+            a.password,a.email,a.create_time,
+            a.number,b.province ,a.position,
+            a.superior_id,a.city,a.department_id,
+            a.status,a.user_no,a.duty,
+            a.district,a.head_portrait_url,a.contact_mobile,
+            a.last_login_time,a.open_id,a.type,
+            a.reviewer,a.amb_id,a.amb_role,
+            a.amb_manage,a.manager_id,a.senior_staff,
+            a.public_purview,a.expense_open_id,a.expense_super_examine
+        from admin a left join department b on a.department_id=b.id
+        left join district_glossory c on b.province=c.id
+        where a.mobile = #{mobile,jdbcType=VARCHAR}
     </select>
 
     <select id="selectRolesByPrimaryKey" parameterType="java.lang.String" resultType="com.goafanti.common.model.Role">

+ 1 - 0
src/main/java/com/goafanti/common/model/AftUser.java

@@ -15,4 +15,5 @@ public interface AftUser {
 
 	Integer getType();
 
+
 }

+ 2 - 1
src/main/java/com/goafanti/common/model/User.java

@@ -1,6 +1,5 @@
 package com.goafanti.common.model;
 
-import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -539,4 +538,6 @@ public class User implements AftUser{
     public void setNewChannel(Integer newChannel) {
         this.newChannel = newChannel;
     }
+
+
 }

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

@@ -22,10 +22,7 @@ import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
+import java.util.*;
 
 
 @Component
@@ -51,7 +48,6 @@ public class ReleaseUserTask {
 	/**
 	 * 每天凌晨一点
 	 *
-	 * @throws InterruptedException
 	 */
 //	@Scheduled(cron = "0 52 10  * * ?")
 //	@RequestMapping("/open/test")
@@ -130,11 +126,13 @@ public class ReleaseUserTask {
 				}
 			}
 			List<LockingReleaseBo> newList = new ArrayList<LockingReleaseBo>();
-			if (lockUserList != null && lockUserList.size() > 0) {
+			Timer timer=new Timer();
+
+			if (lockUserList != null && !lockUserList.isEmpty()) {
 				for (int i = 0; i < lockUserList.size(); i++) {
 					newList.add(lockUserList.get(i));
 					if (pointsDataLimit == newList.size() || i == lockUserList.size() - 1) {
-						if (newList.size() > 0) {
+						if (!newList.isEmpty()) {
 							customerService.updatePendingReleaseLock(newList);
 						}
 						newList.clear();
@@ -158,6 +156,8 @@ public class ReleaseUserTask {
 		LoggerUtils.debug(getClass(), "==============客户释放完成============");
 	}
 
+
+
 	private void pushSalesmanCount(List<LockingReleaseBo> aidList) {
 		for (LockingReleaseBo e : aidList) {
 			String dates= e.getLockTime();

+ 12 - 17
src/main/java/com/goafanti/core/shiro/token/UserRealm.java

@@ -1,22 +1,5 @@
 package com.goafanti.core.shiro.token;
 
-import java.util.Set;
-
-import javax.annotation.Resource;
-
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authc.AuthenticationException;
-import org.apache.shiro.authc.AuthenticationInfo;
-import org.apache.shiro.authc.AuthenticationToken;
-import org.apache.shiro.authc.SimpleAuthenticationInfo;
-import org.apache.shiro.authc.UnknownAccountException;
-import org.apache.shiro.authz.AuthorizationInfo;
-import org.apache.shiro.authz.SimpleAuthorizationInfo;
-import org.apache.shiro.realm.AuthorizingRealm;
-import org.apache.shiro.subject.PrincipalCollection;
-import org.apache.shiro.subject.SimplePrincipalCollection;
-import org.springframework.beans.factory.annotation.Autowired;
-
 import com.goafanti.admin.service.AdminService;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.AftUser;
@@ -25,6 +8,17 @@ import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.permission.service.PermissionService;
 import com.goafanti.permission.service.RoleService;
 import com.goafanti.user.service.UserService;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.*;
+import org.apache.shiro.authz.AuthorizationInfo;
+import org.apache.shiro.authz.SimpleAuthorizationInfo;
+import org.apache.shiro.realm.AuthorizingRealm;
+import org.apache.shiro.subject.PrincipalCollection;
+import org.apache.shiro.subject.SimplePrincipalCollection;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.annotation.Resource;
+import java.util.Set;
 
 public class UserRealm extends AuthorizingRealm {
 	@Autowired
@@ -52,6 +46,7 @@ public class UserRealm extends AuthorizingRealm {
 		ShiroToken token = (ShiroToken) authcToken;
 		if (null == token.getType()) {
 			Admin admin = adminService.selectByMobile(token.getUsername());
+			System.out.println(admin.getProvince());
 			if (null == admin) {
 				throw new UnknownAccountException();
 			}

+ 10 - 0
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -312,6 +312,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		AdminListBo a =adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 		p.setAid(a.getId());
 		p.setAname(a.getName());
+		//如果是官费
 		if (p.getChooseType()==2) {
 			TOrderTask t=new TOrderTask();
 			t.setId(p.getTid());
@@ -974,18 +975,27 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		return true;
 	}
 
+	/**
+	 * 外包/供应商 计算金额
+	 * @param p
+	 */
 	@Override
 	public void checkGetAmount(TOrderPayment p) {
+		//如果没有金额
 		if(p.getApplicationAmount()==null) {
 			BigDecimal count=new BigDecimal(0);
+			//是第三方 获取第三方列表与金额 录入企业与价格
 			if(p.getChooseType()==0) {
 				ThirdPartyCompany tpc=thirdPartyCompanyMapper.selectByPrimaryKey(p.getTpcId());
 				count=tpc.getUnitPrice().multiply(new BigDecimal(p.getQuantity()));
+				//是催款 计算催款的金额
 			} else if (p.getChooseType()==1) {
 				PaymentNode pn=paymentNodeMapper.selectByPrimaryKey(p.getNodeId());
 				count=pn.getUnitPrice().multiply(new BigDecimal(p.getQuantity()));
+				//是官费 计算官费
 			}else if (p.getChooseType()==2) {
 				ProjectTypePuls ot=tOrderTaskMapper.selectByTidGetDtails(p.getTid());
+				//看项目是否设置有无费减 无费减获取券金额,有费减获取85%金额
 				if (ot.getCostReduction()==0) {
 					count=ot.getOfficialAmount().multiply(new BigDecimal(p.getQuantity()));
 				}else {

+ 0 - 2
src/main/java/com/goafanti/user/controller/UserLoginController.java

@@ -127,8 +127,6 @@ public class UserLoginController extends BaseController {
 	/**
 	 * 忘记密码 使用手机号+手机验证码登录
 	 *
-	 * @param mobileCode
-	 * @return
 	 */
 	@RequestMapping(value = "/mobileSigin", method = RequestMethod.POST)
 	@ResponseBody

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -51,7 +51,7 @@ yxjl_max=100
 
 amb.maxLvl=6
 
-static.host=//static.jishutao.com/1.3.06
+static.host=//static.jishutao.com/1.3.07
 #static.host=//172.16.1.187/1.3.04
 #avatar.host=//172.16.0.255:3000
 #static.host=//172.16.0.255:3000/1.2.62

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -52,7 +52,7 @@ amb.maxLvl=6
 
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.3.06
+static.host=//static.jishutao.com/1.3.07
 rd.static.host=//static.jishutao.com/RD/1.0.03
 avatar.upload.host=//static.jishutao.com/upload
 

+ 1 - 0
src/main/webapp/WEB-INF/views/common.html

@@ -365,6 +365,7 @@
 				createTime : /*[[${adminData.createTime}]]*/'',
 				uid : /*[[${adminData.id}]]*/'',
 				departmentId : /*[[${adminData.departmentId}]]*/'',
+				province : /*[[${adminData.province}]]*/null,
 				isSuperAdmin : /*[[${shiro.hasRole('999999')}]]*/false,
 				isApprovalDecision : /*[[${shiro.hasRole('99999')}]]*/false,
 				isLegal: /*[[${shiro.hasRole('82')}]]*/false,