dcs hai 1 ano
pai
achega
59a5521230

+ 11 - 21
virgo.core/src/main/java/com/bosshand/virgo/core/dao/MgrUserDao.java

@@ -1,45 +1,35 @@
 package com.bosshand.virgo.core.dao;
 
-import org.apache.ibatis.annotations.Mapper;
-
 import com.bosshand.virgo.core.model.MgrUser;
+import org.apache.ibatis.annotations.Mapper;
 
 import java.util.List;
-import java.util.Map;
 
 @Mapper
 public interface MgrUserDao {
-	
+
 	public MgrUser getById(long id);
 
 	public MgrUser getByPhone(String phone);
-	
-	public int update(MgrUser user);
-	
-	public int updateLastOrganizationId(MgrUser user);
-
-	public int updateLastProjectId(MgrUser user);
 
 	public MgrUser getUserByPhone(String Phone);
 
-	public int insert(MgrUser user);
-
-	public int updatePhone(MgrUser user);
+	public List<MgrUser> getIds(List<Long> ids);
 
-	public int banUser(long id, int status);
+	public int insert(MgrUser user);
 
 	public int delete(long id);
 
-	public int checkFace(long id);
+	public int updateLastOrganizationId(MgrUser user);
 
-	public List<MgrUser> getList(Map<String, Object> map);
+	public int updateLastProjectId(MgrUser user);
 
-	public int getTotalCount(Map<String, Object> map);
+	public int update(MgrUser user);
 
-	public List<MgrUser> getIds(List<Long> ids);
+	public int updatePhone(MgrUser user);
 
-	public List<MgrUser> getUserByOrganizationId(long organizationId);
+	public int banUser(long id, int status);
+
+	public int checkFace(long id);
 
-	public List<MgrUser> getUserByOrganizationIds(List<Long> organizationIds);
-	
 }

+ 34 - 71
virgo.core/src/main/resources/mapper/MgrUserMapper.xml

@@ -29,6 +29,35 @@
 	 select * from mgr_user where phone = #{phone} limit 1
 </select>
 
