Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
erp-service
Project
Project
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
ximai
erp-service
Commits
881c701b
Commit
881c701b
authored
Jan 17, 2025
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入库调整
parent
e61289b0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
114 additions
and
9 deletions
+114
-9
MoctfController.java
...opsunit/scanservice/ximai/controller/MoctfController.java
+8
-4
MoctfDao.java
...ain/java/com/topsunit/scanservice/ximai/dao/MoctfDao.java
+3
-0
MoctcCreateDto.java
...va/com/topsunit/scanservice/ximai/dto/MoctcCreateDto.java
+4
-1
MoctfCreateParams2.java
...om/topsunit/scanservice/ximai/dto/MoctfCreateParams2.java
+33
-0
MoctfService.java
.../com/topsunit/scanservice/ximai/service/MoctfService.java
+52
-0
PurccService.java
.../com/topsunit/scanservice/ximai/service/PurccService.java
+1
-1
PurtgService.java
.../com/topsunit/scanservice/ximai/service/PurtgService.java
+9
-0
application-dev.yml
src/main/resources/application-dev.yml
+1
-1
application.yml
src/main/resources/application.yml
+1
-1
messages.properties
src/main/resources/i18n/messages.properties
+2
-1
No files found.
src/main/java/com/topsunit/scanservice/ximai/controller/MoctfController.java
View file @
881c701b
package
com
.
topsunit
.
scanservice
.
ximai
.
controller
;
package
com
.
topsunit
.
scanservice
.
ximai
.
controller
;
import
com.topsunit.scanservice.ximai.dto.MoctcCreateCriteria
;
import
com.topsunit.scanservice.ximai.dto.*
;
import
com.topsunit.scanservice.ximai.dto.MoctcCreateDto
;
import
com.topsunit.scanservice.ximai.dto.MoctcCreateParams
;
import
com.topsunit.scanservice.ximai.dto.MoctfCreateParams
;
import
com.topsunit.scanservice.ximai.service.MoctcService
;
import
com.topsunit.scanservice.ximai.service.MoctcService
;
import
com.topsunit.scanservice.ximai.service.MoctfService
;
import
com.topsunit.scanservice.ximai.service.MoctfService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -26,4 +23,11 @@ public class MoctfController {
...
@@ -26,4 +23,11 @@ public class MoctfController {
public
void
create
(
@RequestBody
MoctfCreateParams
createParams
)
{
public
void
create
(
@RequestBody
MoctfCreateParams
createParams
)
{
moctfService
.
create
(
createParams
);
moctfService
.
create
(
createParams
);
}
}
@PostMapping
(
"/moctf/createByErp"
)
public
void
createByErp
(
@RequestBody
MoctfCreateParams2
createParams
)
{
moctfService
.
create2
(
createParams
);
}
}
}
src/main/java/com/topsunit/scanservice/ximai/dao/MoctfDao.java
View file @
881c701b
...
@@ -7,6 +7,8 @@ import com.topsunit.scanservice.ximai.entity.MocthId;
...
@@ -7,6 +7,8 @@ import com.topsunit.scanservice.ximai.entity.MocthId;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
import
java.util.Optional
;
/**
/**
* <p>Title: MoctfDao</p>
* <p>Title: MoctfDao</p>
* <p>Description: MoctfDao</p>
* <p>Description: MoctfDao</p>
...
@@ -16,4 +18,5 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
...
@@ -16,4 +18,5 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
* @date 2024/10/23
* @date 2024/10/23
*/
*/
public
interface
MoctfDao
extends
JpaRepository
<
Moctf
,
MoctfId
>,
JpaSpecificationExecutor
<
Moctf
>
{
public
interface
MoctfDao
extends
JpaRepository
<
Moctf
,
MoctfId
>,
JpaSpecificationExecutor
<
Moctf
>
{
Optional
<
Moctf
>
findFirstByTf001AndTf002StartingWithOrderByTf002Desc
(
String
tf001
,
String
tf002
);
}
}
src/main/java/com/topsunit/scanservice/ximai/dto/MoctcCreateDto.java
View file @
881c701b
...
@@ -3,6 +3,7 @@ package com.topsunit.scanservice.ximai.dto;
...
@@ -3,6 +3,7 @@ package com.topsunit.scanservice.ximai.dto;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -21,8 +22,10 @@ public class MoctcCreateDto {
...
@@ -21,8 +22,10 @@ public class MoctcCreateDto {
/*产品品号*/
/*产品品号*/
@ApiModelProperty
(
"产品品号"
)
@ApiModelProperty
(
"产品品号"
)
private
String
ta006
;
private
String
ta006
;
@ApiModelProperty
(
"预计产量"
)
private
BigDecimal
ta015
;
/*入库仓库*/
/*入库仓库*/
@ApiModelProperty
(
"
性质 1.厂内工单、2.委外工单
"
)
@ApiModelProperty
(
"
入库仓库
"
)
private
String
ta020
;
private
String
ta020
;
/*性质 1.厂内工单、2.委外工单*/
/*性质 1.厂内工单、2.委外工单*/
@ApiModelProperty
(
"性质 1.厂内工单、2.委外工单"
)
@ApiModelProperty
(
"性质 1.厂内工单、2.委外工单"
)
...
...
src/main/java/com/topsunit/scanservice/ximai/dto/MoctfCreateParams2.java
0 → 100644
View file @
881c701b
package
com
.
topsunit
.
scanservice
.
ximai
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* <p>Title: MoctfCreateParams</p>
* <p>Description: 完工入库申请表头</p>
*
* @author chicheng.li
* @version V1.0
* @date 2024/10/22
*/
@Data
public
class
MoctfCreateParams2
{
@ApiModelProperty
(
"入库单别"
)
private
String
tg001
=
"5801"
;
@ApiModelProperty
(
"仓库"
)
private
String
tg010
;
@ApiModelProperty
(
"库位"
)
private
String
tg036
;
@ApiModelProperty
(
"入库数量"
)
private
BigDecimal
tg011
;
@ApiModelProperty
(
"工单单别"
)
private
String
tg014
;
@ApiModelProperty
(
"工单单号"
)
private
String
tg015
;
}
src/main/java/com/topsunit/scanservice/ximai/service/MoctfService.java
View file @
881c701b
...
@@ -63,4 +63,56 @@ public class MoctfService {
...
@@ -63,4 +63,56 @@ public class MoctfService {
moctf
.
setTf024
(
create
.
getDetails
().
get
(
0
).
getTg011
());
moctf
.
setTf024
(
create
.
getDetails
().
get
(
0
).
getTg011
());
moctfDao
.
save
(
moctf
);
moctfDao
.
save
(
moctf
);
}
}
@Transactional
public
void
create2
(
MoctfCreateParams2
create
){
Moctf
moctf
=
BeanUtil
.
toBeanIgnoreError
(
new
MoctfCreateParams
(),
Moctf
.
class
);
Calendar
curr
=
Calendar
.
getInstance
();
String
currStr
=
DateUtil
.
format
(
curr
.
getTime
(),
"yyyyMMdd"
);
moctf
.
setTf001
(
create
.
getTg001
());
moctf
.
setTf002
(
this
.
getNewTf002
(
create
.
getTg001
()));
moctf
.
setTf003
(
currStr
);
moctf
.
setTf012
(
currStr
);
AtomicReference
<
String
>
ta083
=
new
AtomicReference
<
String
>();
Moctg
moctg
=
BeanUtil
.
toBeanIgnoreError
(
new
MoctgCreateParams
(),
Moctg
.
class
);
BeanUtil
.
copyProperties
(
create
,
moctg
);
//查询工单
Mocta
mocta
=
moctaDao
.
findById
(
new
MoctaId
(
create
.
getTg014
(),
create
.
getTg015
())).
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到对应工单:{0},{1}"
,
create
.
getTg014
(),
create
.
getTg015
())));
//查询物料
Invmb
invmb
=
invmbDao
.
findById
(
mocta
.
getTa006
()).
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到对应物料:{0}"
,
mocta
.
getTa006
())));
moctg
.
setTg001
(
moctf
.
getTf001
());
moctg
.
setTg002
(
moctf
.
getTf002
());
moctg
.
setTg004
(
invmb
.
getMb001
());
moctg
.
setTg005
(
invmb
.
getMb002
());
moctg
.
setTg006
(
invmb
.
getMb003
());
moctg
.
setTg007
(
invmb
.
getMb004
());
moctg
.
setTg013
(
create
.
getTg011
());
moctg
.
setTg037
(
invmb
.
getMb004
());
moctg
.
setTg010
(
invmb
.
getMb017
());
ta083
.
set
(
mocta
.
getTa083
());
//查询物料默认仓库
Invmc
invmc
=
invmcDao
.
findById
(
new
InvmcId
(
invmb
.
getMb001
(),
invmb
.
getMb017
())).
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到对应物料默认库:{0},{1}"
,
invmb
.
getMb001
(),
invmb
.
getMb017
())));
moctg
.
setTg036
(
invmc
.
getMc015
());
moctg
.
setTg030
(
currStr
);
moctg
.
setTg038
(
moctg
.
getTg011
());
moctgDao
.
save
(
moctg
);
moctf
.
setTf033
(
ta083
.
get
());
moctf
.
setTf023
(
create
.
getTg011
());
moctf
.
setTf024
(
create
.
getTg011
());
moctfDao
.
save
(
moctf
);
}
private
String
getNewTf002
(
String
tf001
)
{
String
prefix
=
com
.
topsunit
.
scanservice
.
ximai
.
common
.
DateUtil
.
currentDateString
();
return
moctfDao
.
findFirstByTf001AndTf002StartingWithOrderByTf002Desc
(
tf001
,
prefix
)
.
map
(
i
->
{
int
currentOrdianl
=
Integer
.
parseInt
(
i
.
getTf002
().
replace
(
prefix
,
""
));
return
prefix
+
String
.
format
(
"%03d"
,
currentOrdianl
+
1
);
})
.
orElse
(
prefix
+
"001"
);
}
}
}
src/main/java/com/topsunit/scanservice/ximai/service/PurccService.java
View file @
881c701b
...
@@ -152,7 +152,7 @@ public class PurccService {
...
@@ -152,7 +152,7 @@ public class PurccService {
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未配置打印机:"
)+
printParams
.
getUdf01
()));
.
orElseThrow
(()->
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未配置打印机:"
)+
printParams
.
getUdf01
()));
String
url
=
"http://%s:8085/ximaiprintservice/print/PrintLabelByBarTender"
;
String
url
=
"http://%s:8085/ximaiprintservice/print/PrintLabelByBarTender"
;
url
=
String
.
format
(
url
,
warehouseArrive
.
get
WarehouseName
());
url
=
String
.
format
(
url
,
warehouseArrive
.
get
PrintIp
());
List
<
List
<
PrintField
>>
codeList
=
new
ArrayList
<>();
List
<
List
<
PrintField
>>
codeList
=
new
ArrayList
<>();
purcdPrintParamsList
.
forEach
(
i
->
{
purcdPrintParamsList
.
forEach
(
i
->
{
purcdDao
.
findById
(
new
PurcdId
(
i
.
getCd001
(),
i
.
getCd002
(),
i
.
getCd003
())).
ifPresent
(
j
->
{
purcdDao
.
findById
(
new
PurcdId
(
i
.
getCd001
(),
i
.
getCd002
(),
i
.
getCd003
())).
ifPresent
(
j
->
{
...
...
src/main/java/com/topsunit/scanservice/ximai/service/PurtgService.java
View file @
881c701b
...
@@ -12,7 +12,10 @@ import com.topsunit.scanservice.ximai.dto.PurthCreateParams;
...
@@ -12,7 +12,10 @@ import com.topsunit.scanservice.ximai.dto.PurthCreateParams;
import
com.topsunit.scanservice.ximai.dto.mapper.PurtgMapper
;
import
com.topsunit.scanservice.ximai.dto.mapper.PurtgMapper
;
import
com.topsunit.scanservice.ximai.entity.*
;
import
com.topsunit.scanservice.ximai.entity.*
;
import
com.topsunit.scanservice.ximai.security.CurrentActor
;
import
com.topsunit.scanservice.ximai.security.CurrentActor
;
import
com.topsunit.scanservice.ximai.security.CurrentActorSetter
;
import
com.topsunit.scanservice.ximai.utils.MessageUtils
;
import
com.topsunit.scanservice.ximai.utils.MessageUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -46,6 +49,8 @@ public class PurtgService {
...
@@ -46,6 +49,8 @@ public class PurtgService {
private
final
PurmaDao
purmaDao
;
private
final
PurmaDao
purmaDao
;
private
final
CmsniDao
cmsniDao
;
private
final
CmsniDao
cmsniDao
;
private
final
PurtgMapper
purtgMapper
;
private
final
PurtgMapper
purtgMapper
;
@Autowired
ApplicationContext
applicationContext
;
public
PurtgService
(
CurrentActor
currentActor
,
CmsmgDao
cmsmgDao
,
InvmbDao
invmbDao
,
InvmcDao
invmcDao
,
InvmeDao
invmeDao
,
PurccDao
purccDao
,
PurcdDao
purcdDao
,
PurtcDao
purtcDao
,
PurtdDao
purtdDao
,
PurtgDao
purtgDao
,
PurthDao
purthDao
,
PurmaDao
purmaDao
,
CmsniDao
cmsniDao
,
PurtgMapper
purtgMapper
)
{
public
PurtgService
(
CurrentActor
currentActor
,
CmsmgDao
cmsmgDao
,
InvmbDao
invmbDao
,
InvmcDao
invmcDao
,
InvmeDao
invmeDao
,
PurccDao
purccDao
,
PurcdDao
purcdDao
,
PurtcDao
purtcDao
,
PurtdDao
purtdDao
,
PurtgDao
purtgDao
,
PurthDao
purthDao
,
PurmaDao
purmaDao
,
CmsniDao
cmsniDao
,
PurtgMapper
purtgMapper
)
{
this
.
currentActor
=
currentActor
;
this
.
currentActor
=
currentActor
;
...
@@ -172,6 +177,10 @@ public class PurtgService {
...
@@ -172,6 +177,10 @@ public class PurtgService {
// tg046
// tg046
// tg047
// tg047
// tg048
// tg048
CurrentActorSetter
currentActorSetter
=
applicationContext
.
getBean
(
CurrentActorSetter
.
class
);
if
(
currentActorSetter
.
getActor
()==
null
){
throw
new
TopsunitException
(
MessageUtils
.
getMessage
(
"未找到用户:{0}"
,
currentActorSetter
.
getActorStr
()));
}
purtg
.
setTg049
(
currentActor
.
getActor
().
getMv004
());
purtg
.
setTg049
(
currentActor
.
getActor
().
getMv004
());
purtg
.
setTg050
(
"N"
);
purtg
.
setTg050
(
"N"
);
// tg051
// tg051
...
...
src/main/resources/application-dev.yml
View file @
881c701b
topsunit
:
topsunit
:
token-expires-hour
:
8760
token-expires-hour
:
8760
token-secret
:
q8w3Cx9Lr4fT2y6uV5sZ8aE1mN0kP7gH
token-secret
:
q8w3Cx9Lr4fT2y6uV5sZ8aE1mN0kP7gH
authentication-enabled
:
tru
e
authentication-enabled
:
fals
e
print-api-url
:
http://127.0.0.1:8085/ximaiprintservice/print/PrintLabelByBarTender
print-api-url
:
http://127.0.0.1:8085/ximaiprintservice/print/PrintLabelByBarTender
share-url
:
smb://127.0.0.1/share
share-url
:
smb://127.0.0.1/share
mes-url
:
http://localhost:8088
mes-url
:
http://localhost:8088
...
...
src/main/resources/application.yml
View file @
881c701b
spring
:
spring
:
profiles
:
profiles
:
active
:
active
:
-
test-sh
-
dev
\ No newline at end of file
\ No newline at end of file
src/main/resources/i18n/messages.properties
View file @
881c701b
...
@@ -41,4 +41,5 @@
...
@@ -41,4 +41,5 @@
通知单{0}已全部出库=通知单{0}已全部出库
通知单{0}已全部出库=通知单{0}已全部出库
未找到销售订单:{0},{1}=未找到销售订单:{0},{1}
未找到销售订单:{0},{1}=未找到销售订单:{0},{1}
未找到销售订单:{0},{1},{2}=未找到销售订单:{0},{1},{2}
未找到销售订单:{0},{1},{2}=未找到销售订单:{0},{1},{2}
未找到客户:{0}=未找到客户:{0}
未找到客户:{0}=未找到客户:{0}
\ No newline at end of file
未找到用户:{0}=未找到用户:{0}
\ No newline at end of file
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