Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
raid-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴春元
raid-app
Commits
7815d8c6
Commit
7815d8c6
authored
Jan 20, 2026
by
吴春元
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加结束盘点
parent
f310fae4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
55 deletions
+122
-55
WmsInventory.java
.../main/java/com/sxyz/rfid/greendao/model/WmsInventory.java
+0
-0
WmsInventoryTask.java
...n/java/com/sxyz/rfid/greendao/model/WmsInventoryTask.java
+46
-0
ReviewOfflineActivity.java
...om/sxyz/rfid/ui/review/offline/ReviewOfflineActivity.java
+44
-4
ReviewOfflineTaskActivity.java
...xyz/rfid/ui/review/offline/ReviewOfflineTaskActivity.java
+31
-49
ReviewOfflineDetailAdapter.java
...ui/review/offline/adapter/ReviewOfflineDetailAdapter.java
+1
-2
No files found.
app/src/main/java/com/sxyz/rfid/greendao/model/WmsInventory.java
View file @
7815d8c6
app/src/main/java/com/sxyz/rfid/greendao/model/WmsInventoryTask.java
View file @
7815d8c6
...
...
@@ -67,6 +67,7 @@ public class WmsInventoryTask implements Serializable {
private
String
updateTime
;
@Property
(
nameInDb
=
"remark"
)
private
String
remark
;
@Generated
(
hash
=
1984916082
)
public
WmsInventoryTask
(
Long
taskId
,
Integer
planId
,
String
taskNo
,
String
taskName
,
Integer
warehouseId
,
String
warehouseName
,
...
...
@@ -98,138 +99,183 @@ public class WmsInventoryTask implements Serializable {
this
.
updateTime
=
updateTime
;
this
.
remark
=
remark
;
}
@Generated
(
hash
=
950900997
)
public
WmsInventoryTask
()
{
}
public
Long
getTaskId
()
{
return
this
.
taskId
;
}
public
void
setTaskId
(
Long
taskId
)
{
this
.
taskId
=
taskId
;
}
public
Integer
getPlanId
()
{
return
this
.
planId
;
}
public
void
setPlanId
(
Integer
planId
)
{
this
.
planId
=
planId
;
}
public
String
getTaskNo
()
{
return
this
.
taskNo
;
}
public
void
setTaskNo
(
String
taskNo
)
{
this
.
taskNo
=
taskNo
;
}
public
String
getTaskName
()
{
return
this
.
taskName
;
}
public
void
setTaskName
(
String
taskName
)
{
this
.
taskName
=
taskName
;
}
public
Integer
getWarehouseId
()
{
return
this
.
warehouseId
;
}
public
void
setWarehouseId
(
Integer
warehouseId
)
{
this
.
warehouseId
=
warehouseId
;
}
public
String
getWarehouseName
()
{
return
this
.
warehouseName
;
}
public
void
setWarehouseName
(
String
warehouseName
)
{
this
.
warehouseName
=
warehouseName
;
}
public
String
getAreaIds
()
{
return
this
.
areaIds
;
}
public
void
setAreaIds
(
String
areaIds
)
{
this
.
areaIds
=
areaIds
;
}
public
String
getAreaName
()
{
return
this
.
areaName
;
}
public
void
setAreaName
(
String
areaName
)
{
this
.
areaName
=
areaName
;
}
public
String
getMaterialIds
()
{
return
this
.
materialIds
;
}
public
void
setMaterialIds
(
String
materialIds
)
{
this
.
materialIds
=
materialIds
;
}
public
String
getLocationRange
()
{
return
this
.
locationRange
;
}
public
void
setLocationRange
(
String
locationRange
)
{
this
.
locationRange
=
locationRange
;
}
public
Integer
getAssigneeId
()
{
return
this
.
assigneeId
;
}
public
void
setAssigneeId
(
Integer
assigneeId
)
{
this
.
assigneeId
=
assigneeId
;
}
public
String
getAssistantIds
()
{
return
this
.
assistantIds
;
}
public
void
setAssistantIds
(
String
assistantIds
)
{
this
.
assistantIds
=
assistantIds
;
}
public
String
getTaskStatus
()
{
return
this
.
taskStatus
;
}
public
void
setTaskStatus
(
String
taskStatus
)
{
this
.
taskStatus
=
taskStatus
;
}
public
String
getStartTime
()
{
return
this
.
startTime
;
}
public
void
setStartTime
(
String
startTime
)
{
this
.
startTime
=
startTime
;
}
public
String
getEndTime
()
{
return
this
.
endTime
;
}
public
void
setEndTime
(
String
endTime
)
{
this
.
endTime
=
endTime
;
}
public
Integer
getTotalItems
()
{
return
this
.
totalItems
;
}
public
void
setTotalItems
(
Integer
totalItems
)
{
this
.
totalItems
=
totalItems
;
}
public
Integer
getCountedItems
()
{
return
this
.
countedItems
;
}
public
void
setCountedItems
(
Integer
countedItems
)
{
this
.
countedItems
=
countedItems
;
}
public
String
getInventoryDevice
()
{
return
this
.
inventoryDevice
;
}
public
void
setInventoryDevice
(
String
inventoryDevice
)
{
this
.
inventoryDevice
=
inventoryDevice
;
}
public
String
getDelFlag
()
{
return
this
.
delFlag
;
}
public
void
setDelFlag
(
String
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
public
String
getCreateTime
()
{
return
this
.
createTime
;
}
public
void
setCreateTime
(
String
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateTime
()
{
return
this
.
updateTime
;
}
public
void
setUpdateTime
(
String
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
String
getRemark
()
{
return
this
.
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
...
...
app/src/main/java/com/sxyz/rfid/ui/review/offline/ReviewOfflineActivity.java
View file @
7815d8c6
...
...
@@ -9,6 +9,7 @@ import android.text.TextWatcher;
import
android.view.View
;
import
android.view.inputmethod.EditorInfo
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
com.sxyz.rfid.R
;
...
...
@@ -16,14 +17,17 @@ import com.sxyz.rfid.base.BaseActivity;
import
com.sxyz.rfid.databinding.ActivityReviewOfflineBinding
;
import
com.sxyz.rfid.greendao.GreenDaoManager
;
import
com.sxyz.rfid.greendao.model.WmsInventoryTask
;
import
com.sxyz.rfid.greendao.model.WmsInventoryTaskDetail
;
import
com.sxyz.rfid.ui.review.offline.adapter.ReviewOfflineAdapter
;
import
com.sxyz.rfid.utils.StringUtil
;
import
com.sxyz.rfid.utils.ToastUtil
;
import
java.util.ArrayList
;
import
java.util.List
;
import
sql.com.yz.db.DaoSession
;
import
sql.com.yz.db.WmsInventoryTaskDao
;
import
sql.com.yz.db.WmsInventoryTaskDetailDao
;
/**
* 主要功能: 离线执行盘点列表
...
...
@@ -120,12 +124,48 @@ public class ReviewOfflineActivity extends BaseActivity<ActivityReviewOfflineBin
startActivity
(
ReviewOfflineTaskActivity
.
class
,
bundle
);
}
// 处理结束盘点点击事件
// 处理结束盘点点击事件
TODO
@Override
public
void
onStopTaskClick
(
int
position
,
WmsInventoryTask
item
)
{
// new AlertDialog.Builder(mActivity).setTitle("提示").setMessage("确定结束该盘点任务吗?").setPositiveButton("确定", (dialog, which) -> {
// mPresenter.doStopReviewTask(ReviewFragment.this, item.getTaskId());
// }).setNegativeButton("取消", null).show();
if
(
daoSession
!=
null
)
{
//根据item.getTaskId()查询任务明细信息列表===========================================================================
List
<
WmsInventoryTaskDetail
>
mList
=
daoSession
.
getWmsInventoryTaskDetailDao
().
queryBuilder
().
where
(
WmsInventoryTaskDetailDao
.
Properties
.
TaskId
.
eq
(
item
.
getTaskId
())).
list
();
if
(
mList
!=
null
&&
mList
.
size
()
>
0
)
{
int
count
=
0
;
for
(
int
i
=
0
;
i
<
mList
.
size
();
i
++)
{
//结束盘点:如果明细内有 待盘点0 的出库单,属于盘亏
if
(
mList
.
get
(
i
).
getCheckStatus
().
equals
(
"0"
))
{
//计算有几个待盘点,就是盘亏数量
count
++;
//盘亏数量+1
}
}
if
(
count
>
0
)
{
//盘亏数量大于0,提示盘亏数量
new
AlertDialog
.
Builder
(
mActivity
).
setTitle
(
"提示"
).
setMessage
(
"该盘点任务存在"
+
count
+
"个盘亏,是否继续结束?"
).
setPositiveButton
(
"确定"
,
(
dialog
,
which
)
->
{
int
count1
=
0
;
for
(
int
i
=
0
;
i
<
mList
.
size
();
i
++)
{
//结束盘点:如果明细内有 待盘点0 的出库单,属于盘亏
if
(
mList
.
get
(
i
).
getCheckStatus
().
equals
(
"0"
))
{
//计算有几个待盘点,就是盘亏数量
count1
++;
//盘亏数量+1
mList
.
get
(
i
).
setDiffReason
(
"pk"
);
//盘亏
}
//更新数据库
daoSession
.
getWmsInventoryTaskDetailDao
().
update
(
mList
.
get
(
i
));
}
}).
setNegativeButton
(
"取消"
,
null
).
show
();
}
else
{
new
AlertDialog
.
Builder
(
mActivity
).
setTitle
(
"提示"
).
setMessage
(
"确定结束该盘点任务吗?"
).
setPositiveButton
(
"确定"
,
(
dialog
,
which
)
->
{
//盘亏数量等于0,直接结束,正常结束
WmsInventoryTask
wmsInventoryTask
=
daoSession
.
getWmsInventoryTaskDao
().
load
(
item
.
getTaskId
());
wmsInventoryTask
.
setTaskStatus
(
"2"
);
//设置为已结束
daoSession
.
getWmsInventoryTaskDao
().
update
(
wmsInventoryTask
);
}).
setNegativeButton
(
"取消"
,
null
).
show
();
}
}
else
{
ToastUtil
.
showShort
(
"暂无盘点明细数据,请先添加盘点明细数据"
);
}
}
}
});
}
...
...
app/src/main/java/com/sxyz/rfid/ui/review/offline/ReviewOfflineTaskActivity.java
View file @
7815d8c6
...
...
@@ -33,6 +33,7 @@ import com.sxyz.rfid.ui.review.offline.adapter.ReviewOfflineDetailAdapter;
import
com.sxyz.rfid.utils.L
;
import
com.sxyz.rfid.utils.StringUtil
;
import
com.sxyz.rfid.utils.ToastUtil
;
import
com.sxyz.rfid.widgets.AlertDialogUtil
;
import
com.sxyz.rfid.widgets.OEMSymbologyId
;
import
com.ubx.usdk.RFIDSDKManager
;
import
com.ubx.usdk.rfid.aidl.IRfidCallback
;
...
...
@@ -368,22 +369,29 @@ public class ReviewOfflineTaskActivity extends BaseActivity<ActivityOfflineRevie
WmsInventoryResultDao
wmsInventoryResultDao
=
daoSession
.
getWmsInventoryResultDao
();
WmsInventoryResult
wmsInventoryResult
=
wmsInventoryResultDao
.
queryBuilder
().
where
(
WmsInventoryResultDao
.
Properties
.
TaskId
.
eq
(
item
.
getTaskId
())).
unique
();
if
(
wmsInventoryResult
!=
null
)
{
//
更新已盘数量+1
//
盘存结果中的盘存数量+1,更新盘存结果
wmsInventoryResult
.
setCountedItems
(
wmsInventoryResult
.
getCountedItems
()
+
1
);
//更新盘存结果
wmsInventoryResultDao
.
update
(
wmsInventoryResult
);
L
.
i
(
"result:"
+
new
Gson
().
toJson
(
wmsInventoryResult
));
//将WmsInventoryTask的盘点数+1
//将任务列表WmsInventoryTask的盘点数+1
WmsInventoryTaskDao
wmsInventoryTaskDao
=
daoSession
.
getWmsInventoryTaskDao
();
WmsInventoryTask
wmsInventoryTask
=
wmsInventoryTaskDao
.
queryBuilder
().
where
(
WmsInventoryTaskDao
.
Properties
.
TaskId
.
eq
(
item
.
getTaskId
())).
unique
();
if
(
wmsInventoryTask
!=
null
)
{
wmsInventoryTask
.
setCountedItems
(
wmsInventoryTask
.
getCountedItems
()
+
1
);
//判断是否完成所有盘存任务
//判断是否完成所有盘存任务
,已盘数等于总盘点数,任务状态设置为2 已完成
if
(
wmsInventoryTask
.
getTotalItems
()
==
wmsInventoryTask
.
getCountedItems
())
{
wmsInventoryTask
.
setTaskStatus
(
"2"
);
//任务状态设置为2 已完成
}
//更新任务结果
wmsInventoryTaskDao
.
update
(
wmsInventoryTask
);
}
//判断是否全部盘点完成 :已盘数等于总盘点数,任务状态为2 已完成
if
(
wmsInventoryResult
.
getTotalItems
()
==
wmsInventoryResult
.
getCountedItems
()
||
wmsInventoryTask
.
getTaskStatus
().
equals
(
"2"
))
{
new
AlertDialogUtil
(
this
).
builder
().
setTitle
(
"提示"
).
setMsg
(
"盘点已全部完成"
).
setNegativeButton
(
"我知道了"
,
v
->
{
closeMenu
();
}).
show
();
}
}
//刷新页面数据
initData
();
...
...
@@ -400,40 +408,40 @@ public class ReviewOfflineTaskActivity extends BaseActivity<ActivityOfflineRevie
}
if
(
wmsInventory
!=
null
)
{
L
.
i
(
"rfidTag查询获取库存数据:"
+
new
Gson
().
toJson
(
wmsInventory
));
//盘盈:在明细表中增加一条数据
//盘盈:在明细表中增加一条
盘盈
数据
WmsInventoryTaskDetail
wmsInventoryTaskDetail
=
new
WmsInventoryTaskDetail
();
wmsInventoryTaskDetail
.
setInventoryId
(
wmsInventory
.
getInventoryId
().
intValue
());
wmsInventoryTaskDetail
.
setTaskId
(
item
.
getTaskId
().
intValue
());
wmsInventoryTaskDetail
.
setMaterialId
(
wmsInventory
.
getMaterialId
());
wmsInventoryTaskDetail
.
setWarehouseId
(
wmsInventory
.
getWarehouseId
());
wmsInventoryTaskDetail
.
setInventoryId
(
wmsInventory
.
getInventoryId
().
intValue
());
//盘盈库存id
wmsInventoryTaskDetail
.
setTaskId
(
item
.
getTaskId
().
intValue
());
//盘盈任务id
wmsInventoryTaskDetail
.
setMaterialId
(
wmsInventory
.
getMaterialId
());
//盘盈物料id
wmsInventoryTaskDetail
.
setWarehouseId
(
wmsInventory
.
getWarehouseId
());
//盘盈仓库id
//根据wmsInventory.getWarehouseId()查询仓库表WmsWarehouse数据
WmsWarehouseDao
wmsWarehouseDao
=
daoSession
.
getWmsWarehouseDao
();
WmsWarehouse
wmsWarehouse
=
wmsWarehouseDao
.
queryBuilder
().
where
(
WmsWarehouseDao
.
Properties
.
WarehouseId
.
eq
(
wmsInventory
.
getWarehouseId
())).
unique
();
if
(
wmsWarehouse
!=
null
)
{
L
.
i
(
"根据仓库id查询仓库数据:"
+
new
Gson
().
toJson
(
wmsWarehouse
));
wmsInventoryTaskDetail
.
setWarehouseName
(
wmsWarehouse
.
getWarehouseName
());
wmsInventoryTaskDetail
.
setWarehouseName
(
wmsWarehouse
.
getWarehouseName
());
//盘盈仓库名称
}
wmsInventoryTaskDetail
.
setAreaId
(
wmsInventory
.
getAreaId
());
wmsInventoryTaskDetail
.
setAreaId
(
wmsInventory
.
getAreaId
());
//盘盈库区id
//根据wmsInventory.getAreaId()查询库区表WmsArea数据
WmsAreaDao
wmsAreaDao
=
daoSession
.
getWmsAreaDao
();
WmsArea
wmsArea
=
wmsAreaDao
.
queryBuilder
().
where
(
WmsAreaDao
.
Properties
.
AreaId
.
eq
(
wmsInventory
.
getAreaId
())).
unique
();
if
(
wmsArea
!=
null
)
{
L
.
i
(
"根据库区id查询库区数据:"
+
new
Gson
().
toJson
(
wmsArea
));
wmsInventoryTaskDetail
.
setAreaName
(
wmsArea
.
getAreaName
());
wmsInventoryTaskDetail
.
setAreaName
(
wmsArea
.
getAreaName
());
//盘盈库区名称
}
wmsInventoryTaskDetail
.
setLocationId
(
wmsInventory
.
getLocationId
());
wmsInventoryTaskDetail
.
setLocationId
(
wmsInventory
.
getLocationId
());
//盘盈库位id
WmsLocationDao
wmsLocationDao
=
daoSession
.
getWmsLocationDao
();
WmsLocation
wmsLocation
=
wmsLocationDao
.
queryBuilder
().
where
(
WmsLocationDao
.
Properties
.
LocationId
.
eq
(
wmsInventory
.
getLocationId
())).
unique
();
if
(
wmsLocation
!=
null
)
{
L
.
i
(
"根据库位id查询库位数据:"
+
new
Gson
().
toJson
(
wmsLocation
));
wmsInventoryTaskDetail
.
setLocationName
(
wmsLocation
.
getLocationName
());
wmsInventoryTaskDetail
.
setLocationName
(
wmsLocation
.
getLocationName
());
//盘盈库位名称
}
wmsInventoryTaskDetail
.
setBatchNo
(
wmsInventory
.
getBatchNo
());
wmsInventoryTaskDetail
.
setBatchNo
(
wmsInventory
.
getBatchNo
());
//盘盈批次号
// wmsInventoryTaskDetail.setSystemQty(wmsInventory.getSystemQty());//系统数量
// wmsInventoryTaskDetail.setActualQty(wmsInventory.getActualQty());//盘盈数量
// wmsInventoryTaskDetail.setDiffQty(wmsInventory.getDiffQty());//盘盈差异数量
// wmsInventoryTaskDetail.setCheckerId(item.getCheckerId()
);//盘盈检查人id
// wmsInventoryTaskDetail.setCheckerName(item.getCheckerName()
);//盘盈检查人姓名
wmsInventoryTaskDetail
.
setCheckerId
(
null
);
//盘盈检查人id
wmsInventoryTaskDetail
.
setCheckerName
(
"扫码枪离线盘点"
);
//盘盈检查人姓名
wmsInventoryTaskDetail
.
setRfidTag
(
rfidOrScanTag
);
//盘盈算已盘点
wmsInventoryTaskDetail
.
setCheckStatus
(
"1"
);
//盘点状态设置为已盘1
wmsInventoryTaskDetail
.
setDiffReason
(
"py"
);
//盘存差异原因 wcy=无差异;py=盘盈;pk=盘亏
...
...
@@ -468,6 +476,12 @@ public class ReviewOfflineTaskActivity extends BaseActivity<ActivityOfflineRevie
}
wmsInventoryTaskDao
.
update
(
wmsInventoryTask
);
}
//判断是否全部盘点完成 :已盘数等于总盘点数,任务状态为2 已完成
if
(
wmsInventoryResult
.
getTotalItems
()
==
wmsInventoryResult
.
getCountedItems
()
||
wmsInventoryTask
.
getTaskStatus
().
equals
(
"2"
))
{
new
AlertDialogUtil
(
this
).
builder
().
setTitle
(
"提示"
).
setMsg
(
"盘点已全部完成"
).
setNegativeButton
(
"我知道了"
,
v
->
{
closeMenu
();
}).
show
();
}
}
//刷新页面数据
initData
();
...
...
@@ -528,38 +542,6 @@ public class ReviewOfflineTaskActivity extends BaseActivity<ActivityOfflineRevie
};
// /**
// * 盘点结果
// *
// * @param model
// */
// @Override
// public void reviewResultSuccess(ReviewResultModel model) {
// if (model == null) {
// return;
// }
// if (model.getRows().isEmpty()) {
// return;
// }
// ReviewResultModel.RowsBean item = model.getRows().get(0);
// if (item == null) {
// return;
// }
// //总盘点数
// mBinding.tvTotalItems.setText(item.getTotalItems() + "");
// //已盘数
// mBinding.tvCountedItems.setText(item.getCountedItems() + "");
// //盘盈数
// mBinding.tvSurplusItems.setText(item.getSurplusItems() + "");
// //盘亏数
// mBinding.tvDeficitItems.setText(item.getDeficitItems() + "");
// //盘点进度 已盘数/总盘点数*100%
// int progress = (int) (item.getCountedItems() * 100.0 / item.getTotalItems());
// mBinding.tvProgress.setText(progress + "%");
// //进度条
// mBinding.progressBar.setProgress(progress);
// }
//
// /**
// * 执行盘点成功
// * 扫描任务
// */
...
...
app/src/main/java/com/sxyz/rfid/ui/review/offline/adapter/ReviewOfflineDetailAdapter.java
View file @
7815d8c6
...
...
@@ -55,7 +55,7 @@ public class ReviewOfflineDetailAdapter extends BaseQuickAdapter<WmsInventoryTas
//差异率
baseViewHolder
.
setText
(
R
.
id
.
tv_difference_rate
,
!
StringUtils
.
isEmpty
(
dataBean
.
getDiffQty
()
+
""
)
?
dataBean
.
getDiffQty
()
+
""
:
"-"
);
//备注
//
baseViewHolder.setText(R.id.tv_remark, !StringUtils.isEmpty(dataBean.getRemark()) ? dataBean.getRemark() : "-");
baseViewHolder
.
setText
(
R
.
id
.
tv_remark
,
!
StringUtils
.
isEmpty
(
dataBean
.
getRemark
())
?
dataBean
.
getRemark
()
:
"-"
);
//拣货状态
TextView
checkStatus
=
baseViewHolder
.
getView
(
R
.
id
.
tv_check_status
);
switch
(
dataBean
.
getCheckStatus
())
{
...
...
@@ -68,7 +68,6 @@ public class ReviewOfflineDetailAdapter extends BaseQuickAdapter<WmsInventoryTas
checkStatus
.
setText
(
"已盘点"
);
checkStatus
.
setBackground
(
ContextCompat
.
getDrawable
(
getContext
(),
R
.
drawable
.
status_green_bg
));
checkStatus
.
setTextColor
(
ContextCompat
.
getColor
(
getContext
(),
R
.
color
.
green
));
break
;
case
"2"
:
checkStatus
.
setText
(
"差异待确认"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment