Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 7620bb1c
由
LN
编写于
2025-07-10 10:21:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加1588点料验证接口
1 个父辈
854e05a4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
82 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/core/solder/handler/SpBoxHandler.java
src/main/java/com/neotel/smfcore/core/solder/util/SolderBoxCache.java
src/main/java/com/neotel/smfcore/core/xRay/rest/XrayPrintDataController.java → src/main/java/com/neotel/smfcore/core/xRay/rest/XrayDeviceController.java
src/main/java/com/neotel/smfcore/custom/zhongcheSp1568/ZhongCheSPApi.java
src/main/java/com/neotel/smfcore/core/solder/handler/SpBoxHandler.java
查看文件 @
7620bb1
...
@@ -392,7 +392,8 @@ public class SpBoxHandler extends BaseDeviceHandler {
...
@@ -392,7 +392,8 @@ public class SpBoxHandler extends BaseDeviceHandler {
// statusBean.addData("plateH", task.getH()+"");
// statusBean.addData("plateH", task.getH()+"");
DataLog
rewarmPuttingTask
=
findAnotherTask
(
OP
.
REWARM_PUTTING
,
task
.
getBarcode
());
DataLog
rewarmPuttingTask
=
findAnotherTask
(
OP
.
REWARM_PUTTING
,
task
.
getBarcode
());
if
(
rewarmPuttingTask
==
null
)
{
if
(
rewarmPuttingTask
==
null
)
{
log
.
error
(
"["
+
cid
+
"]回温取料任务["
+
task
.
getBarcode
()
+
"]["
+
task
.
getPosName
()
+
"]未找到回温放料任务"
);
log
.
error
(
"["
+
cid
+
"]回温取料任务["
+
task
.
getBarcode
()
+
"]["
+
task
.
getPosName
()
+
"]未找到回温放料任务,先跳过此任务"
);
continue
;
}
else
{
}
else
{
statusBean
.
addRewarmTask
(
task
,
rewarmPuttingTask
);
statusBean
.
addRewarmTask
(
task
,
rewarmPuttingTask
);
// statusBean.addData("secondPosId", rewarmPuttingTask.getPosName());
// statusBean.addData("secondPosId", rewarmPuttingTask.getPosName());
...
...
src/main/java/com/neotel/smfcore/core/solder/util/SolderBoxCache.java
查看文件 @
7620bb1
...
@@ -304,6 +304,7 @@ public class SolderBoxCache {
...
@@ -304,6 +304,7 @@ public class SolderBoxCache {
puttingTask
.
setType
(
OP
.
REWARM_PUTTING
);
puttingTask
.
setType
(
OP
.
REWARM_PUTTING
);
//puttingTask = dataLogDao.save(puttingTask);
//puttingTask = dataLogDao.save(puttingTask);
taskService
.
addTaskToExecute
(
puttingTask
);
taskService
.
addTaskToExecute
(
puttingTask
);
log
.
info
(
barcode
.
getBarcode
()
+
"创建回温移库任务完成:["
+
storagePos
.
getPosName
()+
"]=>"
+
warmPos
.
getPosName
());
}
else
{
}
else
{
log
.
error
(
barcode
.
getBarcode
()
+
"创建回温移库任务失败:未找到回温库位"
);
log
.
error
(
barcode
.
getBarcode
()
+
"创建回温移库任务失败:未找到回温库位"
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/xRay/rest/Xray
PrintData
Controller.java
→
src/main/java/com/neotel/smfcore/core/xRay/rest/Xray
Device
Controller.java
查看文件 @
7620bb1
package
com
.
neotel
.
smfcore
.
core
.
xRay
.
rest
;
package
com
.
neotel
.
smfcore
.
core
.
xRay
.
rest
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.util.NumberUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.equipment.util.bean.EquipConfigInfo
;
import
com.neotel.smfcore.core.equipment.util.bean.EquipConfigInfo
;
...
@@ -12,17 +18,15 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess;
...
@@ -12,17 +18,15 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Map
;
import
java.util.Map
;
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"service/equipment/xRay"
)
@RequestMapping
(
"service/equipment/xRay"
)
public
class
Xray
PrintData
Controller
{
public
class
Xray
Device
Controller
{
@Autowired
@Autowired
private
IXrayPrintDataManager
xrayPrintDataManager
;
private
IXrayPrintDataManager
xrayPrintDataManager
;
...
@@ -30,8 +34,11 @@ public class XrayPrintDataController {
...
@@ -30,8 +34,11 @@ public class XrayPrintDataController {
@Autowired
@Autowired
private
CodeResolve
codeResolve
;
private
CodeResolve
codeResolve
;
@Autowired
private
IBarcodeManager
barcodeManager
;
@ApiOperation
(
"上传打印参数"
)
@ApiOperation
(
"
1584手动点料功能:
上传打印参数"
)
@PostMapping
(
"/uploadMResult"
)
@PostMapping
(
"/uploadMResult"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
uploadMResult
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
uploadMResult
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
...
@@ -58,9 +65,7 @@ public class XrayPrintDataController {
...
@@ -58,9 +65,7 @@ public class XrayPrintDataController {
}
}
@ApiOperation
(
"1584手动点料功能:获取打印参数"
)
@ApiOperation
(
"获取打印参数"
)
@PostMapping
(
"/getMResult"
)
@PostMapping
(
"/getMResult"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
getMResult
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
getMResult
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
...
@@ -87,4 +92,68 @@ public class XrayPrintDataController {
...
@@ -87,4 +92,68 @@ public class XrayPrintDataController {
}
}
@ApiOperation
(
"1588点料验证:是否需要点料,未入库条码不需要点料"
)
@PostMapping
(
"/isNeedCounting"
)
@AnonymousAccess
public
ResultBean
isNeedCounting
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
barcodeStr
=
paramMap
.
get
(
"barcodes"
);
log
.
info
(
"isNeedCounting: 条码:barcodes:"
+
barcodeStr
);
if
(
ObjectUtil
.
isEmpty
(
barcodeStr
))
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"barcodes"
});
}
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
barcodeStr
);
//已入库的条码需要点料
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"barcode"
,
barcodeStr
});
}
if
(
barcode
.
getPutInTime
()
<=
-
1
)
{
log
.
info
(
"isNeedCounting: 条码:"
+
barcode
.
getBarcode
()
+
"未入库过,不需要点料"
);
return
ResultBean
.
newErrorResult
(
1
,
""
,
"new barcode"
);
}
else
{
DateTime
putIntime
=
new
DateTime
(
barcode
.
getPutInTime
());
log
.
info
(
"isNeedCounting: 条码:"
+
barcode
.
getBarcode
()
+
"首次入库时间="
+
DateUtil
.
toDateString
(
putIntime
,
"yyyy-MM-dd HH:mm:ss"
)
+
",需要点料"
);
return
ResultBean
.
newOkResult
(
"true"
);
}
// return ResultBean.newErrorResult(-1, "", "not find data");
}
@ApiOperation
(
"1588点料:传点料数量到服务器"
)
@RequestMapping
(
value
=
"xrayUpdateAmount"
)
@AnonymousAccess
public
ResultBean
xrayUpdateAmount
(
@RequestBody
Map
<
String
,
String
>
paramMaps
)
{
String
amountStr
=
paramMaps
.
get
(
"amount"
);
String
barcodeStr
=
paramMaps
.
get
(
"barcode"
);
String
fullBarcode
=
paramMaps
.
get
(
"fullCode"
);
boolean
needResolve
=
false
;
String
offlineMode
=
paramMaps
.
get
(
"offlineMode"
);
if
(
ObjectUtil
.
isNotEmpty
(
offlineMode
)
&&
offlineMode
.
equalsIgnoreCase
(
"true"
))
{
needResolve
=
true
;
}
log
.
info
(
"xrayUpdateAmount: 点料信息:barcode:"
+
barcodeStr
+
",amount为:"
+
amountStr
+
",offlineMode="
+
offlineMode
);
if
(
StringUtils
.
isNotBlank
(
barcodeStr
))
{
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
barcodeStr
);
if
(
needResolve
&&
barcode
==
null
&&
ObjectUtil
.
isNotEmpty
(
fullBarcode
))
{
//解析条码
barcode
=
codeResolve
.
resolveOneValideBarcode
(
fullBarcode
);
}
if
(
barcode
!=
null
)
{
int
oldQty
=
barcode
.
getAmount
();
int
qty
=
NumberUtil
.
parseInt
(
amountStr
);
barcode
.
setAmount
(
qty
);
barcodeManager
.
save
(
barcode
);
log
.
info
(
"点料信息:barcode:"
+
barcodeStr
+
",旧数量:"
+
oldQty
+
",新数量="
+
qty
+
""
);
return
ResultBean
.
newOkResult
(
qty
);
}
}
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"barcode"
,
barcodeStr
});
}
}
}
src/main/java/com/neotel/smfcore/custom/zhongcheSp1568/ZhongCheSPApi.java
查看文件 @
7620bb1
...
@@ -327,7 +327,7 @@ public class ZhongCheSPApi extends BaseSmfApiListener {
...
@@ -327,7 +327,7 @@ public class ZhongCheSPApi extends BaseSmfApiListener {
// 搅拌结束: JB_END
// 搅拌结束: JB_END
if
(
rsType
==
null
)
{
if
(
rsType
==
null
)
{
log
.
warn
(
"TaskStatusChange: 未找到对应的操作类型,task类型: "
+
task
.
getType
());
//
log.warn("TaskStatusChange: 未找到对应的操作类型,task类型: " + task.getType());
return
false
;
return
false
;
}
}
return
SPStatusChange
(
url
,
rsType
,
barcode
,
task
.
getUpdateDate
());
return
SPStatusChange
(
url
,
rsType
,
barcode
,
task
.
getUpdateDate
());
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论