Browse Source

Merge branch 'develop' into release

tags/v1.2.0^2
wanghaoran 1 year ago
parent
commit
32d61ead95
8 changed files with 66 additions and 10 deletions
  1. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Camera.java
  2. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Goods.java
  3. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warehouse.java
  4. +10
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/camera/CameraServiceImpl.java
  5. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/goods/GoodsServiceImpl.java
  6. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/WarehouseServiceImpl.java
  7. +20
    -5
      tuoheng-admin/src/main/resources/mapper/GoodsMapper.xml
  8. +20
    -5
      tuoheng-admin/src/main/resources/mapper/WarehouseMapper.xml

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

package com.tuoheng.admin.entity.domain; package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity; import com.tuoheng.common.common.BaseEntity;
import lombok.Data; import lombok.Data;
* 备注 * 备注
*/ */
private String remark; private String remark;
@TableField(exist = false)
private String updateUserName;
} }

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

package com.tuoheng.admin.entity.domain; package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity; import com.tuoheng.common.common.BaseEntity;
import lombok.Data; import lombok.Data;
*/ */
private String goodsAction; private String goodsAction;
@TableField(exist = false)
private String updateUserName;
} }

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

package com.tuoheng.admin.entity.domain; package com.tuoheng.admin.entity.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.tuoheng.common.common.BaseEntity; import com.tuoheng.common.common.BaseEntity;
import lombok.Data; import lombok.Data;
*/ */
private String location; private String location;
@TableField(exist = false)
private String updateUserName;
} }

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

import com.tuoheng.common.utils.JsonResult; import com.tuoheng.common.utils.JsonResult;
import com.tuoheng.common.utils.StringUtils; import com.tuoheng.common.utils.StringUtils;
import com.tuoheng.system.entity.User; import com.tuoheng.system.entity.User;
import com.tuoheng.system.mapper.UserMapper;
import com.tuoheng.system.utils.ShiroUtils; import com.tuoheng.system.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Autowired @Autowired
private CameraMapper cameraMapper; private CameraMapper cameraMapper;
@Autowired
private UserMapper userMapper;
/** /**
* 查询摄像头列表 * 查询摄像头列表
* *
} }
Integer tenantId = ShiroUtils.getTenantId(); Integer tenantId = ShiroUtils.getTenantId();
entity.setTenantId(tenantId); entity.setTenantId(tenantId);
entity.setCreateUser(ShiroUtils.getUserId());
} }
if(StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())){ if(StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())){
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude()); String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude());
entity.setLocation(gaodeAddress); entity.setLocation(gaodeAddress);
} }
entity.setUpdateUser(ShiroUtils.getUserId());
super.edit(entity); super.edit(entity);
return JsonResult.success(); return JsonResult.success();
.eq(Camera::getMark, MarkTypeEnum.VALID.getCode()) .eq(Camera::getMark, MarkTypeEnum.VALID.getCode())
.like(StringUtils.isNotEmpty(request.getCameraName()), Camera::getCameraName, request.getCameraName()) .like(StringUtils.isNotEmpty(request.getCameraName()), Camera::getCameraName, request.getCameraName())
.orderByDesc(Camera::getCreateTime)); .orderByDesc(Camera::getCreateTime));
for (Camera record : pageData.getRecords()) {
User user = userMapper.selectById(record.getUpdateUser());
record.setUpdateUserName(user.getRealname());
}
return JsonResult.success(pageData); return JsonResult.success(pageData);
} }

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

} }
Integer tenantId = ShiroUtils.getTenantId(); Integer tenantId = ShiroUtils.getTenantId();
entity.setTenantId(tenantId); entity.setTenantId(tenantId);
entity.setCreateUser(ShiroUtils.getUserId());
} }
entity.setUpdateUser(ShiroUtils.getUserId());
super.edit(entity); super.edit(entity);
return JsonResult.success(); return JsonResult.success();
} }

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

} }
Integer tenantId = ShiroUtils.getTenantId(); Integer tenantId = ShiroUtils.getTenantId();
entity.setTenantId(tenantId); entity.setTenantId(tenantId);
entity.setCreateUser(ShiroUtils.getUserId());
} }
if (StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())) { if (StringUtils.isNotEmpty(entity.getLongitude()) && StringUtils.isNotEmpty(entity.getLatitude())) {
String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude()); String gaodeAddress = GaodeUtil.getGaodeAddress(entity.getLongitude(), entity.getLatitude());
entity.setLocation(gaodeAddress); entity.setLocation(gaodeAddress);
} }
entity.setUpdateUser(ShiroUtils.getUserId());
super.edit(entity); super.edit(entity);
return JsonResult.success(); return JsonResult.success();
} }

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

</sql> </sql>
<select id="getListByWarehouseId" parameterType="com.tuoheng.admin.entity.request.goods.QueryGoodsListByWarehouseIdRequest" resultMap="GoodsResult"> <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> <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> </where>
order by create_time desc
order by g.create_time desc
</select> </select>
<select id="getOneById" parameterType="Integer" resultMap="GoodsResult"> <select id="getOneById" parameterType="Integer" resultMap="GoodsResult">

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

</sql> </sql>
<select id="selectPageList" parameterType="com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest" resultMap="WarehouseResult"> <select id="selectPageList" parameterType="com.tuoheng.admin.entity.request.warehouse.QueryWarehousePageListRequest" resultMap="WarehouseResult">
<include refid="selectWarehouseVo"/>
SELECT
w.id,
w.tenant_id,
w.warehouse_name,
w.longitude,
w.latitude,
w.location,
w.create_user,
w.create_time,
w.update_user,
w.update_time,
w.mark,
u.realname AS updateUserName
FROM
th_warehouse w
LEFT JOIN sys_user u ON w.update_user = u.id
<where> <where>
<if test="1 == 1"> and mark = 1 </if>
<if test="request.tenantId != null and request.tenantId != 0"> and tenant_id = #{request.tenantId}</if>
<if test="1 == 1"> and w.mark = 1 </if>
<if test="request.tenantId != null and request.tenantId != 0"> and w.tenant_id = #{request.tenantId}</if>
<if test="request.warehouseName != null and request.warehouseName != ''"> <if test="request.warehouseName != null and request.warehouseName != ''">
and warehouse_name like concat('%',#{request.warehouseName},'%')
and w.warehouse_name like concat('%',#{request.warehouseName},'%')
</if> </if>
</where> </where>
order by create_time desc
order by w.create_time desc
</select> </select>
<select id="getOneById" parameterType="Integer" resultMap="WarehouseResult"> <select id="getOneById" parameterType="Integer" resultMap="WarehouseResult">

Loading…
Cancel
Save