Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kwell-mes
Project
Project
Details
Activity
Releases
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
gavelinfo
kwell-mes
Commits
1557f5ac
Commit
1557f5ac
authored
Feb 15, 2022
by
dingyoujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coderule
parent
97c3ca15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
86 deletions
+42
-86
U_coderuleController.java
...java/com/gavel/kwell/controller/U_coderuleController.java
+1
-3
U_coderuleService.java
.../main/java/com/gavel/kwell/service/U_coderuleService.java
+2
-2
U_coderuleServiceImpl.java
...a/com/gavel/kwell/service/impl/U_coderuleServiceImpl.java
+39
-81
No files found.
gavel/src/main/java/com/gavel/kwell/controller/U_coderuleController.java
View file @
1557f5ac
...
@@ -127,8 +127,6 @@ public class U_coderuleController extends BaseController {
...
@@ -127,8 +127,6 @@ public class U_coderuleController extends BaseController {
public
Object
createWosn
(
@RequestBody
JSONObject
param
)
{
public
Object
createWosn
(
@RequestBody
JSONObject
param
)
{
String
woid
=
param
.
getString
(
"woid"
);
String
woid
=
param
.
getString
(
"woid"
);
List
<
CodeValueVO
>
codeValueVOList
=
DataConvert
.
getData2List
(
param
.
getJSONArray
(
"codeValueList"
),
CodeValueVO
.
class
);
List
<
CodeValueVO
>
codeValueVOList
=
DataConvert
.
getData2List
(
param
.
getJSONArray
(
"codeValueList"
),
CodeValueVO
.
class
);
List
<
CodeValueVO
>
khValueVOList
=
DataConvert
.
getData2List
(
param
.
getJSONArray
(
"khValueList"
),
CodeValueVO
.
class
);
List
<
CodeValueVO
>
khValueVOList2
=
DataConvert
.
getData2List
(
param
.
getJSONArray
(
"khValueList2"
),
CodeValueVO
.
class
);
Integer
count
=
param
.
getInteger
(
"count"
);
Integer
count
=
param
.
getInteger
(
"count"
);
if
(
StringUtils
.
isEmpty
(
woid
)){
if
(
StringUtils
.
isEmpty
(
woid
)){
setReturnMessage
(
"任务单信息不允许为空!"
);
setReturnMessage
(
"任务单信息不允许为空!"
);
...
@@ -142,7 +140,7 @@ public class U_coderuleController extends BaseController {
...
@@ -142,7 +140,7 @@ public class U_coderuleController extends BaseController {
setReturnMessage
(
"条码信息异常,请检查!"
);
setReturnMessage
(
"条码信息异常,请检查!"
);
return
returnData
();
return
returnData
();
}
}
u_coderuleService
.
createWosn
(
woid
,
codeValueVOList
,
khValueVOList
,
khValueVOList2
,
count
);
u_coderuleService
.
createWosn
(
woid
,
codeValueVOList
,
count
);
return
ThreadContext
.
getReturnData
();
return
ThreadContext
.
getReturnData
();
}
}
...
...
gavel/src/main/java/com/gavel/kwell/service/U_coderuleService.java
View file @
1557f5ac
...
@@ -20,10 +20,10 @@ public interface U_coderuleService extends BaseEditService {
...
@@ -20,10 +20,10 @@ public interface U_coderuleService extends BaseEditService {
public
RecordSet
<
U_coderuleVO
>
querySn
(
U_coderuleCondition
condition
);
public
RecordSet
<
U_coderuleVO
>
querySn
(
U_coderuleCondition
condition
);
public
RecordSet
<
Autoinc
>
autonicInfo
(
U_coderuleCondition
condition
);
public
RecordSet
<
Autoinc
>
autonicInfo
(
U_coderuleCondition
condition
);
public
List
<
CodeValueVO
>
getCodeValueListByCrWo
(
String
crid
,
Object
entity
);
public
List
<
CodeValueVO
>
getCodeValueListByCrWo
(
String
crid
,
Object
entity
);
public
void
createWosn
(
String
woid
,
List
<
CodeValueVO
>
codeValueVOList
,
List
<
CodeValueVO
>
khValueVOList
,
List
<
CodeValueVO
>
khValueVOList2
,
int
count
);
public
void
createWosn
(
String
woid
,
List
<
CodeValueVO
>
codeValueVOList
,
int
count
);
public
CodeValueInfoVO
createOneCodeByCrId
(
String
woid
,
String
crId
,
String
type
);
public
CodeValueInfoVO
createOneCodeByCrId
(
String
woid
,
String
crId
,
String
type
);
...
...
gavel/src/main/java/com/gavel/kwell/service/impl/U_coderuleServiceImpl.java
View file @
1557f5ac
...
@@ -304,8 +304,14 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -304,8 +304,14 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
return
StringUtils
.
fillStringBeforeString
(
result
,
CRConstants
.
CR_FILL
,
len
);
return
StringUtils
.
fillStringBeforeString
(
result
,
CRConstants
.
CR_FILL
,
len
);
}
}
/**
* 需要调整
* @param woid
* @param codeValueVOList
* @param count
*/
@Override
@Override
public
void
createWosn
(
String
woid
,
List
<
CodeValueVO
>
codeValueVOList
,
List
<
CodeValueVO
>
khValueVOList
,
List
<
CodeValueVO
>
khValueVOList2
,
int
count
){
public
void
createWosn
(
String
woid
,
List
<
CodeValueVO
>
codeValueVOList
,
int
count
){
if
(
StringUtils
.
isEmpty
(
woid
))
{
if
(
StringUtils
.
isEmpty
(
woid
))
{
setReturnMessage
(
"生产订单号不能为空!"
);
setReturnMessage
(
"生产订单号不能为空!"
);
return
;
return
;
...
@@ -333,19 +339,12 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -333,19 +339,12 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
setReturnMessage
(
"生产任务单物料信息异常,请重新操作!"
);
setReturnMessage
(
"生产任务单物料信息异常,请重新操作!"
);
return
;
return
;
}
}
if
(
StringUtils
.
isEmpty
(
wlxx
.
get
Wosngz
id
())){
if
(
StringUtils
.
isEmpty
(
wlxx
.
get
Snrule
id
())){
setReturnMessage
(
"请先维护当前产品的产品条码规则!"
);
setReturnMessage
(
"请先维护当前产品的产品条码规则!"
);
return
;
return
;
}
}
String
crCode
=
wlxx
.
getWosngzid
();
String
crCode
=
wlxx
.
getSnruleid
();
String
khcrCode
=
wlxx
.
getKhsngzid
();
String
khcrCode2
=
wlxx
.
getKhsngzidby1
();
if
(
StringUtils
.
isNotEmpty
(
khcrCode
)
&&
(
khValueVOList
==
null
||
khValueVOList
.
size
()
==
0
)){
setReturnMessage
(
"客户条码信息异常,请重新操作!"
);
return
;
}
String
format
=
""
;
String
format
=
""
;
String
prefix
=
""
;
String
prefix
=
""
;
...
@@ -364,53 +363,7 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -364,53 +363,7 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
}
}
}
}
String
khformat
=
""
;
String
khprefix
=
""
;
String
khsngz
=
""
;
Integer
khlen
=
0
;
if
(
khValueVOList
!=
null
&&
khValueVOList
.
size
()
>
0
){
for
(
CodeValueVO
codeValueVO:
khValueVOList
){
if
(
BooleanEnum
.
equalsYes
(
codeValueVO
.
getContainsn
())){
khprefix
=
khprefix
+
codeValueVO
.
getValue
();
}
if
(!
BooleanEnum
.
equalsYes
(
codeValueVO
.
getSnflag
())){
khformat
=
khformat
+
codeValueVO
.
getValue
();
}
else
{
khformat
=
khformat
+
"%s"
;
khsngz
=
codeValueVO
.
getSngz
();
khlen
=
codeValueVO
.
getLen
();
}
}
}
String
khformat2
=
""
;
String
khprefix2
=
""
;
String
khsngz2
=
""
;
Integer
khlen2
=
0
;
if
(
khValueVOList2
!=
null
&&
khValueVOList2
.
size
()
>
0
){
for
(
CodeValueVO
codeValueVO:
khValueVOList2
){
if
(
BooleanEnum
.
equalsYes
(
codeValueVO
.
getContainsn
())){
khprefix2
=
khprefix2
+
codeValueVO
.
getValue
();
}
if
(!
BooleanEnum
.
equalsYes
(
codeValueVO
.
getSnflag
())){
khformat2
=
khformat2
+
codeValueVO
.
getValue
();
}
else
{
khformat2
=
khformat2
+
"%s"
;
khsngz2
=
codeValueVO
.
getSngz
();
khlen2
=
codeValueVO
.
getLen
();
}
}
}
int
order
=
commonService
.
getSequence
(
CRTableTypeEnum
.
WOSN
.
getId
()
+
crCode
,
prefix
,
count
);
int
order
=
commonService
.
getSequence
(
CRTableTypeEnum
.
WOSN
.
getId
()
+
crCode
,
prefix
,
count
);
int
khorder
=
0
;
int
khorder2
=
0
;
if
(
StringUtils
.
isNotEmpty
(
khcrCode
)){
khorder
=
commonService
.
getSequence
(
CRTableTypeEnum
.
KHSN
.
getId
()
+
khcrCode
,
khprefix
,
count
);
}
if
(
StringUtils
.
isNotEmpty
(
khcrCode2
)){
khorder2
=
commonService
.
getSequence
(
CRTableTypeEnum
.
KHB1SN
.
getId
()
+
khcrCode2
,
khprefix2
,
count
);
}
List
<
Wosn
>
list
=
new
ArrayList
<>();
List
<
Wosn
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
HzWosn
wosn
=
new
HzWosn
();
HzWosn
wosn
=
new
HzWosn
();
...
@@ -419,19 +372,6 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -419,19 +372,6 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
wosn
.
setCode
(
String
.
format
(
format
,
sn
));
wosn
.
setCode
(
String
.
format
(
format
,
sn
));
wosn
.
setCodeflid
(
CRTableTypeEnum
.
WOSN
.
getId
()
+
crCode
);
wosn
.
setCodeflid
(
CRTableTypeEnum
.
WOSN
.
getId
()
+
crCode
);
wosn
.
setCodeprefix
(
prefix
);
wosn
.
setCodeprefix
(
prefix
);
if
(
StringUtils
.
isNotEmpty
(
khcrCode
)){
String
khsn
=
getCRSnValue
(
khsngz
,
khorder
+
i
,
khlen
);
wosn
.
setKhcode
(
String
.
format
(
khformat
,
khsn
));
wosn
.
setKhcodeflid
(
CRTableTypeEnum
.
KHSN
.
getId
()
+
khcrCode
);
wosn
.
setKhcodeprefix
(
khprefix
);
}
if
(
StringUtils
.
isNotEmpty
(
khcrCode2
)){
String
khsn2
=
getCRSnValue
(
khsngz2
,
khorder2
+
i
,
khlen2
);
wosn
.
setKhcodeby1
(
String
.
format
(
khformat2
,
khsn2
));
wosn
.
setKhcodeby1flid
(
CRTableTypeEnum
.
KHB1SN
.
getId
()
+
khcrCode2
);
wosn
.
setKhcodeby1prefix
(
khprefix2
);
}
list
.
add
(
wosn
);
list
.
add
(
wosn
);
}
}
u_coderuleDao
.
batchAdd
(
list
);
u_coderuleDao
.
batchAdd
(
list
);
...
@@ -545,26 +485,26 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -545,26 +485,26 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
String
crCode
=
""
;
String
crCode
=
""
;
String
flid
=
""
;
String
flid
=
""
;
if
(
type
.
equalsIgnoreCase
(
CRTableTypeEnum
.
WOSN
.
getId
())){
if
(
type
.
equalsIgnoreCase
(
CRTableTypeEnum
.
WOSN
.
getId
())){
crCode
=
wlxx
.
get
Wosngz
id
();
crCode
=
wlxx
.
get
Snrule
id
();
if
(
StringUtils
.
isEmpty
(
crCode
)){
if
(
StringUtils
.
isEmpty
(
crCode
)){
setReturnMessage
(
"请先维护当前产品的产品条码规则!"
);
setReturnMessage
(
"请先维护当前产品的产品条码规则!"
);
return
null
;
return
null
;
}
}
flid
=
CRTableTypeEnum
.
WOSN
.
getId
()
+
crCode
;
flid
=
CRTableTypeEnum
.
WOSN
.
getId
()
+
crCode
;
}
}
if
(
type
.
equalsIgnoreCase
(
CRTableTypeEnum
.
KHSN
.
getId
())){
//
if(type.equalsIgnoreCase(CRTableTypeEnum.KHSN.getId())){
crCode
=
wlxx
.
getKhsngzid
();
//
crCode = wlxx.getKhsngzid();
if
(
StringUtils
.
isEmpty
(
crCode
)){
//
if(StringUtils.isEmpty(crCode)){
setReturnMessage
(
"请先维护当前产品的客户条码规则!"
);
//
setReturnMessage("请先维护当前产品的客户条码规则!");
return
null
;
//
return null;
}
//
}
flid
=
CRTableTypeEnum
.
KHSN
.
getId
()
+
crCode
;
//
flid = CRTableTypeEnum.KHSN.getId() + crCode;
}
//
}
if
(
StringUtils
.
isEmpty
(
crCode
)){
if
(
StringUtils
.
isEmpty
(
crCode
)){
setReturnMessage
(
"条码规则信息异常!"
);
setReturnMessage
(
"条码规则信息异常!"
);
return
null
;
return
null
;
}
}
List
<
CodeValueVO
>
codeValueVOList
=
getCodeValueListByCrWo
(
wlxx
.
getWosngzid
()
,
wo
);
List
<
CodeValueVO
>
codeValueVOList
=
getCodeValueListByCrWo
(
crCode
,
wo
);
String
prefix
=
""
;
String
prefix
=
""
;
for
(
CodeValueVO
codeValueVO:
codeValueVOList
){
for
(
CodeValueVO
codeValueVO:
codeValueVOList
){
...
@@ -605,6 +545,16 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -605,6 +545,16 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
createWlsn
(
wlid
,
codeValueVOList
,
count
,
CRTableTypeEnum
.
GJSN
.
getId
(),
""
,
WlsnDjlyEnum
.
ZGJWL
.
getId
(),
""
);
createWlsn
(
wlid
,
codeValueVOList
,
count
,
CRTableTypeEnum
.
GJSN
.
getId
(),
""
,
WlsnDjlyEnum
.
ZGJWL
.
getId
(),
""
);
}
}
/**
* 生成物料件,可以暂时保留,0215
* @param wlid
* @param codeValueVOList
* @param count
* @param type
* @param djly
* @param lydjid
* @param wlph
*/
@Override
@Override
public
void
createWlsn
(
String
wlid
,
List
<
CodeValueVO
>
codeValueVOList
,
int
count
,
String
type
,
String
djly
,
String
lydjid
,
String
wlph
){
public
void
createWlsn
(
String
wlid
,
List
<
CodeValueVO
>
codeValueVOList
,
int
count
,
String
type
,
String
djly
,
String
lydjid
,
String
wlph
){
if
(
StringUtils
.
isEmpty
(
wlid
))
{
if
(
StringUtils
.
isEmpty
(
wlid
))
{
...
@@ -629,12 +579,12 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -629,12 +579,12 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
setReturnMessage
(
"物料信息异常,请重新操作!"
);
setReturnMessage
(
"物料信息异常,请重新操作!"
);
return
;
return
;
}
}
if
(
StringUtils
.
isEmpty
(
wlxx
.
get
Wosngz
id
())){
if
(
StringUtils
.
isEmpty
(
wlxx
.
get
Snrule
id
())){
setReturnMessage
(
"请先维护当前产品的产品条码规则!"
);
setReturnMessage
(
"请先维护当前产品的产品条码规则!"
);
return
;
return
;
}
}
String
crCode
=
wlxx
.
get
Wosngz
id
();
String
crCode
=
wlxx
.
get
Snrule
id
();
String
format
=
""
;
String
format
=
""
;
String
prefix
=
""
;
String
prefix
=
""
;
...
@@ -679,6 +629,14 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
...
@@ -679,6 +629,14 @@ public class U_coderuleServiceImpl extends BaseEditServiceImpl implements U_code
u_coderuleDao
.
batchAdd
(
list
);
u_coderuleDao
.
batchAdd
(
list
);
}
}
/**
* 确定生成序列号,0215
* @param crId
* @param codeValueVOList
* @param type
* @param count
* @return
*/
@Override
@Override
public
List
<
CodeValueInfoVO
>
getSnListByCRValue
(
String
crId
,
List
<
CodeValueVO
>
codeValueVOList
,
String
type
,
int
count
){
public
List
<
CodeValueInfoVO
>
getSnListByCRValue
(
String
crId
,
List
<
CodeValueVO
>
codeValueVOList
,
String
type
,
int
count
){
if
(
NumberUtils
.
lessEqual
(
count
,
0
))
{
if
(
NumberUtils
.
lessEqual
(
count
,
0
))
{
...
...
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