Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
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
platform
hp-smart
Commits
6cbef9ad
Commit
6cbef9ad
authored
Apr 17, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.生成二维码
parent
84e67b8b
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
173 additions
and
46 deletions
+173
-46
EuTools.java
src/main/java/com/baosight/hpjx/core/tools/EuTools.java
+0
-27
QrCodeUtils.java
src/main/java/com/baosight/hpjx/core/utils/QrCodeUtils.java
+6
-2
HPSqlConstant.java
...ain/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
+2
-0
HPSC003.java
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC003.java
+16
-6
ServiceHPSC003.java
.../java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
+37
-5
HPSC003.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC003.xml
+10
-0
HPSC005B.xml
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC005B.xml
+4
-1
HPSCTools.java
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
+39
-4
EiInfoUtils.java
src/main/java/com/baosight/hpjx/util/EiInfoUtils.java
+41
-0
ObjectUtils.java
src/main/java/com/baosight/hpjx/util/ObjectUtils.java
+17
-0
application.properties
src/main/resources/application.properties
+1
-1
No files found.
src/main/java/com/baosight/hpjx/core/tools/EuTools.java
deleted
100644 → 0
View file @
84e67b8b
package
com
.
baosight
.
hpjx
.
core
.
tools
;
/**
* @author:songx
* @date:2024/4/16,16:29
*/
public
class
EuTools
{
/**
* @author:songx
* @date:2024/4/16,16:29
*/
public
static
class
EuDm01
{
/**
* @param realPath
* @param docId
* @return
*/
public
static
void
intoDb
(
String
realPath
,
String
docId
)
{
}
}
}
src/main/java/com/baosight/hpjx/core/utils/QrCodeUtils.java
View file @
6cbef9ad
...
@@ -47,10 +47,14 @@ public class QrCodeUtils {
...
@@ -47,10 +47,14 @@ public class QrCodeUtils {
/**
/**
* 生成本地文件
* 生成本地文件
* {
* "file": "D:\\home\\appuser\\qrCode\\20240416162700_mizw6izh.png",
* "docId": "90f1a41a48e644d1a56682be03a231db",
* "filePath": "D:\\home\\appuser\\qrCode\\20240416162700_mizw6izh.png",
* "fileLocation": "local"
* }
*
*
* @param content
* @param content
* @throws WriterException
* @throws IOException
*/
*/
public
static
Map
<
String
,
Object
>
create
(
String
content
)
throws
Exception
{
public
static
Map
<
String
,
Object
>
create
(
String
content
)
throws
Exception
{
String
fileLocation
=
PlatApplicationContext
.
getProperty
(
"iplat4j.admin.upload.fileLocation"
);
String
fileLocation
=
PlatApplicationContext
.
getProperty
(
"iplat4j.admin.upload.fileLocation"
);
...
...
src/main/java/com/baosight/hpjx/hp/constant/HPSqlConstant.java
View file @
6cbef9ad
...
@@ -316,6 +316,8 @@ public class HPSqlConstant {
...
@@ -316,6 +316,8 @@ public class HPSqlConstant {
// 修改状态
// 修改状态
public
static
final
String
UPDATE_STATUS
=
"HPSC003.updateStatus"
;
public
static
final
String
UPDATE_STATUS
=
"HPSC003.updateStatus"
;
// 修改状态
public
static
final
String
UPDATE_QRCODE
=
"HPSC003.updateQrcode"
;
// 修改时间
// 修改时间
public
static
final
String
UPDATE_DATE
=
"HPSC003.updateDate"
;
public
static
final
String
UPDATE_DATE
=
"HPSC003.updateDate"
;
...
...
src/main/java/com/baosight/hpjx/hp/sc/domain/HPSC003.java
View file @
6cbef9ad
...
@@ -42,9 +42,8 @@ public class HPSC003 extends DaoEPBase {
...
@@ -42,9 +42,8 @@ public class HPSC003 extends DaoEPBase {
public
static
final
String
FIELD_REMARK
=
"remark"
;
/* 备注*/
public
static
final
String
FIELD_REMARK
=
"remark"
;
/* 备注*/
public
static
final
String
FIELD_SCHEDULE
=
"schedule"
;
public
static
final
String
FIELD_SCHEDULE
=
"schedule"
;
public
static
final
String
FIELD_DELIVERY_DATE
=
"deliveryDate"
;
public
static
final
String
FIELD_DELIVERY_DATE
=
"deliveryDate"
;
public
static
final
String
FIELD_INVENT_RECORD_ID
=
"inventRecordId"
;
public
static
final
String
FIELD_INVENT_RECORD_ID
=
"inventRecordId"
;
public
static
final
String
FIELD_QRCODE_DOC_ID
=
"qrcodeDocId"
;
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_COMPANY_CODE
=
"COMPANY_CODE"
;
/* 企业编码 预留*/
public
static
final
String
COL_COMPANY_CODE
=
"COMPANY_CODE"
;
/* 企业编码 预留*/
...
@@ -65,6 +64,7 @@ public class HPSC003 extends DaoEPBase {
...
@@ -65,6 +64,7 @@ public class HPSC003 extends DaoEPBase {
public
static
final
String
COL_REMARK
=
"REMARK"
;
/* 备注*/
public
static
final
String
COL_REMARK
=
"REMARK"
;
/* 备注*/
public
static
final
String
COL_INVENT_RECORD_ID
=
"INVENT_RECORD_ID"
;
public
static
final
String
COL_INVENT_RECORD_ID
=
"INVENT_RECORD_ID"
;
public
static
final
String
COL_DELIVERY_DATE
=
"DELIVERY_DATE"
;
public
static
final
String
COL_DELIVERY_DATE
=
"DELIVERY_DATE"
;
public
static
final
String
COL_QRCODE_DOC_ID
=
"QRCODE_DOC_ID"
;
public
static
final
String
QUERY
=
"HPSC003.query"
;
public
static
final
String
QUERY
=
"HPSC003.query"
;
public
static
final
String
COUNT
=
"HPSC003.count"
;
public
static
final
String
COUNT
=
"HPSC003.count"
;
...
@@ -90,17 +90,14 @@ public class HPSC003 extends DaoEPBase {
...
@@ -90,17 +90,14 @@ public class HPSC003 extends DaoEPBase {
private
String
depCode
=
" "
;
/* 部门编码*/
private
String
depCode
=
" "
;
/* 部门编码*/
private
String
remark
=
" "
;
/* 备注*/
private
String
remark
=
" "
;
/* 备注*/
private
Long
matId
=
null
;
/* 物料ID*/
private
Long
matId
=
null
;
/* 物料ID*/
private
String
schedule
=
""
;
private
String
schedule
=
""
;
private
String
deliveryDate
=
" "
;
private
String
deliveryDate
=
" "
;
private
Long
inventRecordId
=
new
Long
(
0
);
private
Long
inventRecordId
=
new
Long
(
0
);
private
String
spec
=
" "
;
/* 规格*/
private
String
spec
=
" "
;
/* 规格*/
private
BigDecimal
length
=
new
BigDecimal
(
0.00
);
/* 长*/
private
BigDecimal
length
=
new
BigDecimal
(
0.00
);
/* 长*/
private
BigDecimal
width
=
new
BigDecimal
(
0.00
);
/* 宽*/
private
BigDecimal
width
=
new
BigDecimal
(
0.00
);
/* 宽*/
private
BigDecimal
thick
=
new
BigDecimal
(
0.00
);
/* 厚*/
private
BigDecimal
thick
=
new
BigDecimal
(
0.00
);
/* 厚*/
private
String
qrcodeDocId
=
" "
;
/* 二维码文件ID */
/**
/**
...
@@ -219,6 +216,9 @@ public class HPSC003 extends DaoEPBase {
...
@@ -219,6 +216,9 @@ public class HPSC003 extends DaoEPBase {
eiColumn
.
setDescName
(
"交货日期"
);
eiColumn
.
setDescName
(
"交货日期"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_QRCODE_DOC_ID
);
eiColumn
.
setDescName
(
"二维码文件ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
}
...
@@ -590,6 +590,14 @@ public class HPSC003 extends DaoEPBase {
...
@@ -590,6 +590,14 @@ public class HPSC003 extends DaoEPBase {
this
.
deliveryDate
=
deliveryDate
;
this
.
deliveryDate
=
deliveryDate
;
}
}
public
String
getQrcodeDocId
()
{
return
qrcodeDocId
;
}
public
void
setQrcodeDocId
(
String
qrcodeDocId
)
{
this
.
qrcodeDocId
=
qrcodeDocId
;
}
/**
/**
* get the value from Map.
* get the value from Map.
*
*
...
@@ -623,6 +631,7 @@ public class HPSC003 extends DaoEPBase {
...
@@ -623,6 +631,7 @@ public class HPSC003 extends DaoEPBase {
setThick
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
"thick"
)),
thick
));
setThick
(
NumberUtils
.
toBigDecimal
(
StringUtils
.
toString
(
map
.
get
(
"thick"
)),
thick
));
setMatId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
"matId"
)),
matId
));
setMatId
(
NumberUtils
.
toLong
(
StringUtils
.
toString
(
map
.
get
(
"matId"
)),
matId
));
setDeliveryDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELIVERY_DATE
)),
deliveryDate
));
setDeliveryDate
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELIVERY_DATE
)),
deliveryDate
));
setQrcodeDocId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_QRCODE_DOC_ID
)),
qrcodeDocId
));
}
}
...
@@ -658,6 +667,7 @@ public class HPSC003 extends DaoEPBase {
...
@@ -658,6 +667,7 @@ public class HPSC003 extends DaoEPBase {
map
.
put
(
"thick"
,
StringUtils
.
toString
(
thick
,
eiMetadata
.
getMeta
(
"thick"
)));
map
.
put
(
"thick"
,
StringUtils
.
toString
(
thick
,
eiMetadata
.
getMeta
(
"thick"
)));
map
.
put
(
"matId"
,
StringUtils
.
toString
(
matId
,
eiMetadata
.
getMeta
(
"matId"
)));
map
.
put
(
"matId"
,
StringUtils
.
toString
(
matId
,
eiMetadata
.
getMeta
(
"matId"
)));
map
.
put
(
FIELD_DELIVERY_DATE
,
StringUtils
.
toString
(
deliveryDate
,
eiMetadata
.
getMeta
(
FIELD_DELIVERY_DATE
)));
map
.
put
(
FIELD_DELIVERY_DATE
,
StringUtils
.
toString
(
deliveryDate
,
eiMetadata
.
getMeta
(
FIELD_DELIVERY_DATE
)));
map
.
put
(
FIELD_QRCODE_DOC_ID
,
StringUtils
.
toString
(
qrcodeDocId
,
eiMetadata
.
getMeta
(
FIELD_QRCODE_DOC_ID
)));
return
map
;
return
map
;
}
}
...
...
src/main/java/com/baosight/hpjx/hp/sc/service/ServiceHPSC003.java
View file @
6cbef9ad
...
@@ -10,12 +10,16 @@ import com.baosight.hpjx.hp.constant.HPSqlConstant;
...
@@ -10,12 +10,16 @@ import com.baosight.hpjx.hp.constant.HPSqlConstant;
import
com.baosight.hpjx.hp.sc.domain.HPSC003
;
import
com.baosight.hpjx.hp.sc.domain.HPSC003
;
import
com.baosight.hpjx.hp.sc.domain.HPSC004
;
import
com.baosight.hpjx.hp.sc.domain.HPSC004
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005
;
import
com.baosight.hpjx.hp.sc.domain.HPSC005B
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
import
com.baosight.hpjx.hp.sc.tools.HPSCTools
;
import
com.baosight.hpjx.util.AssertUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.BeanUtils
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.CommonMethod
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.LogUtils
;
import
com.baosight.hpjx.util.MapUtils
;
import
com.baosight.hpjx.util.ObjectUtils
;
import
com.baosight.hpjx.util.StringUtils
;
import
com.baosight.hpjx.util.StringUtils
;
import
com.baosight.hpjx.util.contants.ACConstants
;
import
com.baosight.hpjx.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
...
@@ -23,12 +27,9 @@ import com.baosight.iplat4j.core.ei.EiConstant;
...
@@ -23,12 +27,9 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.core.service.soa.XLocalManager
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
org.apache.commons.collections.MapUtils
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
@@ -36,7 +37,6 @@ import java.util.Date;
...
@@ -36,7 +37,6 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Random
;
/**
/**
*
*
...
@@ -215,6 +215,10 @@ public class ServiceHPSC003 extends ServiceBase {
...
@@ -215,6 +215,10 @@ public class ServiceHPSC003 extends ServiceBase {
}
}
// 修改计划状态
// 修改计划状态
HPSCTools
.
HpSc003
.
updateStatus
(
id
,
HPConstant
.
planStatus
.
S_1
);
HPSCTools
.
HpSc003
.
updateStatus
(
id
,
HPConstant
.
planStatus
.
S_1
);
// 生成二维码
if
(
StringUtils
.
isBlank
(
dbSc003
.
getQrcodeDocId
()))
{
HPSCTools
.
HpSc003
.
createQrCode
(
id
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"提交成功"
);
inInfo
.
setMsg
(
"提交成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -266,7 +270,7 @@ public class ServiceHPSC003 extends ServiceBase {
...
@@ -266,7 +270,7 @@ public class ServiceHPSC003 extends ServiceBase {
* @param inInfo
* @param inInfo
* @return
* @return
*/
*/
@OperationLogAnnotation
(
operModul
=
"生产计划"
,
operType
=
"查询"
,
operDesc
=
"部件下拉框"
)
@OperationLogAnnotation
(
operModul
=
"生产计划"
,
operType
=
"查询"
,
operDesc
=
"部件下拉框"
)
public
EiInfo
queryInventComboBox
(
EiInfo
inInfo
)
{
public
EiInfo
queryInventComboBox
(
EiInfo
inInfo
)
{
List
<
DdynamicEnum
>
list
=
new
ArrayList
<>();
List
<
DdynamicEnum
>
list
=
new
ArrayList
<>();
list
.
add
(
DdynamicEnum
.
INVENT_RECORD_BLOCK_ID
);
list
.
add
(
DdynamicEnum
.
INVENT_RECORD_BLOCK_ID
);
...
@@ -274,4 +278,32 @@ public class ServiceHPSC003 extends ServiceBase {
...
@@ -274,4 +278,32 @@ public class ServiceHPSC003 extends ServiceBase {
return
inInfo
;
return
inInfo
;
}
}
/**
* 扫码显示计划明细
*
* @param inInfo
* @return
*/
public
EiInfo
qrcodePlanDetail
(
EiInfo
inInfo
)
{
try
{
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
planInfoNo
=
MapUtils
.
getString
(
queryRow
,
HPSC003
.
FIELD_PLAN_INFO_NO
);
AssertUtils
.
isNull
(
planInfoNo
,
"计划号不能为空"
);
// 查询计划主信息
HPSC003
dbSc003
=
HPSCTools
.
HpSc003
.
getByNo
(
planInfoNo
);
EiInfoUtils
.
addBlock
(
inInfo
,
"planMain"
,
dbSc003
,
HPSC003
.
class
);
// 查询计划明细信息
List
<
HPSC004
>
dbSc004s
=
HPSCTools
.
HpSc004
.
queryByParent
(
dbSc003
.
getPlanInfoNo
());
EiInfoUtils
.
addBlock
(
inInfo
,
"planDetail"
,
dbSc004s
,
HPSC004
.
class
);
// 订单号
List
<
String
>
prodOrderNos
=
ObjectUtils
.
listEpKey
(
dbSc004s
,
HPSC004
.
FIELD_PROD_ORDER_NO
);
// 查询派工信息
List
<
HPSC005B
>
dbSc005bs
=
HPSCTools
.
HpSc005b
.
listByOrder
(
prodOrderNos
);
EiInfoUtils
.
addBlock
(
inInfo
,
"prodOrder"
,
dbSc005bs
,
HPSC005B
.
class
);
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"查询计划详情失败"
);
}
return
inInfo
;
}
}
}
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC003.xml
View file @
6cbef9ad
...
@@ -105,6 +105,7 @@
...
@@ -105,6 +105,7 @@
THICK as "thick",
<!-- 厚 -->
THICK as "thick",
<!-- 厚 -->
MAT_ID AS "matId",
MAT_ID AS "matId",
DELIVERY_DATE as "deliveryDate",
DELIVERY_DATE as "deliveryDate",
QRCODE_DOC_ID as "qrcodeDocId",
CONCAT((
CONCAT((
SELECT
SELECT
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
format((ifnull( SUM( ACTUAL_COMPLETION_NUM ), 0 ) / ifnull( SUM( NUM ), 0 ) * 100),2)
...
@@ -234,4 +235,13 @@
...
@@ -234,4 +235,13 @@
WHERE ID = #id#
WHERE ID = #id#
</update>
</update>
<!-- 修改二维码地址 -->
<update
id=
"updateQrcode"
>
UPDATE hpjx.T_HPSC003
SET
QRCODE_DOC_ID = #qrcodeDocId#,
<include
refid=
"updateRevise"
/>
WHERE ID = #id#
</update>
</sqlMap>
</sqlMap>
src/main/java/com/baosight/hpjx/hp/sc/sql/HPSC005B.xml
View file @
6cbef9ad
...
@@ -108,6 +108,9 @@
...
@@ -108,6 +108,9 @@
<isNotEmpty
prepend=
" AND "
property=
"ids"
>
<isNotEmpty
prepend=
" AND "
property=
"ids"
>
A.ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"statuses"
>
#statuses[]#
</iterate>
A.ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"statuses"
>
#statuses[]#
</iterate>
</isNotEmpty>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"prodOrderNos"
>
A.PROD_ORDER_NO IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"prodOrderNos"
>
#prodOrderNos[]#
</iterate>
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"prodTaskNos"
>
<isNotEmpty
prepend=
" AND "
property=
"prodTaskNos"
>
B.PROD_TASK_NO IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"prodTaskNos"
>
#prodTaskNos[]#
</iterate>
B.PROD_TASK_NO IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"prodTaskNos"
>
#prodTaskNos[]#
</iterate>
</isNotEmpty>
</isNotEmpty>
...
@@ -128,7 +131,7 @@
...
@@ -128,7 +131,7 @@
$order$
$order$
</isNotEmpty>
</isNotEmpty>
<isEmpty
property=
"order"
>
<isEmpty
property=
"order"
>
A.
CREATED_TIME desc
A.
PROD_ORDER_NO DESC, B.PROD_TASK_NO ASC
</isEmpty>
</isEmpty>
</dynamic>
</dynamic>
</sql>
</sql>
...
...
src/main/java/com/baosight/hpjx/hp/sc/tools/HPSCTools.java
View file @
6cbef9ad
package
com
.
baosight
.
hpjx
.
hp
.
sc
.
tools
;
package
com
.
baosight
.
hpjx
.
hp
.
sc
.
tools
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baosight.hpjx.core.dao.DaoBase
;
import
com.baosight.hpjx.core.dao.DaoBase
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.dao.DaoUtils
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.core.utils.QrCodeUtils
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.constant.HPSqlConstant
;
import
com.baosight.hpjx.hp.sc.domain.HPSC001
;
import
com.baosight.hpjx.hp.sc.domain.HPSC001
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
import
com.baosight.hpjx.hp.sc.domain.HPSC002
;
...
@@ -21,7 +23,6 @@ import com.baosight.iplat4j.core.util.NumberUtils;
...
@@ -21,7 +23,6 @@ import com.baosight.iplat4j.core.util.NumberUtils;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -406,6 +407,7 @@ public class HPSCTools {
...
@@ -406,6 +407,7 @@ public class HPSCTools {
queryMap
.
put
(
"matId"
,
matId
);
queryMap
.
put
(
"matId"
,
matId
);
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPSC003
.
DELETE_BY_MAT
,
queryMap
);
DaoBase
.
getInstance
().
update
(
HPSqlConstant
.
HPSC003
.
DELETE_BY_MAT
,
queryMap
);
}
}
/**
/**
* 修改状态
* 修改状态
*
*
...
@@ -421,6 +423,24 @@ public class HPSCTools {
...
@@ -421,6 +423,24 @@ public class HPSCTools {
}
}
/**
/**
* 生成二维码
*
* @param id
*/
public
static
void
createQrCode
(
Long
id
)
throws
Exception
{
AssertUtils
.
isNull
(
id
,
"节点ID不能为空"
);
// 生成二维码
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"id"
,
id
);
jsonObject
.
put
(
"remark"
,
"计划ID"
);
Map
<
String
,
Object
>
resultMap
=
QrCodeUtils
.
create
(
jsonObject
.
toJSONString
());
Map
map
=
new
HashMap
();
map
.
put
(
"id"
,
id
);
map
.
put
(
"qrcodeDocId"
,
resultMap
.
get
(
"docId"
));
DaoUtils
.
update
(
HPSqlConstant
.
HPSC003
.
UPDATE_QRCODE
,
map
);
}
/**
* 修改计划完成时间
* 修改计划完成时间
*
*
* @param planInfoNo
* @param planInfoNo
...
@@ -440,12 +460,12 @@ public class HPSCTools {
...
@@ -440,12 +460,12 @@ public class HPSCTools {
* @param planInfoNo
* @param planInfoNo
* @return
* @return
*/
*/
public
static
HPSC003
get
EntityByPlanInfo
No
(
String
planInfoNo
)
{
public
static
HPSC003
get
By
No
(
String
planInfoNo
)
{
AssertUtils
.
isNull
(
planInfoNo
,
"
生产订单
号不能为空"
);
AssertUtils
.
isNull
(
planInfoNo
,
"
计划
号不能为空"
);
Map
queryMap
=
new
HashMap
();
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"planInfoNo"
,
planInfoNo
);
queryMap
.
put
(
"planInfoNo"
,
planInfoNo
);
List
<
HPSC003
>
results
=
DaoBase
.
getInstance
().
query
(
HPSC003
.
QUERY
,
queryMap
);
List
<
HPSC003
>
results
=
DaoBase
.
getInstance
().
query
(
HPSC003
.
QUERY
,
queryMap
);
AssertUtils
.
isNull
(
results
,
String
.
format
(
"
生产订单
号[%s]信息不存在"
,
planInfoNo
));
AssertUtils
.
isNull
(
results
,
String
.
format
(
"
计划
号[%s]信息不存在"
,
planInfoNo
));
return
results
.
get
(
0
);
return
results
.
get
(
0
);
}
}
}
}
...
@@ -872,6 +892,21 @@ public class HPSCTools {
...
@@ -872,6 +892,21 @@ public class HPSCTools {
}
}
/**
/**
* 查询盘点单信息
*
* @param prodOrderNos
* @return
*/
public
static
List
<
HPSC005B
>
listByOrder
(
List
<
String
>
prodOrderNos
)
{
if
(
CollectionUtils
.
isEmpty
(
prodOrderNos
))
{
return
null
;
}
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
"prodOrderNos"
,
prodOrderNos
);
return
DaoBase
.
getInstance
().
query
(
HPSC005B
.
QUERY
,
queryMap
);
}
/**
* 查询信息
* 查询信息
*
*
* @param factoryCode
* @param factoryCode
...
...
src/main/java/com/baosight/hpjx/util/EiInfoUtils.java
View file @
6cbef9ad
package
com
.
baosight
.
hpjx
.
util
;
package
com
.
baosight
.
hpjx
.
util
;
import
com.baosight.iplat4j.core.BaseObject
;
import
com.baosight.iplat4j.core.BaseObject
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -107,4 +110,42 @@ public class EiInfoUtils {
...
@@ -107,4 +110,42 @@ public class EiInfoUtils {
rowMap
.
put
(
key
,
value
);
rowMap
.
put
(
key
,
value
);
}
}
/**
* eiinfo中新增block
*
* @param inInfo
* @param blockId
* @param row
* @param clazz
* @param <T>
* @throws InstantiationException
* @throws IllegalAccessException
*/
public
static
<
T
extends
DaoEPBase
>
void
addBlock
(
EiInfo
inInfo
,
String
blockId
,
T
row
,
Class
<
T
>
clazz
)
throws
InstantiationException
,
IllegalAccessException
{
EiBlock
block
=
new
EiBlock
(
blockId
);
block
.
addBlockMeta
(
clazz
.
newInstance
().
eiMetadata
);
block
.
addRow
(
row
);
inInfo
.
setBlock
(
block
);
}
/**
* eiinfo中新增block
*
* @param inInfo
* @param blockId
* @param rows
* @param clazz
* @param <T>
* @throws InstantiationException
* @throws IllegalAccessException
*/
public
static
<
T
extends
DaoEPBase
>
void
addBlock
(
EiInfo
inInfo
,
String
blockId
,
List
<
T
>
rows
,
Class
<
T
>
clazz
)
throws
InstantiationException
,
IllegalAccessException
{
EiBlock
block
=
new
EiBlock
(
blockId
);
block
.
addBlockMeta
(
clazz
.
newInstance
().
eiMetadata
);
block
.
addRows
(
rows
);
inInfo
.
setBlock
(
block
);
}
}
}
src/main/java/com/baosight/hpjx/util/ObjectUtils.java
View file @
6cbef9ad
package
com
.
baosight
.
hpjx
.
util
;
package
com
.
baosight
.
hpjx
.
util
;
import
com.baosight.iplat4j.core.data.DaoEPBase
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -119,4 +121,19 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
...
@@ -119,4 +121,19 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
/**
* 从DaoEPBase中取KEY
*
* @param items
* @param keyName
* @return
*/
public
static
<
T
>
List
<
T
>
listEpKey
(
Collection
<?
extends
DaoEPBase
>
items
,
String
keyName
)
{
if
(
CollectionUtils
.
isEmpty
(
items
))
{
return
null
;
}
return
items
.
stream
().
map
(
item
->
item
.
toMap
()).
map
(
item
->
(
T
)
item
.
get
(
keyName
))
.
filter
(
ObjectUtils:
:
isNotBlank
).
distinct
().
collect
(
Collectors
.
toList
());
}
}
}
src/main/resources/application.properties
View file @
6cbef9ad
...
@@ -19,7 +19,7 @@ spring.servlet.multipart.file-size-threshold =0
...
@@ -19,7 +19,7 @@ spring.servlet.multipart.file-size-threshold =0
componentEname
=
hpjx
componentEname
=
hpjx
projectName
=
hpjx
projectName
=
hpjx
moduleName
=
ep
moduleName
=
ep
projectEnv
=
run
projectEnv
=
dev
platSchema
=
iplat
platSchema
=
iplat
eplatSchema
=
EPLAT
eplatSchema
=
EPLAT
lowcodedbSchema
=
lowcodedb
lowcodedbSchema
=
lowcodedb
...
...
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