瀏覽代碼

新增领取限定项目,如果有客户项目

anderx 1 年之前
父節點
當前提交
01e0ace2f9

+ 3 - 1
src/main/java/com/goafanti/business/service/impl/RestrictProjectServiceImpl.java

@@ -72,7 +72,7 @@ public class RestrictProjectServiceImpl extends BaseMybatisDao<RestrictProjectMa
             in.setId(use.getId());
             restrictProjectMapper.updateByPrimaryKeySelective(in);
         }
-        int i = userBusinessMapper.judgeBusiness(in.getUid(), in.getPid(), TokenManager.getAdminId());
+        int i = userBusinessMapper.judgeBusiness(in.getUid(), in.getPid(),null);
         if (i==0){
             UserBusiness ub=new UserBusiness();
             ub.setId(UUID.randomUUID().toString());
@@ -84,6 +84,8 @@ public class RestrictProjectServiceImpl extends BaseMybatisDao<RestrictProjectMa
             ub.setCreateTime(new Date());
             ub.setRemarks("领取限定项目触发");
             userBusinessMapper.insertSelective(ub);
+        }else {
+            userBusinessMapper.updateAidByUidAndPid(aid,in.getUid(),in.getPid());
         }
         addUserLog(in,0);
         User user = userMapper.queryById(in.getUid());

+ 3 - 2
src/main/java/com/goafanti/common/dao/UserBusinessMapper.java

@@ -4,9 +4,9 @@ import com.goafanti.common.model.UserBusiness;
 import com.goafanti.common.model.UserBusinessExample;
 import com.goafanti.customer.bo.BusinessListBo;
 import com.goafanti.customer.bo.BussinessFollowBo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import org.apache.ibatis.annotations.Param;
 
 public interface UserBusinessMapper {
 
@@ -95,5 +95,6 @@ public interface UserBusinessMapper {
 	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
 
 	int checkLock(@Param("aid")String aid, @Param("uid")String uid, @Param("pid")String pid);
-	
+
+	void updateAidByUidAndPid(@Param("aid") String aid, @Param("uid") String uid, @Param("pid") String pid);
 }

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

@@ -471,7 +471,12 @@
 	set aid= #{transferId,jdbcType=VARCHAR}
 	where aid= #{aid,jdbcType=VARCHAR}
   </update>
-  <select id="selectBusinessProjectByUAPid" resultType="com.goafanti.customer.bo.BusinessListBo">
+    <update id="updateAidByUidAndPid">
+        update user_business
+        set aid = #{aid}
+        where uid = #{uid} and business_project_id = #{pid}
+    </update>
+    <select id="selectBusinessProjectByUAPid" resultType="com.goafanti.customer.bo.BusinessListBo">
   select 
 		a.id as businessId,
 		a.uid,

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

@@ -509,7 +509,7 @@ public class AdminCustomerApiController extends BaseApiController{
 	}
 
 	/** 添加拜访记录、客户跟进
-	 * @param type 0=客户拜访,2=限定项目拜访
+	 * @param type 0=客户拜访,1=限定项目拜访
 	 * **/
 	@RequestMapping(value = "/addFollow", method = RequestMethod.POST)
 	public Result addFollow(String userBusinessList,String uid,String ocbId,String contactType,

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

@@ -826,7 +826,6 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 						throw new BusinessException(new Error(ErrorConstants.BUSINESS_ALREADY_LOCKED, ""));
 					}
 				}
-
 				userBusiness.setBusinessProjectId(ub.getBusinessProjectId());
 				userBusiness.setCustomerStatus(ub.getCustomerStatus());
 				userBusiness.setFollowSituation(ub.getFollowSituation());