Browse Source

修改物资、仓库、摄像头

编辑新增接口,增加创建人、修改人入库
tags/v1.2.0^2
wanghaoran 1 year ago
parent
commit
9c2c8d1d96
5 changed files with 30 additions and 5 deletions
  1. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Goods.java
  2. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/CameraServiceImpl.java
  3. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/GoodsServiceImpl.java
  4. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/WarehouseServiceImpl.java
  5. +20
    -5
      tuoheng-admin/src/main/resources/mapper/GoodsMapper.xml

+ 4
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Goods.java View File

@@ -1,5 +1,6 @@
package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity;
import lombok.Data;
@@ -53,4 +54,7 @@ public class Goods extends BaseEntity implements Serializable {
*/
private String goodsAction;
@TableField(exist = false)
private String updateUserName;
}

+ 2
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/CameraServiceImpl.java View File

@@ -79,11 +79,13 @@ public class CameraServiceImpl extends BaseServiceImpl<CameraMapper, Camera> imp
}
Integer tenantId = ShiroUtils.getTenantId();
entity.setTenantId(tenantId);
entity.setCreateUser(ShiroUtils.getUserId());
}
if(StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())){
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude());
entity.setLocation(gaodeAddress);
}
entity.setUpdateUser(ShiroUtils.getUserId());
super.edit(entity);
return JsonResult.success();

+ 2
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/GoodsServiceImpl.java View File

@@ -61,7 +61,9 @@ public class GoodsServiceImpl extends BaseServiceImpl<GoodsMapper, Goods> implem
}
Integer tenantId = ShiroUtils.getTenantId();
entity.setTenantId(tenantId);
entity.setCreateUser(ShiroUtils.getUserId());
}
entity.setUpdateUser(ShiroUtils.getUserId());
super.edit(entity);
return JsonResult.success();
}

+ 2
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/WarehouseServiceImpl.java View File

@@ -73,11 +73,13 @@ public class WarehouseServiceImpl extends BaseServiceImpl<WarehouseMapper, Wareh
}
Integer tenantId = ShiroUtils.getTenantId();
entity.setTenantId(tenantId);
entity.setCreateUser(ShiroUtils.getUserId());
}
if (StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())) {
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude());
entity.setLocation(gaodeAddress);
}
entity.setUpdateUser(ShiroUtils.getUserId());
super.edit(entity);
return JsonResult.success();
}

+ 20
- 5
tuoheng-admin/src/main/resources/mapper/GoodsMapper.xml View File

@@ -24,13 +24,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="getListByWarehouseId" parameterType="com.tuoheng.admin.entity.request.goods.QueryGoodsListByWarehouseIdRequest" resultMap="GoodsResult">
<include refid="selectGoodsVo"/>
select
g.id,
g.tenant_id,
g.warehouse_id,
g.goods_name,
g.goods_type,
g.goods_stock,
g.goods_action,
g.create_user,
g.create_time,
g.update_user,
g.update_time,
g.mark,
u.realname AS updateUserName
from th_goods g
LEFT JOIN sys_user u ON g.update_user = u.id
<where>
<if test="1 == 1"> and mark = 1 </if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
<if test="1 == 1"> and g.mark = 1 </if>
<if test="tenantId != null "> and g.tenant_id = #{tenantId}</if>
<if test="warehouseId != null "> and g.warehouse_id = #{warehouseId}</if>
</where>
order by create_time desc
order by g.create_time desc
</select>
<select id="getOneById" parameterType="Integer" resultMap="GoodsResult">

Loading…
Cancel
Save