Browse Source

一键转交时,将客户转换时间和所属

anderx 7 years ago
parent
commit
ba971deb0f

+ 2 - 0
src/main/java/com/goafanti/common/dao/OrganizationContactBookMapper.java

@@ -81,4 +81,6 @@ public interface OrganizationContactBookMapper {
 	int updateMainContact(@Param("ocbId")String ocbId);
 	
 	int updateSubContact(@Param("uid")String uid);
+
+	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
 }

+ 2 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -238,5 +238,7 @@ public interface UserMapper {
 	CountMarketingStatisticsBo countmarketingDepStatistics(@Param("depId")String depId, @Param("dailyStart")String dailyStart, @Param("dailyEnd")String dailyEnd);
 
 	int checkCustomerInformation(String uid);
+
+	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
 	
 }

+ 5 - 0
src/main/java/com/goafanti/common/mapper/OrganizationContactBookMapper.xml

@@ -424,4 +424,9 @@
   <update id="updateMainContact">
   	 update organization_contact_book set major = 1 where id = #{ocbId,jdbcType=VARCHAR}
   </update>
+  <update id="updateDimissionTransfer">
+  		update organization_contact_book
+		set aid=#{transferId,jdbcType=VARCHAR}
+		where aid=#{aid,jdbcType=VARCHAR}
+  </update>
 </mapper>

+ 6 - 0
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1547,4 +1547,10 @@
   <select id="selectUserByRoleName" parameterType="java.lang.String" resultMap="BaseResultMap">
   	select c.id from role a left join user_role b on a.id = b.rid left join admin c on b.uid = c.id where a.role_name in(#{roleName1},#{roleName2}) 
   </select>
+  <update id="updateDimissionTransfer">
+   update user
+		set aid=#{transferId,jdbcType=VARCHAR},
+			transfer_time=now()
+		where aid=#{aid,jdbcType=VARCHAR}
+  </update>
 </mapper>

+ 9 - 6
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -41,6 +41,7 @@ import com.goafanti.common.dao.TOrderMapper;
 import com.goafanti.common.dao.TmpTableMapper;
 import com.goafanti.common.dao.UserLockReleaseMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.dao.UserRoleMapper;
 import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
 import com.goafanti.common.enums.NoticeStatus;
@@ -60,6 +61,7 @@ import com.goafanti.common.model.TOrderDetail;
 import com.goafanti.common.model.TmpTable;
 import com.goafanti.common.model.User;
 import com.goafanti.common.model.UserLockRelease;
+import com.goafanti.common.model.UserRole;
 import com.goafanti.common.utils.BeanUtilsExt;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.MobileMessageUtils;
@@ -125,10 +127,12 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	private NoticeMapper noticeMapper;
 	@Autowired
 	private ContractTaskLogMapper contractTaskLogMapper;
-	@Resource
+	@Autowired
 	private BusinessProjectMapper businessProjectMapper;
-	@Resource
+	@Autowired
 	private UserLockReleaseMapper userLockReleaseMapper;
+	@Autowired
+	UserRoleMapper	userRoleMapper;
 	
 	@Value(value = "${mobileRemindCodeTemplate}")
 	private String					mobileRemindCodeTemplate	= null;
@@ -1977,10 +1981,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			MobileNotice( targetIds, tOrder);
 			noticeMapper.insertBatch(noticeList);
 			//触发短信提醒
-		List<String> l= contractTaskMapper.slectbyOrderNo(tOrder.getOrderNo());
-				for (String s : l) {
-					if(!targetIds.contains(s))
-				targetIds.add(s);
+			List<UserRole> list=userRoleMapper. selectAdminRole(AFTConstants.CONSULTANT_MANAGER);
+				for (UserRole u : list) {
+					targetIds.add(u.getUid());
 				}
 				String regex = "^(1[1-9][0-9])\\d{8}$";
 				 Pattern p = Pattern.compile(regex);

+ 5 - 0
src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
 
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.dao.ContractTaskLogMapper;
+import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.RoleMapper;
 import com.goafanti.common.dao.RolePermissionMapper;
 import com.goafanti.common.dao.RoleResourcesMapper;
@@ -51,6 +52,8 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 	ContractTaskLogMapper	contractTaskLogMapper;
 	@Autowired
 	UserBusinessMapper		userBusinessMapper;
+	@Autowired
+	OrganizationContactBookMapper	organizationContactBookMapper;
 	@Override
 	public Pagination<RoleBo> findRoles(RoleBo role, Integer pageNo, Integer pageSize) {
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -183,6 +186,8 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 			if (s==roleResources.YXKH.getCode()) {
 				roleResourcesMapper.updateLockRelease("0",aid,transferId);//将用户锁转给指定人
 				userBusinessMapper.updateDimissionTransfer(aid,transferId);
+				organizationContactBookMapper.updateDimissionTransfer(aid,transferId);
+				userMapper.updateDimissionTransfer(aid,transferId);
 			}
 			if (s==roleResources.QDYW.getCode()) {
 				roleResourcesMapper.updateLockRelease("1",aid,transferId);//将业务锁转给指定人