59 changed files with 104 additions and 617 deletions
@ -1,7 +1,6 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.AccesstoAddress; |
import com.dreamchaser.depository_manage.entity.AccesstoAddress; |
||||
import com.fasterxml.jackson.annotation.JsonProperty; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
import org.springframework.stereotype.Repository; |
import org.springframework.stereotype.Repository; |
||||
|
|
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.BusinessType; |
import com.dreamchaser.depository_manage.entity.BusinessType; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
@ -1,6 +1,6 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.dreamchaser.depository_manage.mapper.BusinessTypeMapper"> |
<mapper namespace="com.dreamchaser.depository_manage.depository_mapper.BusinessTypeMapper"> |
||||
<resultMap id="BusinessTypeMap" type="com.dreamchaser.depository_manage.entity.BusinessType"> |
<resultMap id="BusinessTypeMap" type="com.dreamchaser.depository_manage.entity.BusinessType"> |
||||
<id property="id" column="id" jdbcType="BIGINT"/> |
<id property="id" column="id" jdbcType="BIGINT"/> |
||||
<result property="typeName" column="typeName" jdbcType="VARCHAR"/> |
<result property="typeName" column="typeName" jdbcType="VARCHAR"/> |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.CallBackLog; |
import com.dreamchaser.depository_manage.entity.CallBackLog; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.Company; |
import com.dreamchaser.depository_manage.entity.Company; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.ConstructionUnit; |
import com.dreamchaser.depository_manage.entity.ConstructionUnit; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
@ -1,7 +1,7 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
<mapper namespace="com.dreamchaser.depository_manage.mapper.ConstructionUnitMapper"> |
<mapper namespace="com.dreamchaser.depository_manage.depository_mapper.ConstructionUnitMapper"> |
||||
<resultMap id="constructionUnitMap" type="com.dreamchaser.depository_manage.entity.ConstructionUnit"> |
<resultMap id="constructionUnitMap" type="com.dreamchaser.depository_manage.entity.ConstructionUnit"> |
||||
<id column="id" property="id" jdbcType="INTEGER" /> |
<id column="id" property="id" jdbcType="INTEGER" /> |
||||
<result column="name" property="name" jdbcType="VARCHAR" /> |
<result column="name" property="name" jdbcType="VARCHAR" /> |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.Depository; |
import com.dreamchaser.depository_manage.entity.Depository; |
||||
import com.dreamchaser.depository_manage.pojo.InventoryByDname; |
import com.dreamchaser.depository_manage.pojo.InventoryByDname; |
||||
@ -1,9 +1,8 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.*; |
import com.dreamchaser.depository_manage.entity.*; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
import org.springframework.stereotype.Repository; |
import org.springframework.stereotype.Repository; |
||||
import org.springframework.transaction.annotation.Transactional; |
|
||||
|
|
||||
import java.util.List; |
import java.util.List; |
||||
import java.util.Map; |
import java.util.Map; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.Group; |
import com.dreamchaser.depository_manage.entity.Group; |
||||
import com.dreamchaser.depository_manage.entity.GroupInfo; |
import com.dreamchaser.depository_manage.entity.GroupInfo; |
||||
@ -1,6 +1,6 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.dreamchaser.depository_manage.mapper.GroupMapper"> |
<mapper namespace="com.dreamchaser.depository_manage.depository_mapper.GroupMapper"> |
||||
|
|
||||
<!-- 字段映射 (用于视图)--> |
<!-- 字段映射 (用于视图)--> |
||||
<resultMap id="groupInfoMap" type="com.dreamchaser.depository_manage.entity.GroupInfo"> |
<resultMap id="groupInfoMap" type="com.dreamchaser.depository_manage.entity.GroupInfo"> |
||||
@ -1,7 +1,6 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.*; |
import com.dreamchaser.depository_manage.entity.*; |
||||
import com.dreamchaser.depository_manage.pojo.InventoryP; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
import org.springframework.stereotype.Repository; |
import org.springframework.stereotype.Repository; |
||||
|
|
||||
@ -1,6 +1,5 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.Material; |
|
||||
import com.dreamchaser.depository_manage.entity.MaterialType; |
import com.dreamchaser.depository_manage.entity.MaterialType; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
import org.springframework.stereotype.Repository; |
import org.springframework.stereotype.Repository; |
||||
@ -1,10 +1,7 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.Notice; |
import com.dreamchaser.depository_manage.entity.Notice; |
||||
import com.dreamchaser.depository_manage.entity.UserByPort; |
|
||||
import com.dreamchaser.depository_manage.pojo.NoticeP; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
import org.aspectj.weaver.ast.Not; |
|
||||
import org.springframework.stereotype.Repository; |
import org.springframework.stereotype.Repository; |
||||
|
|
||||
import java.util.List; |
import java.util.List; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.MaterialAndPlace; |
import com.dreamchaser.depository_manage.entity.MaterialAndPlace; |
||||
import com.dreamchaser.depository_manage.entity.Place; |
import com.dreamchaser.depository_manage.entity.Place; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.PidOrDidAndCode; |
import com.dreamchaser.depository_manage.entity.PidOrDidAndCode; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
@ -1,6 +1,5 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.Role; |
|
||||
import com.dreamchaser.depository_manage.pojo.RoleAndDepository; |
import com.dreamchaser.depository_manage.pojo.RoleAndDepository; |
||||
import com.dreamchaser.depository_manage.pojo.RoleAndMaterialType; |
import com.dreamchaser.depository_manage.pojo.RoleAndMaterialType; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.SplitInfo; |
import com.dreamchaser.depository_manage.entity.SplitInfo; |
||||
import com.dreamchaser.depository_manage.entity.SplitInventory; |
import com.dreamchaser.depository_manage.entity.SplitInventory; |
||||
@ -1,9 +1,8 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.StockTaking; |
import com.dreamchaser.depository_manage.entity.StockTaking; |
||||
import com.dreamchaser.depository_manage.entity.StockTakingChild; |
import com.dreamchaser.depository_manage.entity.StockTakingChild; |
||||
import com.dreamchaser.depository_manage.pojo.StockTakingChildP; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
import org.springframework.stereotype.Repository; |
import org.springframework.stereotype.Repository; |
||||
|
|
||||
@ -1,4 +1,4 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.TransferRecord; |
import com.dreamchaser.depository_manage.entity.TransferRecord; |
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
@ -1,7 +1,6 @@ |
|||||
package com.dreamchaser.depository_manage.mapper; |
package com.dreamchaser.depository_manage.depository_mapper; |
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.User; |
import com.dreamchaser.depository_manage.entity.User; |
||||
import com.dreamchaser.depository_manage.pojo.SimpleUser; |
|
||||
import org.apache.ibatis.annotations.Mapper; |
import org.apache.ibatis.annotations.Mapper; |
||||
import org.springframework.stereotype.Repository; |
import org.springframework.stereotype.Repository; |
||||
|
|
||||
@ -1,143 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
||||
|
|
||||
<!-- standing_book --> |
|
||||
<mapper namespace="mysql.standingBook"> |
|
||||
<!-- This code was generated by TableGo tools, mark 1 begin. --> |
|
||||
<!-- 字段映射 --> |
|
||||
<resultMap id="standingBookMap" type="StandingBook"> |
|
||||
<id column="id" property="id" jdbcType="INTEGER" /> |
|
||||
<result column="type" property="type" jdbcType="INTEGER" /> |
|
||||
<result column="quantity" property="quantity" jdbcType="INTEGER" /> |
|
||||
<result column="price" property="price" jdbcType="INTEGER" /> |
|
||||
<result column="material_name" property="materialName" jdbcType="VARCHAR" /> |
|
||||
</resultMap> |
|
||||
<!-- This code was generated by TableGo tools, mark 1 end. --> |
|
||||
|
|
||||
<!-- This code was generated by TableGo tools, mark 2 begin. --> |
|
||||
<!-- 表查询字段 --> |
|
||||
<sql id="allColumns"> |
|
||||
sb.id, sb.type, sb.quantity, sb.price, sb.material_name |
|
||||
</sql> |
|
||||
<!-- This code was generated by TableGo tools, mark 2 end. --> |
|
||||
|
|
||||
<!-- 查询所有数据 --> |
|
||||
<select id="findStandingBookAll" resultMap="standingBookMap"> |
|
||||
SELECT |
|
||||
<include refid="allColumns" /> |
|
||||
FROM standing_book sb |
|
||||
</select> |
|
||||
|
|
||||
<!-- 根据条件参数查询数据列表 --> |
|
||||
<select id="findStandingBookByCondition" resultMap="standingBookMap" parameterType="map"> |
|
||||
SELECT |
|
||||
<include refid="allColumns" /> |
|
||||
FROM standing_book sb WHERE 1 = 1 |
|
||||
<if test="type != null"> |
|
||||
AND sb.type = #{type} |
|
||||
</if> |
|
||||
<if test="quantity != null"> |
|
||||
AND sb.quantity = #{quantity} |
|
||||
</if> |
|
||||
<if test="price != null"> |
|
||||
AND sb.price = #{price} |
|
||||
</if> |
|
||||
<if test="materialName != null and materialName != ''"> |
|
||||
AND sb.material_name LIKE CONCAT('%', #{materialName}, '%') |
|
||||
</if> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 根据主键查询数据 --> |
|
||||
<select id="findStandingBookByIds" resultMap="standingBookMap" parameterType="list"> |
|
||||
SELECT |
|
||||
<include refid="allColumns" /> |
|
||||
FROM standing_book sb WHERE sb.id IN |
|
||||
<foreach collection="list" index="index" item="id" open="(" separator="," close=")"> |
|
||||
#{id} |
|
||||
</foreach> |
|
||||
</select> |
|
||||
|
|
||||
<!-- 插入数据 --> |
|
||||
<insert id="insertStandingBook" parameterType="map"> |
|
||||
INSERT INTO standing_book ( |
|
||||
id, type, quantity, price, material_name |
|
||||
) VALUES ( |
|
||||
#{id}, |
|
||||
#{type}, |
|
||||
#{quantity}, |
|
||||
#{price}, |
|
||||
#{materialName} |
|
||||
) |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 批量插入数据 --> |
|
||||
<insert id="insertStandingBooks" parameterType="list"> |
|
||||
INSERT INTO standing_book ( |
|
||||
id, type, quantity, price, material_name |
|
||||
) VALUES |
|
||||
<foreach collection="list" index="index" item="item" separator=","> |
|
||||
( |
|
||||
#{item.id}, |
|
||||
#{item.type}, |
|
||||
#{item.quantity}, |
|
||||
#{item.price}, |
|
||||
#{item.materialName} |
|
||||
) |
|
||||
</foreach> |
|
||||
</insert> |
|
||||
|
|
||||
<!-- 修改数据 --> |
|
||||
<update id="updateStandingBook" parameterType="map"> |
|
||||
UPDATE standing_book |
|
||||
<set> |
|
||||
<if test="type != null"> |
|
||||
type = #{type}, |
|
||||
</if> |
|
||||
<if test="quantity != null"> |
|
||||
quantity = #{quantity}, |
|
||||
</if> |
|
||||
<if test="price != null"> |
|
||||
price = #{price}, |
|
||||
</if> |
|
||||
<if test="materialName != null"> |
|
||||
material_name = #{materialName} |
|
||||
</if> |
|
||||
</set> |
|
||||
WHERE id = #{id} |
|
||||
</update> |
|
||||
|
|
||||
<!-- 批量修改数据 --> |
|
||||
<update id="updateStandingBooks" parameterType="list"> |
|
||||
<foreach collection="list" index="index" item="item" separator=";"> |
|
||||
UPDATE standing_book |
|
||||
<set> |
|
||||
<if test="item.type != null"> |
|
||||
type = #{item.type}, |
|
||||
</if> |
|
||||
<if test="item.quantity != null"> |
|
||||
quantity = #{item.quantity}, |
|
||||
</if> |
|
||||
<if test="item.price != null"> |
|
||||
price = #{item.price}, |
|
||||
</if> |
|
||||
<if test="item.materialName != null"> |
|
||||
material_name = #{item.materialName} |
|
||||
</if> |
|
||||
</set> |
|
||||
WHERE id = #{item.id} |
|
||||
</foreach> |
|
||||
</update> |
|
||||
|
|
||||
<!-- 根据主键删除数据 --> |
|
||||
<delete id="deleteStandingBookById" parameterType="int"> |
|
||||
DELETE FROM standing_book WHERE id = #{id} |
|
||||
</delete> |
|
||||
|
|
||||
<!-- 根据主键批量删除数据 --> |
|
||||
<delete id="deleteStandingBookByIds" parameterType="list"> |
|
||||
DELETE FROM standing_book WHERE id IN |
|
||||
<foreach collection="list" index="index" item="id" open="(" separator="," close=")"> |
|
||||
#{id} |
|
||||
</foreach> |
|
||||
</delete> |
|
||||
</mapper> |
|
||||
@ -1,174 +0,0 @@ |
|||||
package com.dreamchaser.depository_manage.service.impl; |
|
||||
|
|
||||
import com.dreamchaser.depository_manage.entity.Role; |
|
||||
import com.dreamchaser.depository_manage.entity.User; |
|
||||
import com.dreamchaser.depository_manage.mapper.DepositoryMapper; |
|
||||
import com.dreamchaser.depository_manage.mapper.UserMapper; |
|
||||
import com.dreamchaser.depository_manage.pojo.UserP; |
|
||||
import com.dreamchaser.depository_manage.service.UserService; |
|
||||
import com.dreamchaser.depository_manage.utils.ObjectFormatUtil; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.data.redis.core.RedisTemplate; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
import org.thymeleaf.expression.Ids; |
|
||||
|
|
||||
import java.util.ArrayList; |
|
||||
import java.util.HashMap; |
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
@Service |
|
||||
public class UserServiceImpl implements UserService { |
|
||||
static final Map<String,Object> REVIVER_MAP=new HashMap<>(1); |
|
||||
static { |
|
||||
REVIVER_MAP.put("authority","3"); |
|
||||
} |
|
||||
@Autowired |
|
||||
UserMapper userMapper; |
|
||||
@Autowired |
|
||||
DepositoryMapper depositoryMapper; |
|
||||
|
|
||||
@Override |
|
||||
public Integer findCount() { |
|
||||
return userMapper.findCount(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Integer findCountByCondition(Map<String, Object> map) { |
|
||||
return userMapper.findCountByCondition(map); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public UserP findUserPById(Integer id) { |
|
||||
return singlePack(userMapper.findUserById(id)); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public User findUserById(String id) { |
|
||||
return userMapper.findUserById(ObjectFormatUtil.toInteger(id)); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public User findUserByCondition(Map<String, Object> map) { |
|
||||
return userMapper.findUserByCondition(map); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 根据条件查询符合条件的用户集合 |
|
||||
* @param map 参数map |
|
||||
* @return 符合条件的用户集合 |
|
||||
*/ |
|
||||
@Override |
|
||||
public List<UserP> findUserPsByCondition(Map<String, Object> map) { |
|
||||
Integer size = 8,page=1; |
|
||||
if (map.containsKey("size")){ |
|
||||
size= ObjectFormatUtil.toInteger(map.get("size")); |
|
||||
map.put("size", size); |
|
||||
} |
|
||||
if (map.containsKey("page")){ |
|
||||
page=ObjectFormatUtil.toInteger(map.get("page")); |
|
||||
map.put("begin",(page-1)*size); |
|
||||
} |
|
||||
List<User> list=userMapper.findUsersByCondition(map); |
|
||||
return pack(list); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<User> findReviewers() { |
|
||||
return userMapper.findUsersByCondition(REVIVER_MAP); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<User> findUsersByDepositoryId(Integer depositoryId) { |
|
||||
Map<String,Object> map=new HashMap<>(1); |
|
||||
map.put("depositoryId",depositoryId); |
|
||||
return userMapper.findUsersByCondition(map); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Integer insertUser(Map<String, Object> map) { |
|
||||
return userMapper.insertUser(map); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Integer updateUser(Map<String, Object> map) { |
|
||||
return userMapper.updateUser(map); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Integer updateUserNoSensitive(Map<String, Object> map) { |
|
||||
return userMapper.updateUserNoSensitive(map); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Integer deleteUserById(Integer id) { |
|
||||
return userMapper.deleteUserById(id); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Integer deleteUserByIds(List<Integer> ids) { |
|
||||
return userMapper.deleteUserByIds(ids); |
|
||||
} |
|
||||
|
|
||||
private List<UserP> pack(List<User> list){ |
|
||||
List<UserP> result=new ArrayList<>(list.size()); |
|
||||
for (User u:list){ |
|
||||
result.add(singlePack(u)); |
|
||||
} |
|
||||
return result; |
|
||||
} |
|
||||
@Override |
|
||||
public UserP singlePack(User user){ |
|
||||
UserP userP=new UserP(user); |
|
||||
if (user.getDepositoryId()==-1){ |
|
||||
userP.setDepositoryName("全部仓库"); |
|
||||
}else { |
|
||||
userP.setDepositoryName(depositoryMapper.findDepositoryNameById(user.getDepositoryId())); |
|
||||
} |
|
||||
return userP; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 根据id将用户状态改为删除 |
|
||||
* @param id |
|
||||
* @return 受影响的行数 |
|
||||
*/ |
|
||||
@Override |
|
||||
public Integer changeUserStateToDeleteById(Integer id) { |
|
||||
return userMapper.changeUserStateToDeleteById(id); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 根据id批量将用户状态改为删除 |
|
||||
* @param ids |
|
||||
* @return 受影响的行数 |
|
||||
*/ |
|
||||
@Override |
|
||||
public Integer changeUserStateToDeleteByIds(List<Integer> ids) { |
|
||||
return userMapper.changeUserStateToDeleteByIds(ids); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 根据id进行密码修改 |
|
||||
* @return 受影响行数 |
|
||||
*/ |
|
||||
@Override |
|
||||
public Integer updateUserPasswordById(Map<String,Object> map) { |
|
||||
return userMapper.updateUserPasswordById(map); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* 根据用户id查询具体仓库名称 |
|
||||
* @param id |
|
||||
* @return |
|
||||
*/ |
|
||||
@Override |
|
||||
public String FindDepositoryByUserId(Integer id) { |
|
||||
return userMapper.FindDepositoryByUserId(id); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
Loading…
Reference in new issue