feat(inventory): 新增库存备货状态展示功能

- 在库存列表中增加“是否曾经备货”字段展示
- 根据onceInStock字段值显示不同颜色标识
- 后端实体类OmsStockInfo新增onceInStock属性
- 数据库映射文件添加once_in_stock字段插入逻辑
- 新增插入时校验历史备货状态逻辑
- 修改项目订单服务依赖注入接口方式
- 调整用户头像上传接口路径及默认图片格式
- 更新前端用户头像路径拼接逻辑以支持资源下载
dev_1.0.0
chenhao 2025-12-03 09:56:56 +08:00
parent bb79ce79bd
commit 357010e7ee
9 changed files with 21 additions and 5 deletions

View File

@ -106,7 +106,7 @@ export function updateUserPwd(oldPassword, newPassword) {
// 用户头像上传 // 用户头像上传
export function uploadAvatar(data) { export function uploadAvatar(data) {
return request({ return request({
url: '/system/user/profile/avatar', url: '/system/user/profile/updateAvatar',
method: 'post', method: 'post',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
data: data data: data

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -2,7 +2,7 @@ import router from '@/router'
import { MessageBox, } from 'element-ui' import { MessageBox, } from 'element-ui'
import { login, logout, getInfo } from '@/api/login' import { login, logout, getInfo } from '@/api/login'
import { isHttp, isEmpty } from "@/utils/validate" import { isHttp, isEmpty } from "@/utils/validate"
import defAva from '@/assets/images/profile.jpg' import defAva from '@/assets/images/profile.png'
const user = { const user = {
state: { state: {
@ -66,7 +66,7 @@ const user = {
// 后端返回的数据在 res.data 中 // 后端返回的数据在 res.data 中
const data = res.data || res const data = res.data || res
const user = data.user const user = data.user
let avatar = user.avatar || "" let avatar = user.avatar? '/common/download/resource?resource='+encodeURIComponent(user.avatar) : ""
if (!isHttp(avatar)) { if (!isHttp(avatar)) {
avatar = (isEmpty(avatar)) ? defAva : process.env.VUE_APP_BASE_API + avatar avatar = (isEmpty(avatar)) ? defAva : process.env.VUE_APP_BASE_API + avatar
} }

View File

@ -73,6 +73,11 @@
<span>{{ scope.row.stockStatus === '0' ? '待备货' : '已备货' }}</span> <span>{{ scope.row.stockStatus === '0' ? '待备货' : '已备货' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否曾经备货" align="center" prop="stockStatus" width="100">
<template slot-scope="scope">
<span :style="{'color': scope.row.onceInStock==='1' ? 'red' : ''}">{{ (scope.row.onceInStock||'0') === '0' ? '未备货' : '曾经备货' }}</span>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="allQuantity" width="100" /> <el-table-column label="数量" align="center" prop="allQuantity" width="100" />
<el-table-column label="备货地址" align="center" prop="notifierAddress" width="300" show-overflow-tooltip /> <el-table-column label="备货地址" align="center" prop="notifierAddress" width="300" show-overflow-tooltip />
<el-table-column label="联系人" align="center" prop="notifier" width="100" /> <el-table-column label="联系人" align="center" prop="notifier" width="100" />

View File

@ -23,6 +23,7 @@ public class OmsStockInfo {
* 0: 1: * 0: 1:
*/ */
private String stockStatus; private String stockStatus;
private String onceInStock;
/** /**
* *
*/ */

View File

@ -40,6 +40,10 @@ public class OmsStockInfoServiceImpl implements IOmsStockInfoService {
@Override @Override
public int insert(OmsStockInfo omsStockInfo) { public int insert(OmsStockInfo omsStockInfo) {
//需要验证数据
List<OmsStockInfo> omsStockInfos = omsStockInfoMapper.queryAll(omsStockInfo);
boolean b = omsStockInfos.stream().anyMatch(item -> "1".equalsIgnoreCase(item.getStockStatus()));
omsStockInfo.setOnceInStock(b ? "1" : "0");
return omsStockInfoMapper.insert(omsStockInfo); return omsStockInfoMapper.insert(omsStockInfo);
} }

View File

@ -124,7 +124,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
private static final List<String> REJECT_EMAIL_LIST = Arrays.asList("li.junjie@unisinsight.com", "chen.shenggang@unisinsight.com"); private static final List<String> REJECT_EMAIL_LIST = Arrays.asList("li.junjie@unisinsight.com", "chen.shenggang@unisinsight.com");
@Autowired @Autowired
private OmsStockInfoMapper omsStockInfoMapper; private IOmsStockInfoService omsStockInfoService;
@Autowired @Autowired
private IProjectTaxRateTempService projectTaxRateTempService; private IProjectTaxRateTempService projectTaxRateTempService;
@Value("${unis.order.endHour:96}") @Value("${unis.order.endHour:96}")
@ -1218,7 +1218,7 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
private void addStock(String businessKey) { private void addStock(String businessKey) {
OmsStockInfo omsStockInfo = new OmsStockInfo(); OmsStockInfo omsStockInfo = new OmsStockInfo();
omsStockInfo.setOrderCode(businessKey); omsStockInfo.setOrderCode(businessKey);
omsStockInfoMapper.insert(omsStockInfo); omsStockInfoService.insert(omsStockInfo);
} }
// @Override // @Override

View File

@ -98,6 +98,9 @@
<if test="stockStatus != null and stockStatus != ''"> <if test="stockStatus != null and stockStatus != ''">
stock_status, stock_status,
</if> </if>
<if test="onceInStock != null and onceInStock != ''">
once_in_stock,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
@ -109,6 +112,9 @@
<if test="stockStatus != null and stockStatus != ''"> <if test="stockStatus != null and stockStatus != ''">
#{stockStatus}, #{stockStatus},
</if> </if>
<if test="onceInStock != null and onceInStock != ''">
#{onceInStock},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime}, #{createTime},
</if> </if>