jz.kai hace 3 años
padre
commit
12ebd03a52

+ 5 - 2
common/src/main/java/com/jpsoft/excellent/modules/common/utils/SMSUtil.java

@@ -4,6 +4,7 @@ import com.jpsoft.excellent.modules.base.entity.Person;
 import com.jpsoft.excellent.modules.base.service.PersonService;
 import com.jpsoft.excellent.modules.common.dto.MessageResult;
 import com.jpsoft.excellent.modules.sys.entity.User;
+import com.jpsoft.excellent.modules.sys.service.UserService;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.params.HttpMethodParams;
@@ -16,6 +17,8 @@ import java.util.*;
 public class SMSUtil {
 	@Autowired
 	private static PersonService personService;
+	@Autowired
+	private static UserService userService;
 
 	private final static String SpCode = "216290";
 	private final static String LoginName = "jz_zg";
@@ -43,8 +46,8 @@ public class SMSUtil {
 		if(StringUtils.isNotEmpty(specialClassIds)) {
 			String[] specialClassIdArray = specialClassIds.split(",");
 			for(String specialClassId : specialClassIdArray){
-				List<Person> personList = personService.findListBySpecialClassId(specialClassId);
-				for(Person person : personList){
+				List<User> userList = userService.findListBySpecialClassId(specialClassId);
+				for(User user : userList){
 //					sendSMS(MessageContent, person.getPhone(), templateId, SerialNumber, ScheduleTime);
 				}
 			}

+ 1 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/dao/UserDAO.java

@@ -19,4 +19,5 @@ public interface UserDAO {
 	List<User> search(Map<String,Object> searchParams,List<Sort> sortList);
 	User findByUserName(@Param("userName") String userName);
     long hasRole(@Param("userId") String userId,@Param("roleName") String roleName);
+	List<User> findListBySpecialClassId(String specialClassId);
 }

+ 1 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/User.java

@@ -34,4 +34,5 @@ public class User {
 	private String orgId;
 	private String orgName;
 	private String phone;
+	private String specialClassId;
 }

+ 1 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/UserService.java

@@ -16,4 +16,5 @@ public interface UserService {
 	Page<User> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,List<Sort> sortList);
 	User findByUserName(String userName);
 	boolean hasRole(String userId, String roleName) ;
+	List<User> findListBySpecialClassId(String specialClassId);
 }

+ 6 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/service/impl/UserServiceImpl.java

@@ -78,4 +78,10 @@ public class UserServiceImpl implements UserService {
 
 		return count>0;
 	}
+
+	@Override
+	public List<User> findListBySpecialClassId(String specialClassId) {
+		// TODO Auto-generated method stub
+		return userDAO.findListBySpecialClassId(specialClassId);
+	}
 }

+ 11 - 1
common/src/main/resources/mapper/sys/User.xml

@@ -15,6 +15,7 @@
         <result property="updateBy" column="update_by"/>
         <result property="orgId" column="org_id"/>
         <result property="phone" column="phone_"/>
+        <result property="specialClassId" column="special_class_id"/>
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.excellent.modules.sys.entity.User">
         <!--
@@ -25,7 +26,7 @@
         <![CDATA[
 		insert into sys_user
 	    (id_,user_name,password_,real_name,create_time,update_time,
-	    del_flag,create_by,update_by,org_id,phone_)
+	    del_flag,create_by,update_by,org_id,phone_,special_class_id)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -39,6 +40,7 @@
             ,#{updateBy,jdbcType=VARCHAR}
             ,#{orgId,jdbcType=VARCHAR}
             ,#{phone,jdbcType=VARCHAR}
+            ,#{specialClassId,jdbcType=VARCHAR}
 		)
 	]]>
     </insert>
@@ -78,6 +80,9 @@
             <if test="phone!=null">
                 phone_=#{phone,jdbcType=VARCHAR},
             </if>
+            <if test="specialClassId!=null">
+                special_class_id=#{specialClassId,jdbcType=VARCHAR},
+            </if>
         </set>
         where id_=#{id}
     </update>
@@ -120,4 +125,9 @@
         where ur.role_id = r.id_
         and ur.user_id = #{userId} and r.name_=#{roleName}
     </select>
+    <select id="findListBySpecialClassId" parameterType="string" resultMap="UserMap">
+        select * from sys_user
+        where del_flag = 0
+        and special_class_id = #{0}
+    </select>
 </mapper>