+<select id="getUserByPhone" resultType="com.bosshand.virgo.core.model.MgrUser">
+	SELECT * FROM mgr_user where phone=#{phone}
+</select>
+
+<select id="getIds" parameterType="list" resultType="com.bosshand.virgo.core.model.MgrUser">
+	select * from mgr_user
+	<trim>
+		<if test="list.size > 0">
+			where id in (
+			<foreach collection="list" item="item" index="index" separator=",">
+				#{item}
+			</foreach>
+			)
+		</if>
+		<if test="list.size = 0">
+			where 1=0
+		</if>
+	</trim>
+</select>
+
+<insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrUser" useGeneratedKeys="true" keyProperty="id">
+	INSERT into mgr_user(name, sex, phone, email, portrait, create_time, rsonal_signature, id_card, practice_certificate, practice_seal, lastOrganizationId)
+	values(#{name}, #{sex}, #{phone}, #{email}, #{portrait}, #{createTime}, #{rsonalSignature}, #{idCard}, #{practiceCertificate}, #{practiceSeal}, #{lastOrganizationId})
+</insert>
+
+<delete id="delete">
+	DELETE from mgr_user where id = #{id}
+</delete>
+
 <update id="updateLastOrganizationId" parameterType="com.bosshand.virgo.core.model.MgrUser">
 	UPDATE mgr_user set lastOrganizationId = #{lastOrganizationId} WHERE id=#{id}
 </update>
@@ -58,76 +87,6 @@
 		WHERE id=#{id}
 </update>
 
-<select id="getIds" parameterType="list" resultType="com.bosshand.virgo.core.model.MgrUser">
-	select * from mgr_user
-	<trim>
-		<if test="list.size > 0">
-			where id in (
-			<foreach collection="list" item="item" index="index" separator=",">
-				#{item}
-			</foreach>
-			)
-		</if>
-		<if test="list.size = 0">
-			where 1=0
-		</if>
-	</trim>
-</select>
-
-<select id="getUserByPhone" resultType="com.bosshand.virgo.core.model.MgrUser">
-	SELECT * FROM mgr_user where phone=#{phone}
-</select>
-
-<select id="getUserByOrganizationId" resultType="com.bosshand.virgo.core.model.MgrUser">
-	SELECT * FROM mgr_user where organization_id=#{organizationId}
-</select>
-
-<select id="getUserByOrganizationIds" parameterType="list" resultType="com.bosshand.virgo.core.model.MgrUser">
-	select id, role_id from mgr_user where organization_id in (
-	<trim>
-		<if test="list.size > 0">
-			<foreach collection="list" item="item" index="index" separator=",">
-				#{item}
-			</foreach>
-		</if>
-	</trim>
-	)
-</select>
-
-<select id="getList" parameterType="map" resultMap="MgrUserResult">
-	SELECT id, login_name, portrait, name, sex, phone, email, create_time,organization_id, project_id, department_id, role_id, resource, comment, face, faceStatus FROM mgr_user
-	WHERE organization_id = #{organizationId}
-	<trim>
-		<if test="name != null and name !=''">and name = #{name}</if>
-		<if test="phone != null and phone !=''">and phone = #{phone}</if>
-		<if test="sex != null and sex !=''">and sex = #{sex}</if>
-	</trim>
-	limit #{currIndex} , #{pageSize}
-</select>
-
-<select id="getTotalCount" parameterType="map" resultType="Integer">
-	SELECT count(*) FROM mgr_user
-	WHERE organization_id = #{organizationId}
-	<trim>
-		<if test="name != null and name !=''">and name = #{name}</if>
-		<if test="phone != null and phone !=''">and phone = #{phone}</if>
-		<if test="sex != null and sex !=''">and sex = #{sex}</if>
-	</trim>
-</select>
-
-<insert id="insert" parameterType="com.bosshand.virgo.core.model.MgrUser" useGeneratedKeys="true" keyProperty="id">
-	INSERT into mgr_user(name, sex, phone, email, portrait, create_time, rsonal_signature, id_card, practice_certificate, practice_seal, lastOrganizationId)
-	values(#{name}, #{sex}, #{phone}, #{email}, #{portrait}, #{createTime}, #{rsonalSignature}, #{idCard}, #{practiceCertificate}, #{practiceSeal}, #{lastOrganizationId})
-</insert>
-
-<delete id="delete">
-	DELETE from mgr_user where id = #{id}
-</delete>
-
-<update id="checkFace" parameterType="com.bosshand.virgo.core.model.MgrUser">
-	UPDATE mgr_user SET faceStatus = 1 where id =#{id}
-</update>
-
 <update id="updatePhone" parameterType="com.bosshand.virgo.core.model.MgrUser">
 	UPDATE mgr_user SET phone = #{phone} where id =#{id}
 </update>
@@ -135,5 +94,9 @@
 <update id="banUser" parameterType="com.bosshand.virgo.core.model.MgrUser">
 	UPDATE mgr_user set status = #{status} WHERE id=#{id}
 </update>
-			
+
+<update id="checkFace" parameterType="com.bosshand.virgo.core.model.MgrUser">
+	UPDATE mgr_user SET faceStatus = 1 where id =#{id}
+</update>
+
 </mapper>

+ 0 - 16
virgo.manager/src/main/java/com/bosshand/virgo/controller/AdminController.java

@@ -1,6 +1,5 @@
 package com.bosshand.virgo.controller;
 
-import com.alibaba.fastjson.JSONObject;
 import com.bosshand.virgo.core.model.MgrUser;
 import com.bosshand.virgo.core.model.MgrUserRole;
 import com.bosshand.virgo.core.response.Response;
@@ -9,10 +8,6 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 @RestController
 @RequestMapping("admin")
 public class AdminController {
@@ -20,17 +15,6 @@ public class AdminController {
 	@Autowired
 	UserService userService;
 
-	@ApiOperation(value="用户列表", notes="用户列表")
-	@RequestMapping(value = "/list", method = RequestMethod.POST)
-	public Response getUserList(@RequestBody JSONObject parameter) {
-		List<MgrUser> list = userService.getList(parameter);
-		int totalCount = userService.getTotalCount(parameter);
-		Map<String, Object> result = new HashMap<String, Object>();
-		result.put("dataList", list);
-		result.put("totalCount", totalCount);
-		return Response.ok(result);
-	}
-	
 	@ApiOperation(value="用户新增", notes="用户新增")
 	@RequestMapping(value = "/insertUser/{organizationId}/{roles}", method = RequestMethod.POST)
 	public Response insertUser(@RequestBody MgrUser user, @PathVariable long organizationId, @PathVariable String roles) {

+ 0 - 37
virgo.manager/src/main/java/com/bosshand/virgo/service/UserService.java

@@ -1,6 +1,5 @@
 package com.bosshand.virgo.service;
 
-import com.alibaba.fastjson.JSONObject;
 import com.bosshand.virgo.core.dao.AttendanceDao;
 import com.bosshand.virgo.core.dao.MgrOrganizationDao;
 import com.bosshand.virgo.core.dao.MgrUserDao;
@@ -12,9 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 @Service
 public class UserService {
@@ -73,40 +70,6 @@ public class UserService {
 		return mgrUserDao.getIds(ids);
 	}
 
-	public List<MgrUser> getList(JSONObject parameter) {
-		Map<String, Object> data = new HashMap<String, Object>();
-		int currPage = parameter.getIntValue("currPage");
-		int pageSize = parameter.getIntValue("pageSize");
-		data.put("organizationId", parameter.getString("organizationId"));
-		data.put("currIndex", (currPage - 1) * pageSize);
-		data.put("pageSize", pageSize);
-		if (parameter.containsKey("name")) {
-			data.put("name", parameter.getString("name"));
-		}
-		if (parameter.containsKey("phone")) {
-			data.put("phone", parameter.getString("phone"));
-		}
-		if (parameter.containsKey("sex")) {
-			data.put("sex", parameter.getString("sex"));
-		}
-		return mgrUserDao.getList(data);
-	}
-
-	public int getTotalCount(JSONObject parameter) {
-		Map<String, Object> data = new HashMap<String, Object>();
-		data.put("organizationId", parameter.getString("organizationId"));
-		if (parameter.containsKey("name")) {
-			data.put("name", parameter.getString("name"));
-		}
-		if (parameter.containsKey("phone")) {
-			data.put("phone", parameter.getString("phone"));
-		}
-		if (parameter.containsKey("sex")) {
-			data.put("sex", parameter.getString("sex"));
-		}
-		return mgrUserDao.getTotalCount(data);
-	}
-
 	public void insertUserRole(long userId, long organizationId, String roles) {
 		MgrUserRole mur = mgrUserRoleDao.getUser(userId, organizationId);
 		if (mur != null) {