Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
3a09e4eb
由
康伟
编写于
2025-01-10 17:57:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
kangwei: 药剂入库审核,补充departId参数
1 个父辈
7bfd3a2e
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
13 行删除
sk-module-biz/src/main/java/com/skua/modules/erp/service/impl/MaterialINServiceImpl.java
sk-module-biz/src/main/java/com/skua/modules/erp/service/impl/MaterialINServiceImpl.java
查看文件 @
3a09e4e
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.skua.core.context.BaseContextHandler
;
import
com.skua.core.context.SpringContextUtils
;
import
com.skua.core.util.ConvertUtils
;
import
com.skua.modules.common.service.ICommonSqlService
;
import
com.skua.modules.equipment.dto.EquipmentInDTO
;
import
com.skua.modules.equipment.dto.EquipmentOutDTO
;
...
...
@@ -74,20 +75,24 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
public
String
auditMaterialINVO
(
MaterialINVO
materialINVO
)
throws
Exception
{
boolean
inAndOutStock
=
false
;
String
errMsg
=
null
;
QueryWrapper
<
SuppliesWarehouse
>
queryWrapper
=
new
QueryWrapper
<
SuppliesWarehouse
>();
queryWrapper
.
eq
(
"depart_id"
,
materialINVO
.
getDepartId
());
warehouseService
.
list
();
//保存
MaterialIN
materialINTemp
=
this
.
baseMapper
.
selectById
(
materialINVO
.
getId
());
/* QueryWrapper<SuppliesWarehouse> queryWrapper = new QueryWrapper<SuppliesWarehouse>();
queryWrapper.eq("depart_id",materialINVO.getDepartId());*/
String
inWarehouseId
=
null
;
//主库数据源
JdbcTemplate
masterDB
=
(
JdbcTemplate
)
SpringContextUtils
.
getBean
(
"master"
);
String
warehouseSql
=
"select id from supplies_warehouse where depart_id = '"
+
materialINVO
.
getDepartId
()+
"' order by create_time desc limit 1"
;
String
inWarehouseId
=
masterDB
.
queryForObject
(
warehouseSql
,
String
.
class
);
if
(
materialINTemp
!=
null
&&
StringUtils
.
isNotEmpty
(
materialINTemp
.
getDepartId
())){
String
warehouseSql
=
"select id from supplies_warehouse where depart_id = '"
+
materialINTemp
.
getDepartId
()+
"' order by create_time desc limit 1"
;
inWarehouseId
=
masterDB
.
queryForObject
(
warehouseSql
,
String
.
class
);
}
if
(
StringUtils
.
isEmpty
(
inWarehouseId
)){
String
departSql
=
"select depart_name from sys_depart where id = '"
+
materialIN
VO
.
getDepartId
()+
"'"
;
String
departName
=
masterDB
.
queryForObject
(
warehouse
Sql
,
String
.
class
);
return
"所属厂站["
+
departName
+
"]下没有找到仓库信息!"
;
String
departSql
=
"select depart_name from sys_depart where id = '"
+
materialIN
Temp
.
getDepartId
()+
"'"
;
String
departName
=
masterDB
.
queryForObject
(
depart
Sql
,
String
.
class
);
return
"所属厂站["
+
ConvertUtils
.
getString
(
departName
)
+
"]下没有找到仓库信息!"
;
}
//保存
MaterialIN
materialINTemp
=
this
.
baseMapper
.
selectById
(
materialINVO
.
getId
());
//purchasePlan.getApproveState() 审批状态 1通过2不通过
if
(
"1"
.
equals
(
materialINVO
.
getApproveState
()
)){
materialINTemp
.
setAuditStatus
(
"3"
);
...
...
@@ -96,8 +101,6 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
if
(
"2"
.
equals
(
materialINVO
.
getApproveState
()
)){
materialINTemp
.
setAuditStatus
(
"2"
);
}
// 审核通过,生成入库单据、物料单
if
(
inAndOutStock
){
//出库
...
...
@@ -106,7 +109,6 @@ public class MaterialINServiceImpl extends ServiceImpl<MaterialINMapper, Materia
errMsg
=
syncEquipmentIn
(
materialINTemp
,
inWarehouseId
);
}
this
.
baseMapper
.
updateById
(
materialINTemp
)
;
//审批记录
ApproveRecord
record
=
new
ApproveRecord
(
"YJIN"
,
materialINVO
.
getApplyUser
(),
materialINVO
.
getId
(),
BaseContextHandler
.
getUserId
(),
materialINVO
.
getApproveMessage
(),
materialINVO
.
getApproveState
());
recordMapper
.
insert
(
record
)
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论