@@ -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; | |||
} |
@@ -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(); | |||
@@ -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(); | |||
} |
@@ -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(); | |||
} |
@@ -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"> |