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
627a6294
Commit
627a6294
authored
Mar 23, 2022
by
yff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
反馈升级
parent
a6da8cca
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1114 additions
and
141 deletions
+1114
-141
GpfkController.java
.../main/java/com/gavel/kwell/controller/GpfkController.java
+7
-6
GpfkDao.java
gavel/src/main/java/com/gavel/kwell/dao/GpfkDao.java
+34
-1
GpfkDaoImpl.java
...l/src/main/java/com/gavel/kwell/dao/impl/GpfkDaoImpl.java
+410
-51
Gpfk.java
gavel/src/main/java/com/gavel/kwell/persistent/Gpfk.java
+1
-2
GpfkService.java
gavel/src/main/java/com/gavel/kwell/service/GpfkService.java
+7
-0
GpfkServiceImpl.java
...in/java/com/gavel/kwell/service/impl/GpfkServiceImpl.java
+577
-80
GpfkHgEnum.java
gavel/src/main/java/com/gavel/kwell/utils/GpfkHgEnum.java
+49
-0
GphyCondition.java
gavel/src/main/java/com/gavel/kwell/vo/GphyCondition.java
+14
-0
WlslItem.java
gavel/src/main/java/com/gavel/kwell/vo/WlslItem.java
+15
-1
No files found.
gavel/src/main/java/com/gavel/kwell/controller/GpfkController.java
View file @
627a6294
...
@@ -254,14 +254,15 @@ public class GpfkController extends BaseController {
...
@@ -254,14 +254,15 @@ public class GpfkController extends BaseController {
@RequestMapping
(
value
=
"/queryWoBomByWoid"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/queryWoBomByWoid"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
Object
getWoBomByWoid
(
@RequestBody
JSONObject
param
)
{
public
Object
getWoBomByWoid
(
@RequestBody
JSONObject
param
)
{
String
woid
=
param
.
getString
(
"woid"
);
//
String woid = param.getString("woid");
String
bzlx
=
param
.
getString
(
"bzlx"
);
String
bzlx
=
param
.
getString
(
"bzlx"
);
String
wosn
=
param
.
getString
(
"wosn"
);
String
wosn
=
param
.
getString
(
"wosn"
);
if
(
StringUtils
.
isEmpty
(
woid
)||
StringUtils
.
isEmpty
(
wosn
)){
if
(
StringUtils
.
isEmpty
(
bzlx
)||
StringUtils
.
isEmpty
(
wosn
)){
setReturnMessage
(
"条码不允许为空!"
);
setReturnMessage
(
"条码不允许为空!"
);
return
returnData
();
return
returnData
();
}
}
List
<
WobomVO
>
wobomVOs
=
gpfkService
.
queryWobomByWo
(
woid
,
bzlx
,
wosn
);
// List<WobomVO> wobomVOs= gpfkService.queryWobomByWo(woid,bzlx,wosn);
List
<
WobomVO
>
wobomVOs
=
gpfkService
.
queryWobomByWoUpgrade
(
wosn
,
bzlx
);
if
(
wobomVOs
!=
null
){
if
(
wobomVOs
!=
null
){
return
buildReturnData
(
wobomVOs
);
return
buildReturnData
(
wobomVOs
);
}
else
{
}
else
{
...
@@ -283,7 +284,7 @@ public class GpfkController extends BaseController {
...
@@ -283,7 +284,7 @@ public class GpfkController extends BaseController {
@ResponseBody
@ResponseBody
public
Object
query
(
@RequestBody
JSONObject
param
)
{
public
Object
query
(
@RequestBody
JSONObject
param
)
{
FkCondition
condition
=
JSONObject
.
toJavaObject
(
param
,
FkCondition
.
class
);
FkCondition
condition
=
JSONObject
.
toJavaObject
(
param
,
FkCondition
.
class
);
FkVO
gpfk
=
gpfkService
.
zpfk
(
condition
);
FkVO
gpfk
=
gpfkService
.
zpfk
Upgrade
(
condition
);
if
(
gpfk
!=
null
)
{
if
(
gpfk
!=
null
)
{
return
buildReturnData
(
gpfk
);
return
buildReturnData
(
gpfk
);
}
}
...
@@ -294,7 +295,7 @@ public class GpfkController extends BaseController {
...
@@ -294,7 +295,7 @@ public class GpfkController extends BaseController {
@ResponseBody
@ResponseBody
public
Object
jyfk
(
@RequestBody
JSONObject
param
)
{
public
Object
jyfk
(
@RequestBody
JSONObject
param
)
{
FkCondition
condition
=
JSONObject
.
toJavaObject
(
param
,
FkCondition
.
class
);
FkCondition
condition
=
JSONObject
.
toJavaObject
(
param
,
FkCondition
.
class
);
FkVO
gpfk
=
gpfkService
.
jyfk
(
condition
);
FkVO
gpfk
=
gpfkService
.
jyfk
Upgrade
(
condition
);
if
(
gpfk
!=
null
){
if
(
gpfk
!=
null
){
return
buildReturnData
(
gpfk
);
return
buildReturnData
(
gpfk
);
}
else
{
}
else
{
...
@@ -306,7 +307,7 @@ public class GpfkController extends BaseController {
...
@@ -306,7 +307,7 @@ public class GpfkController extends BaseController {
@ResponseBody
@ResponseBody
public
Object
wxfk
(
@RequestBody
JSONObject
param
)
{
public
Object
wxfk
(
@RequestBody
JSONObject
param
)
{
FkCondition
condition
=
JSONObject
.
toJavaObject
(
param
,
FkCondition
.
class
);
FkCondition
condition
=
JSONObject
.
toJavaObject
(
param
,
FkCondition
.
class
);
FkVO
gpfk
=
gpfkService
.
wxfk
(
condition
);
FkVO
gpfk
=
gpfkService
.
wxfk
Upgrade
(
condition
);
if
(
gpfk
!=
null
){
if
(
gpfk
!=
null
){
return
buildReturnData
(
gpfk
);
return
buildReturnData
(
gpfk
);
}
else
{
}
else
{
...
...
gavel/src/main/java/com/gavel/kwell/dao/GpfkDao.java
View file @
627a6294
...
@@ -20,6 +20,7 @@ import com.gavel.kwell.vo.GpfkCondition;
...
@@ -20,6 +20,7 @@ import com.gavel.kwell.vo.GpfkCondition;
import
com.gavel.kwell.vo.GpfkVO
;
import
com.gavel.kwell.vo.GpfkVO
;
import
com.gavel.kwell.vo.GphyCondition
;
import
com.gavel.kwell.vo.GphyCondition
;
import
com.gavel.kwell.vo.GpwxmxVO
;
import
com.gavel.kwell.vo.GpwxmxVO
;
import
com.gavel.kwell.vo.WlslItem
;
import
com.gavel.kwell.vo.WolinkInfoVO
;
import
com.gavel.kwell.vo.WolinkInfoVO
;
import
com.gavel.kwell.vo.WosngzVO
;
import
com.gavel.kwell.vo.WosngzVO
;
import
com.gavel.persistence.sql.RecordSet
;
import
com.gavel.persistence.sql.RecordSet
;
...
@@ -129,7 +130,6 @@ public interface GpfkDao extends BaseDao {
...
@@ -129,7 +130,6 @@ public interface GpfkDao extends BaseDao {
public
List
<
Gphy
>
queryGphyByGpfkid
(
String
mid
);
public
List
<
Gphy
>
queryGphyByGpfkid
(
String
mid
);
public
Wogylx
getLastGx
(
Wogylx
wogylx
);
public
double
getNowGyFksl
(
Wogylx
wogylx
);
public
double
getNowGyFksl
(
Wogylx
wogylx
);
...
@@ -140,4 +140,37 @@ public interface GpfkDao extends BaseDao {
...
@@ -140,4 +140,37 @@ public interface GpfkDao extends BaseDao {
public
double
checkIfContainsWobomWl
(
FkCondition
fkCondition
);
public
double
checkIfContainsWobomWl
(
FkCondition
fkCondition
);
public
double
checkIfContainsGphywl
(
GphyCondition
condition
);
public
double
checkIfContainsGphywl
(
GphyCondition
condition
);
/**科威尔工票反馈sql */
/** ------------BEGIN工票反馈升级-----------------***/
/**获取该序列号标准工序最新的反馈相关信息 */
public
FkVO
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
String
wosnid
,
String
bzgxid
);
/**获取该序列号标准工序所有的反馈相关信息 */
public
List
<
FkVO
>
queryWowithIfExistGpfkByWosnAndBzgxid
(
String
wosnid
,
String
bzgxid
);
/**获取该序列号标准工序的订单相关信息包含最新反馈记录 */
public
FkVO
queryKwellWoBySnidUptoDate
(
String
wosnid
,
String
bzgx
);
/**获取该序列号标准工序的订单相关信息包含最新反馈记录 */
public
List
<
FkVO
>
queryKwellAllGpfkByWosnAndGxid
(
FkCondition
condition
);
/**查询当前订单序列号最新反馈记录 */
public
GpfkVO
queryGpfkByWosnUptoDate
(
String
wosnid
);
/**查询当前工序下一道工序*/
public
Wogylx
getNextGxUpdate
(
Wogylx
wogylx
);
/**查询当前工序上一道工序 */
public
Wogylx
getLastGx
(
Wogylx
wogylx
);
/**查询当前工序上一道工序 */
public
double
queryIfZpwc
(
String
wosnid
,
String
bzgx
);
/**查询当前工序上一道工序 */
public
List
<
WobomVO
>
queryWobomByWosnAndBzgx
(
String
wosnid
,
String
bzgx
);
/**查询是否耗用了该物料编码 */
public
double
checkIfContainsGphywlUpgrade
(
GphyCondition
condition
);
/**查询是物料编码装配数量 */
public
WlslItem
queryKwellZpslGphy
(
GphyCondition
condition
);
/**查询是物料编码装配单位数量 */
public
double
queryWobomZpslByDjidAndWlidUpgrade
(
String
wosncode
,
String
bzgxid
,
String
wlid
);
/**查询当前订单序列号最新检验反馈记录 */
public
GpfkVO
queryJyGpfkByWosnUptoDate
(
String
wosnid
);
/** ------------END工票反馈升级-----------------***/
}
}
gavel/src/main/java/com/gavel/kwell/dao/impl/GpfkDaoImpl.java
View file @
627a6294
...
@@ -28,6 +28,7 @@ import com.gavel.kwell.vo.GpfkCondition;
...
@@ -28,6 +28,7 @@ import com.gavel.kwell.vo.GpfkCondition;
import
com.gavel.kwell.vo.GpfkVO
;
import
com.gavel.kwell.vo.GpfkVO
;
import
com.gavel.kwell.vo.GphyCondition
;
import
com.gavel.kwell.vo.GphyCondition
;
import
com.gavel.kwell.vo.GpwxmxVO
;
import
com.gavel.kwell.vo.GpwxmxVO
;
import
com.gavel.kwell.vo.WlslItem
;
import
com.gavel.kwell.vo.WosngzVO
;
import
com.gavel.kwell.vo.WosngzVO
;
import
com.gavel.persistence.sql.RecordSet
;
import
com.gavel.persistence.sql.RecordSet
;
import
com.gavel.persistence.sql.SqlMap
;
import
com.gavel.persistence.sql.SqlMap
;
...
@@ -899,24 +900,38 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
...
@@ -899,24 +900,38 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
return
sqlMap
.
getRecordSet
();
return
sqlMap
.
getRecordSet
();
}
}
@Override
@Override
public
GpfkVO
queryDailyFkInfo
(
GpfkCondition
condition
){
public
GpfkVO
queryDailyFkInfo
(
GpfkCondition
condition
){
SqlMap
sqlMap
=
new
SqlMap
();
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select sum(c.GPFK_FKSL) as GPFK_FKSL, sum(c.GPFK_BHGSL) as GPFK_BHGSL "
);
sqlMap
.
append
(
" select sum(c.GPFK_FKSL) as GPFK_FKSL, sum(c.GPFK_BHGSL) as GPFK_BHGSL "
);
sqlMap
.
append
(
"from GPFK c "
);
sqlMap
.
append
(
" from GPFK c "
);
sqlMap
.
append
(
"left join WOGYLX ON WOGYLX_ID = GPFK_FKGX "
);
sqlMap
.
append
(
" left join WOGYLX w ON w.WOGYLX_ID = c.GPFK_FKGX "
);
sqlMap
.
append
(
"left join BZGX ON BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
" left join BZGX bb ON bb.BZGX_ID = w.WOGYLX_BZGXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
sqlMap
.
append
(
" where 1 = 1"
);
sqlMap
.
append
(
" and EXISTS (select a.fkid FROM (select ISNULL(count(1),0) as sl,GPHY_MID as fkid "
);
sqlMap
.
append
(
" and exists("
);
sqlMap
.
append
(
" from GPHY group by GPHY_MID) b left join ( select ISNULL(sum(wobom_dwyl),0) as sl ,GPFK_ID as fkid "
);
sqlMap
.
append
(
" select a.sncode,a.bzgxid from ( "
);
sqlMap
.
append
(
" from GPFK left join WOBOM on WOBOM_FFGX =GPFK_fkgx "
);
sqlMap
.
append
(
" select sum(IFNULL(wobom_dwyl,0)) as dwsl,wosn_code as sncode,bzgx_id as bzgxid "
);
sqlMap
.
append
(
" left join WLXX on WLXX_ID = WOBOM_WLID "
);
sqlMap
.
append
(
" from wosn "
);
sqlMap
.
append
(
" left join WO on WO_ID = WOBOM_WOID "
);
sqlMap
.
append
(
" left join wo on wo_id =wosn_woid "
);
sqlMap
.
append
(
" left join WOSN on WOSN_WOID = WO_ID and WOSN_CODE =GPFK_WOSNID "
);
sqlMap
.
append
(
" left join wobom on wobom_woid = wo_id "
);
sqlMap
.
append
(
" GROUP BY GPFK_ID ) a on a.fkid =b.fkid "
);
sqlMap
.
append
(
" left join wogylx on wogylx_id = wobom_ffgx "
);
sqlMap
.
append
(
" where 1 = 1 and a.sl<b.sl and c.GPFK_ID = a.fkid ) "
);
sqlMap
.
append
(
" left join bzgx on bzgx_id = wogylx_bzgxid "
);
sqlMap
.
append
(
" group by wosn_code,bzgx_id) a "
);
sqlMap
.
append
(
" left join ("
);
sqlMap
.
append
(
" select IFNULL(count(1),0) as sl,GPFK_WOSNID as gwosn,bzgx_id as gbzgxid "
);
sqlMap
.
append
(
" from GPHY "
);
sqlMap
.
append
(
" left join GPFK on GPFK_ID = GPHY_MID "
);
sqlMap
.
append
(
" left join wogylx on wogylx_id = GPFK_fkgx "
);
sqlMap
.
append
(
" left join bzgx on bzgx_id = wogylx_bzgxid "
);
sqlMap
.
append
(
" GROUP BY GPFK_WOSNID,bzgx_id) b "
);
sqlMap
.
append
(
" on a.sncode = b.gwosn and a.bzgxid = b.gbzgxid "
);
sqlMap
.
append
(
" where 1 = 1"
);
sqlMap
.
append
(
" and a.dwsl<= b.sl and c.GPFK_WOSNID =a.sncode and bb.BZGX_ID = a.bzgxid ) "
);
if
(
StringUtils
.
isNotEmpty
(
condition
.
getGxid
())){
if
(
StringUtils
.
isNotEmpty
(
condition
.
getGxid
())){
sqlMap
.
append
(
" and BZGX_ID = :pFKGX "
);
sqlMap
.
append
(
" and
bb.
BZGX_ID = :pFKGX "
);
sqlMap
.
setParamValue
(
"pFKGX"
,
condition
.
getGxid
());
sqlMap
.
setParamValue
(
"pFKGX"
,
condition
.
getGxid
());
}
}
if
(
StringUtils
.
isNotEmpty
(
condition
.
getBxid
())){
if
(
StringUtils
.
isNotEmpty
(
condition
.
getBxid
())){
...
@@ -928,17 +943,9 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
...
@@ -928,17 +943,9 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap
.
setParamValue
(
"pFKRID"
,
condition
.
getFkrid
());
sqlMap
.
setParamValue
(
"pFKRID"
,
condition
.
getFkrid
());
}
}
if
(
condition
.
getYwrq
()
!=
null
)
{
if
(
condition
.
getYwrq
()
!=
null
)
{
sqlMap
.
append
(
" and c.GPFK_YWRQ = :pYWRQ "
);
sqlMap
.
append
(
" and c.GPFK_YWRQ
>
= :pYWRQ "
);
sqlMap
.
setParamValue
(
"pYWRQ"
,
condition
.
getYwrq
());
sqlMap
.
setParamValue
(
"pYWRQ"
,
condition
.
getYwrq
());
}
}
// if (condition.getStart() != null) {
// sqlMap.append(" and GPFK_FKSJ >= :pFKSJS ");
// sqlMap.setParamValue("pFKSJS", DateUtils.beginOfDay(condition.getStart()));
// }
// if (condition.getEnd() != null) {
// sqlMap.append(" and GPFK_FKSJ <= :pFKSJE ");
// sqlMap.setParamValue("pFKSJE", DateUtils.endOfDay(condition.getEnd()));
// }
return
sqlMap
.
queryEntity
(
GpfkVO
.
class
);
return
sqlMap
.
queryEntity
(
GpfkVO
.
class
);
}
}
...
@@ -1241,9 +1248,11 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
...
@@ -1241,9 +1248,11 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
sqlMap
.
append
(
" and WOSN_CODE = :pSNID "
);
sqlMap
.
append
(
" and WOSN_CODE = :pSNID "
);
sqlMap
.
setParamValue
(
"pSNID"
,
snid
);
sqlMap
.
setParamValue
(
"pSNID"
,
snid
);
sqlMap
.
append
(
" and BZGX_ID = :pBZGXID "
);
sqlMap
.
append
(
" and BZGX_ID = :pBZGXID "
);
sqlMap
.
setParamValue
(
"
pBZGXID
"
,
bzgx
);
sqlMap
.
setParamValue
(
"
pBZGXID
"
,
bzgx
);
return
sqlMap
.
queryEntity
(
FkVO
.
class
);
return
sqlMap
.
queryEntity
(
FkVO
.
class
);
}
}
@Override
@Override
...
@@ -1263,33 +1272,6 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
...
@@ -1263,33 +1272,6 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
}
}
@Override
public
Wogylx
getLastGx
(
Wogylx
wogylx
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select top 1 WOGYLX_ID, WOGYLX_WOID, WOGYLX_XH, WOGYLX_BZGXID, WOGYLX_GYLXID, "
);
sqlMap
.
append
(
" WOGYLX_NAME, WOGYLX_GXLX, WOGYLX_GZZXID, WOGYLX_SBSL, WOGYLX_ZYRSL, "
);
sqlMap
.
append
(
" WOGYLX_PDHS, WOGYLX_ZBHS, WOGYLX_JGHS, WOGYLX_ZYHS, WOGYLX_GJGX, "
);
sqlMap
.
append
(
" WOGYLX_DWSJCL, WOGYLX_PCBS, WOGYLX_XQSL, WOGYLX_BZ, WOGYLX_CJRID, "
);
sqlMap
.
append
(
" WOGYLX_CJR, WOGYLX_CJSJ, WOGYLX_WHRID, WOGYLX_WHR, WOGYLX_WHSJ, "
);
sqlMap
.
append
(
" WOGYLX_SYSVERSION, GZZX_NAME, WOGYLX_GXBZ "
);
sqlMap
.
append
(
"from WOGYLX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
" left join GZZX on GZZX_ID = BZGX_GZZXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
sqlMap
.
append
(
" and isnull(WOGYLX_XH,0) <> 0 "
);
if
(
StringUtils
.
isNotEmpty
(
wogylx
.
getGzzxid
())){
sqlMap
.
append
(
" and BZGX_GZZXID = :pGZZXID "
);
sqlMap
.
setParamValue
(
"pGZZXID"
,
wogylx
.
getGzzxid
());
}
if
(
StringUtils
.
isNotEmpty
(
wogylx
.
getWoid
())){
sqlMap
.
append
(
" and WOGYLX_WOID = :pWOID "
);
sqlMap
.
setParamValue
(
"pWOID"
,
wogylx
.
getWoid
());
}
sqlMap
.
append
(
" and WOGYLX_XH < :pXH "
);
sqlMap
.
append
(
"order by WOGYLX_XH desc"
);
sqlMap
.
setParamValue
(
"pXH"
,
wogylx
.
getXh
());
return
sqlMap
.
queryEntity
(
Wogylx
.
class
);
}
@Override
@Override
...
@@ -1404,5 +1386,382 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
...
@@ -1404,5 +1386,382 @@ public class GpfkDaoImpl extends BaseDaoImpl implements GpfkDao {
return
sqlMap
.
queryDouble
();
return
sqlMap
.
queryDouble
();
}
}
@Override
public
FkVO
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
String
wosnid
,
String
bzgxid
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select top 1 GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, "
);
sqlMap
.
append
(
" GPFK_WHRID, GPFK_WHR, GPFK_WHSJ, GPFK_CJRID, GPFK_CJR, "
);
sqlMap
.
append
(
" GPFK_CJSJ, GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ,WOGYLX_ID, "
);
sqlMap
.
append
(
" BX_CODE, BX_NAME, BZGX_CODE, BZGX_NAME,WLXX_ID, "
);
sqlMap
.
append
(
" WLXX_CODE, WLXX_NAME, WLXX_GG,WOSN_CODE,WO_DJID,WO_ID, "
);
sqlMap
.
append
(
" GPFK_GFSL, GPFK_LFSL, GPFK_FXSL, GPFK_FGSL, GPFK_YWRQ, GPFK_HGDJ, WOSN_KHCODE"
);
sqlMap
.
append
(
"from GPFK "
);
sqlMap
.
append
(
" left join BX on BX_ID = GPFK_FKBX "
);
sqlMap
.
append
(
" left join WOSN on WOSN_CODE = GPFK_WOSNID "
);
sqlMap
.
append
(
" left join WO on WO_ID = WOSN_WOID "
);
sqlMap
.
append
(
" left join WLXX on WLXX_ID = WO_WLID "
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_ID = GPFK_FKGX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
if
(
StringUtils
.
isNotEmpty
(
bzgxid
)){
sqlMap
.
append
(
" and BZGX_ID = :pBZGXID "
);
sqlMap
.
setParamValue
(
"pBZGXID"
,
bzgxid
);
}
if
(
StringUtils
.
isNotEmpty
(
wosnid
)){
sqlMap
.
append
(
"and GPFK_WOSNID like :pWOSNID "
);
sqlMap
.
setParamValueLike
(
"pWOSNID"
,
wosnid
);
}
sqlMap
.
append
(
"order by GPFK_FKSJ desc "
);
return
sqlMap
.
queryEntity
(
FkVO
.
class
);
}
@Override
public
List
<
FkVO
>
queryWowithIfExistGpfkByWosnAndBzgxid
(
String
wosnid
,
String
bzgxid
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, "
);
sqlMap
.
append
(
" GPFK_WHRID, GPFK_WHR, GPFK_WHSJ, GPFK_CJRID, GPFK_CJR, "
);
sqlMap
.
append
(
" GPFK_CJSJ, GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ,WOGYLX_ID, "
);
sqlMap
.
append
(
" BX_CODE, BX_NAME, BZGX_CODE, BZGX_NAME,WLXX_ID, "
);
sqlMap
.
append
(
" WLXX_CODE, WLXX_NAME, WLXX_GG,WOSN_CODE,WO_DJID,WO_ID, "
);
sqlMap
.
append
(
" GPFK_GFSL, GPFK_LFSL, GPFK_FXSL, GPFK_FGSL, GPFK_YWRQ, GPFK_HGDJ, WOSN_KHCODE "
);
sqlMap
.
append
(
" from GPFK "
);
sqlMap
.
append
(
" left join BX on BX_ID = GPFK_FKBX "
);
sqlMap
.
append
(
" left join WOSN on WOSN_CODE = GPFK_WOSNID "
);
sqlMap
.
append
(
" left join WO on WO_ID = WOSN_WOID "
);
sqlMap
.
append
(
" left join WLXX on WLXX_ID = WO_WLID "
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_ID = GPFK_FKGX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
if
(
StringUtils
.
isNotEmpty
(
bzgxid
)){
sqlMap
.
append
(
" and BZGX_ID = :pBZGXID "
);
sqlMap
.
setParamValue
(
"pBZGXID"
,
bzgxid
);
}
if
(
StringUtils
.
isNotEmpty
(
wosnid
)){
sqlMap
.
append
(
"and GPFK_WOSNID like :pWOSNID "
);
sqlMap
.
setParamValueLike
(
"pWOSNID"
,
wosnid
);
}
sqlMap
.
append
(
"order by GPFK_FKSJ desc "
);
return
sqlMap
.
query
(
FkVO
.
class
);
}
@Override
public
FkVO
queryKwellWoBySnidUptoDate
(
String
wosnid
,
String
bzgx
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select top 1 WO_ID,BZGX_CODE,WO_ZT,WLXX_CODE,WLXX_GG,WLXX_ID,WOSN_CODE,WOSN_ID,BZGX_ID,WOGYLX_ID,"
);
sqlMap
.
append
(
" BZGX_NAME,WLXX_GG,WO_DJID,BZGX_GXLX,WOSN_CODE,GPFK_ID "
);
sqlMap
.
append
(
"from WOSN "
);
sqlMap
.
append
(
" left join WO on WO_ID=WOSN_WOID"
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_WOID =WO_ID"
);
sqlMap
.
append
(
" left join GYLX on GYLX_ID = WOGYLX_GYLXID"
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID =GYLX_BZGXID"
);
sqlMap
.
append
(
" left join WLXX on wlxx_id = wo_wlid"
);
sqlMap
.
append
(
" left join GPFK on GPFK_WOSNID = WOSN_CODE and GPFK_FKGX=WOGYLX_ID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
sqlMap
.
append
(
" and WOSN_CODE = :pSNID "
);
sqlMap
.
setParamValue
(
"pSNID"
,
wosnid
);
sqlMap
.
append
(
" and BZGX_ID = :pBZGXID "
);
sqlMap
.
setParamValue
(
"pBZGXID"
,
bzgx
);
sqlMap
.
append
(
" order by GPFK_FKSJ DESC "
);
return
sqlMap
.
queryEntity
(
FkVO
.
class
);
}
@Override
public
List
<
FkVO
>
queryKwellAllGpfkByWosnAndGxid
(
FkCondition
condition
){
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, "
);
sqlMap
.
append
(
" GPFK_WHRID, GPFK_WHR, GPFK_WHSJ, GPFK_CJRID, GPFK_CJR, "
);
sqlMap
.
append
(
" GPFK_CJSJ, GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ,WOGYLX_ID, "
);
sqlMap
.
append
(
" BX_CODE, BX_NAME, BZGX_CODE, BZGX_NAME,WLXX_ID, "
);
sqlMap
.
append
(
" WLXX_CODE, WLXX_NAME, WLXX_GG,WOSN_CODE,WO_DJID,WO_ID, "
);
sqlMap
.
append
(
" GPFK_GFSL, GPFK_LFSL, GPFK_FXSL, GPFK_FGSL, GPFK_YWRQ, GPFK_HGDJ, WOSN_KHCODE"
);
sqlMap
.
append
(
"from GPFK "
);
sqlMap
.
append
(
" left join BX on BX_ID = GPFK_FKBX "
);
sqlMap
.
append
(
" left join WOSN on WOSN_CODE = GPFK_WOSNID "
);
sqlMap
.
append
(
" left join WO on WO_ID = WOSN_WOID "
);
sqlMap
.
append
(
" left join WLXX on WLXX_ID = WO_WLID "
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_ID = GPFK_FKGX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
if
(
StringUtils
.
isNotEmpty
(
condition
.
getBzgxid
())){
sqlMap
.
append
(
" and BZGX_ID = :pBZGXID "
);
sqlMap
.
setParamValue
(
"pBZGXID"
,
condition
.
getBzgxid
());
}
if
(
StringUtils
.
isNotEmpty
(
condition
.
getWogylx
())){
sqlMap
.
append
(
" and WOGYLX_ID = :pWOGYLX "
);
sqlMap
.
setParamValue
(
"pWOGYLX"
,
condition
.
getWogylx
());
}
if
(
StringUtils
.
isNotEmpty
(
condition
.
getWosncode
())){
sqlMap
.
append
(
"and GPFK_WOSNID like :pWOSNID "
);
sqlMap
.
setParamValueLike
(
"pWOSNID"
,
condition
.
getWosncode
());
}
sqlMap
.
append
(
"order by GPFK_FKSJ desc, GPFK_FKGX "
);
return
sqlMap
.
query
(
FkVO
.
class
);
}
@Override
public
GpfkVO
queryGpfkByWosnUptoDate
(
String
wosnid
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select top 1 GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, "
);
sqlMap
.
append
(
" GPFK_WHRID, GPFK_WHR, GPFK_WHSJ, GPFK_CJRID, GPFK_CJR, "
);
sqlMap
.
append
(
" GPFK_CJSJ, GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ,WOGYLX_ID, "
);
sqlMap
.
append
(
" BX_CODE, BX_NAME, BZGX_CODE, BZGX_NAME,WLXX_ID, "
);
sqlMap
.
append
(
" WLXX_CODE, WLXX_NAME, WLXX_GG,WOSN_CODE,WO_DJID,WO_ID, "
);
sqlMap
.
append
(
" GPFK_GFSL, GPFK_LFSL, GPFK_FXSL, GPFK_FGSL, GPFK_YWRQ, GPFK_HGDJ, WOSN_KHCODE"
);
sqlMap
.
append
(
"from GPFK "
);
sqlMap
.
append
(
" left join BX on BX_ID = GPFK_FKBX "
);
sqlMap
.
append
(
" left join WOSN on WOSN_CODE = GPFK_WOSNID "
);
sqlMap
.
append
(
" left join WO on WO_ID = WOSN_WOID "
);
sqlMap
.
append
(
" left join WLXX on WLXX_ID = WO_WLID "
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_ID = GPFK_FKGX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
if
(
StringUtils
.
isNotEmpty
(
wosnid
)){
sqlMap
.
append
(
"and GPFK_WOSNID like :pWOSNID "
);
sqlMap
.
setParamValueLike
(
"pWOSNID"
,
wosnid
);
}
sqlMap
.
append
(
"order by GPFK_FKSJ desc, GPFK_FKGX "
);
return
sqlMap
.
queryEntity
(
GpfkVO
.
class
);
}
@Override
public
Wogylx
getLastGx
(
Wogylx
wogylx
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select top 1 WOGYLX_ID, WOGYLX_WOID, WOGYLX_XH, WOGYLX_BZGXID, WOGYLX_GYLXID, "
);
sqlMap
.
append
(
" WOGYLX_NAME, WOGYLX_GXLX, WOGYLX_GZZXID, WOGYLX_SBSL, WOGYLX_ZYRSL, "
);
sqlMap
.
append
(
" WOGYLX_PDHS, WOGYLX_ZBHS, WOGYLX_JGHS, WOGYLX_ZYHS, WOGYLX_GJGX, "
);
sqlMap
.
append
(
" WOGYLX_DWSJCL, WOGYLX_PCBS, WOGYLX_XQSL, WOGYLX_BZ, WOGYLX_CJRID, "
);
sqlMap
.
append
(
" WOGYLX_CJR, WOGYLX_CJSJ, WOGYLX_WHRID, WOGYLX_WHR, WOGYLX_WHSJ, "
);
sqlMap
.
append
(
" WOGYLX_SYSVERSION, GZZX_NAME, WOGYLX_GXBZ "
);
sqlMap
.
append
(
"from WOGYLX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
" left join GZZX on GZZX_ID = BZGX_GZZXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
sqlMap
.
append
(
" and isnull(WOGYLX_XH,0) <> 0 "
);
if
(
StringUtils
.
isNotEmpty
(
wogylx
.
getGzzxid
())){
sqlMap
.
append
(
" and BZGX_GZZXID = :pGZZXID "
);
sqlMap
.
setParamValue
(
"pGZZXID"
,
wogylx
.
getGzzxid
());
}
if
(
StringUtils
.
isNotEmpty
(
wogylx
.
getWoid
())){
sqlMap
.
append
(
" and WOGYLX_WOID = :pWOID "
);
sqlMap
.
setParamValue
(
"pWOID"
,
wogylx
.
getWoid
());
}
sqlMap
.
append
(
" and WOGYLX_XH < :pXH "
);
sqlMap
.
append
(
"order by WOGYLX_XH desc"
);
sqlMap
.
setParamValue
(
"pXH"
,
wogylx
.
getXh
());
return
sqlMap
.
queryEntity
(
Wogylx
.
class
);
}
@Override
public
Wogylx
getNextGxUpdate
(
Wogylx
wogylx
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select top 1 WOGYLX_ID, WOGYLX_WOID, WOGYLX_XH, WOGYLX_BZGXID, WOGYLX_GYLXID, "
);
sqlMap
.
append
(
" WOGYLX_NAME, WOGYLX_GXLX, WOGYLX_GZZXID, WOGYLX_SBSL, WOGYLX_ZYRSL, "
);
sqlMap
.
append
(
" WOGYLX_PDHS, WOGYLX_ZBHS, WOGYLX_JGHS, WOGYLX_ZYHS, WOGYLX_GJGX, "
);
sqlMap
.
append
(
" WOGYLX_DWSJCL, WOGYLX_PCBS, WOGYLX_XQSL, WOGYLX_BZ, WOGYLX_CJRID, "
);
sqlMap
.
append
(
" WOGYLX_CJR, WOGYLX_CJSJ, WOGYLX_WHRID, WOGYLX_WHR, WOGYLX_WHSJ, "
);
sqlMap
.
append
(
" WOGYLX_SYSVERSION, GZZX_NAME, WOGYLX_GXBZ "
);
sqlMap
.
append
(
"from WOGYLX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
" left join GZZX on GZZX_ID = BZGX_GZZXID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
sqlMap
.
append
(
" and isnull(WOGYLX_XH,0) <> 0 "
);
if
(
StringUtils
.
isNotEmpty
(
wogylx
.
getGzzxid
())){
sqlMap
.
append
(
" and BZGX_GZZXID = :pGZZXID "
);
sqlMap
.
setParamValue
(
"pGZZXID"
,
wogylx
.
getGzzxid
());
}
if
(
StringUtils
.
isNotEmpty
(
wogylx
.
getWoid
())){
sqlMap
.
append
(
" and WOGYLX_WOID = :pWOID "
);
sqlMap
.
setParamValue
(
"pWOID"
,
wogylx
.
getWoid
());
}
sqlMap
.
append
(
" and WOGYLX_XH > :pXH "
);
sqlMap
.
append
(
"order by WOGYLX_XH desc"
);
sqlMap
.
setParamValue
(
"pXH"
,
wogylx
.
getXh
());
return
sqlMap
.
queryEntity
(
Wogylx
.
class
);
}
@Override
public
double
queryIfZpwc
(
String
wosnid
,
String
bzgx
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select e.sl-a.hysl from ( "
);
sqlMap
.
append
(
" select sum(ISNULL(dwb.WOBOM_dwyl,0)) as sl,d.GPFK_WOSNID as dwosn,db.BZGX_ID AS dbzgx "
);
sqlMap
.
append
(
" from GPFK d "
);
sqlMap
.
append
(
" left join WOSN dwo on dwo.WOSN_CODE =GPFK_WOSNID "
);
sqlMap
.
append
(
" LEFT JOIN WO dw ON dw.WO_ID = dwo.WOSN_WOID "
);
sqlMap
.
append
(
" LEFT JOIN WOBOM dwb ON dwb.WOBOM_woid = dw.WO_ID and dwb.WOBOM_FFGX = d.gpfk_fkgx "
);
sqlMap
.
append
(
" LEFT JOIN WOGYLX dwg ON dwg.WOGYLX_ID = d.GPFK_FKGX "
);
sqlMap
.
append
(
" LEFT JOIN BZGX db ON db.BZGX_ID = dwg.WOGYLX_BZGXID "
);
sqlMap
.
append
(
" GROUP BY d.GPFK_WOSNID,db.BZGX_ID "
);
sqlMap
.
append
(
" ) e "
);
sqlMap
.
append
(
" LEFT JOIN ( "
);
sqlMap
.
append
(
" SELECT c.GPFK_WOSNID as cwosn,cb.BZGX_ID as cbzgx,COUNT(1) as hysl FROM GPHY "
);
sqlMap
.
append
(
" LEFT JOIN GPFK c on c.GPFK_ID = GPHY_MID "
);
sqlMap
.
append
(
" Left JOIN WOGYLX cw ON cw.WOGYLX_ID = c.GPFK_FKGX "
);
sqlMap
.
append
(
" LEFT JOIN BZGX cb ON cb.BZGX_ID = cw.WOGYLX_BZGXID "
);
sqlMap
.
append
(
" GROUP BY c.GPFK_WOSNID,cb.BZGX_ID "
);
sqlMap
.
append
(
" ) a ON a.cwosn = e.dwosn and a.cbzgx = e.dbzgx "
);
sqlMap
.
append
(
" where 1=1 "
);
if
(
StringUtils
.
isNotEmpty
(
wosnid
)){
sqlMap
.
append
(
"and a.cwosn = '"
+
wosnid
+
"'"
);
}
if
(
StringUtils
.
isNotEmpty
(
bzgx
)){
sqlMap
.
append
(
"and a.cbzgx = '"
+
bzgx
+
"'"
);
}
return
sqlMap
.
queryInt
();
}
@Override
public
List
<
WobomVO
>
queryWobomByWosnAndBzgx
(
String
wosnid
,
String
bzgx
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select WOBOM_ID, WOBOM_XH, WOBOM_WOID, WOBOM_WLID, WOBOM_FFGX,"
);
sqlMap
.
append
(
" WOBOM_DWYL, WOBOM_XQSL, WOBOM_XQRQ, WOBOM_SHL, WOBOM_SHZ, WOBOM_FFYZ,"
);
sqlMap
.
append
(
" WOBOM_LLSL, WOBOM_CKSL, WOBOM_BZ, WOBOM_WHRID, WOBOM_WHR,"
);
sqlMap
.
append
(
" WOBOM_WHSJ, WOBOM_CJRID, WOBOM_CJR, WOBOM_CJSJ, WOBOM_SYSVERSION,"
);
sqlMap
.
append
(
" WLXX_CODE, WLXX_NAME, WLXX_GG, WOBOM_GJWL, WOBOM_ZT, WOBOM_DJLY,k.ZPSL as ZPSL,"
);
sqlMap
.
append
(
" WOGYLX_XH, WOGYLX_NAME, WOBOM_WLPH "
);
sqlMap
.
append
(
"from WOBOM"
);
sqlMap
.
append
(
" left join WLXX on WLXX_ID = WOBOM_WLID"
);
sqlMap
.
append
(
" left join WO on WO_ID = WOBOM_WOID"
);
sqlMap
.
append
(
" left join WOSN on WOSN_WOID = WO_ID"
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_ID = WOBOM_FFGX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
" left join GPFK on GPFK_WOSNID = WOSN_CODE and GPFK_FKGX= WOGYLX_ID and GPFK_WOGYLX =WOGYLX_ID "
);
sqlMap
.
append
(
" left join (select sum(GPHY_ZPSL) as ZPSL,GPFK_WOSNID,GPHY_WLID,GPHY_FKGX "
);
sqlMap
.
append
(
" from GPHY "
);
sqlMap
.
append
(
" left join GPFK ON GPFK_ID =GPHY_MID "
);
sqlMap
.
append
(
" group by GPFK_WOSNID,GPHY_WLID "
);
sqlMap
.
append
(
" ) k on k.GPHY_FKGX=WOBOM_FFGX and k.GPFK_WOSNID = WOSN_CODE and k.GPHY_WLID = WLXX_ID"
);
sqlMap
.
append
(
"where 1=1"
);
if
(
StringUtils
.
isNotEmpty
(
bzgx
)){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"BZGX_ID"
,
bzgx
));
sqlMap
.
setParamValue
(
"BZGX_ID"
,
bzgx
);
}
if
(
StringUtils
.
isNotEmpty
(
wosnid
)){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"WOSN_CODE"
,
wosnid
));
sqlMap
.
setParamValue
(
"WOSN_CODE"
,
wosnid
);
}
sqlMap
.
append
(
"order by WOBOM_XH, WLXX_CODE"
);
System
.
out
.
println
(
sqlMap
.
getSqlText
());
return
sqlMap
.
query
(
WobomVO
.
class
);
}
public
double
checkIfContainsGphywlUpgrade
(
GphyCondition
condition
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select count(1),GPFK_WOSNID,BZGX_ID "
);
sqlMap
.
append
(
" from GPHY "
);
sqlMap
.
append
(
" LEFT JOIN GPFK ON GPFK_ID = GPHY_MID "
);
sqlMap
.
append
(
" LEFT JOIN WOGYLX ON WOGYLX_ID =GPFK_FKGX "
);
sqlMap
.
append
(
" LEFT JOIN BZGX ON BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
" LEFT JOIN WLXX ON WLXX_ID = GPHY_WLID "
);
sqlMap
.
append
(
" where 1 = 1 "
);
if
(
StringUtils
.
isNotEmpty
(
condition
.
getSnid
())){
sqlMap
.
append
(
" and (GPHY_WLSNID like :pSnid or WLXX_CODE like :pSnid or WLXX_NAME like :pSnid) "
);
sqlMap
.
setParamValueLike
(
"pSnid"
,
condition
.
getSnid
());
}
if
(
StringUtils
.
isNotEmpty
(
condition
.
getWosncode
())){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"GPFK_WOSNID"
,
condition
.
getWosncode
()));
sqlMap
.
setParamValue
(
"GPFK_WOSNID"
,
condition
.
getMid
());
}
if
(
StringUtils
.
isNotEmpty
(
condition
.
getBzgxid
())){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"BZGX_ID"
,
condition
.
getWosncode
()));
sqlMap
.
setParamValue
(
"BZGX_ID"
,
condition
.
getMid
());
}
sqlMap
.
append
(
" GROUP BY GPFK_WOSNID,BZGX_ID "
);
return
sqlMap
.
queryDouble
();
}
@Override
public
WlslItem
queryKwellZpslGphy
(
GphyCondition
condition
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select sum(GPHY_ZPSL) as zpsl, GPHY_WLID as wlid,GPFK_WOSNID as wosncode,BZGX_ID as bzgxid "
);
sqlMap
.
append
(
"from GPHY "
);
sqlMap
.
append
(
" LEFT JOIN GPFK ON GPFK_ID = GPHY_MID "
);
sqlMap
.
append
(
" LEFT JOIN WOGYLX ON WOGYLX_ID =GPFK_FKGX "
);
sqlMap
.
append
(
" LEFT JOIN BZGX ON BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
" LEFT JOIN WLXX ON WLXX_ID = GPHY_WLID "
);
sqlMap
.
append
(
"where 1 = 1 "
);
if
(
StringUtils
.
isNotEmpty
(
condition
.
getWosncode
())){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"GPFK_WOSNID"
,
condition
.
getWosncode
()));
sqlMap
.
setParamValue
(
"GPFK_WOSNID"
,
condition
.
getMid
());
}
if
(
StringUtils
.
isNotEmpty
(
condition
.
getBzgxid
())){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"BZGX_ID"
,
condition
.
getWosncode
()));
sqlMap
.
setParamValue
(
"BZGX_ID"
,
condition
.
getMid
());
}
if
(
StringUtils
.
isNotEmpty
(
condition
.
getWlid
())){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"GPHY_WLID"
,
condition
.
getWlid
()));
sqlMap
.
setParamValue
(
"GPHY_WLID"
,
condition
.
getWlid
());
}
sqlMap
.
append
(
"group by GPHY_WLID,GPFK_WOSNID,BZGX_ID "
);
return
sqlMap
.
queryEntity
(
WlslItem
.
class
);
}
@Override
public
double
queryWobomZpslByDjidAndWlidUpgrade
(
String
wosncode
,
String
bzgxid
,
String
wlid
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select WOBOM_DWYL "
);
sqlMap
.
append
(
"from WOBOM"
);
sqlMap
.
append
(
" left join WO on WO_ID = WOBOM_WOID "
);
sqlMap
.
append
(
" left join wosn on WOSN_WOID = WO_ID "
);
sqlMap
.
append
(
" left join wogylx on wogylx_id =wobom_ffgx and wogylx_woid = WO_ID "
);
sqlMap
.
append
(
" left join bzgx on bzgx_id = wogylx_bzgxid "
);
sqlMap
.
append
(
"where 1=1"
);
if
(
StringUtils
.
isNotEmpty
(
wosncode
)){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"WOSN_CODE"
,
wosncode
));
sqlMap
.
setParamValue
(
"WOSN_CODE"
,
wosncode
);
}
if
(
StringUtils
.
isNotEmpty
(
bzgxid
)){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"BZGX_ID"
,
bzgxid
));
sqlMap
.
setParamValue
(
"BZGX_ID"
,
bzgxid
);
}
if
(
StringUtils
.
isNotEmpty
(
wlid
)){
sqlMap
.
append
(
" and "
+
SqlUtil
.
getWhereSql
(
"WOBOM_WLID"
,
wlid
));
sqlMap
.
setParamValue
(
"WOBOM_WLID"
,
wlid
);
}
sqlMap
.
append
(
" group by WOSN_CODE,bzgx_id,wobom_wlid "
);
return
sqlMap
.
queryDouble
();
}
@Override
public
GpfkVO
queryJyGpfkByWosnUptoDate
(
String
wosnid
)
{
SqlMap
sqlMap
=
new
SqlMap
();
sqlMap
.
append
(
"select top 1 GPFK_ID, GPFK_WOSNID, GPFK_FKLX, GPFK_FKSJ, GPFK_HGBZ, GPFK_FKSL, "
);
sqlMap
.
append
(
" GPFK_HGSL, GPFK_BHGSL, GPFK_FKR, GPFK_FKGX, GPFK_BZ, "
);
sqlMap
.
append
(
" GPFK_WHRID, GPFK_WHR, GPFK_WHSJ, GPFK_CJRID, GPFK_CJR, "
);
sqlMap
.
append
(
" GPFK_CJSJ, GPFK_SYSVERSION, GPFK_FKRID, GPFK_FKBX, GPFK_FKJSSJ,WOGYLX_ID, "
);
sqlMap
.
append
(
" BX_CODE, BX_NAME, BZGX_CODE, BZGX_NAME,WLXX_ID, "
);
sqlMap
.
append
(
" WLXX_CODE, WLXX_NAME, WLXX_GG,WOSN_CODE,WO_DJID,WO_ID, "
);
sqlMap
.
append
(
" GPFK_GFSL, GPFK_LFSL, GPFK_FXSL, GPFK_FGSL, GPFK_YWRQ, GPFK_HGDJ, WOSN_KHCODE"
);
sqlMap
.
append
(
"from GPFK "
);
sqlMap
.
append
(
" left join BX on BX_ID = GPFK_FKBX "
);
sqlMap
.
append
(
" left join WOSN on WOSN_CODE = GPFK_WOSNID "
);
sqlMap
.
append
(
" left join WO on WO_ID = WOSN_WOID "
);
sqlMap
.
append
(
" left join WLXX on WLXX_ID = WO_WLID "
);
sqlMap
.
append
(
" left join WOGYLX on WOGYLX_ID = GPFK_FKGX "
);
sqlMap
.
append
(
" left join BZGX on BZGX_ID = WOGYLX_BZGXID "
);
sqlMap
.
append
(
"where 1 = 1 and BZGX_GXLX ='JY' "
);
if
(
StringUtils
.
isNotEmpty
(
wosnid
)){
sqlMap
.
append
(
"and GPFK_WOSNID like :pWOSNID "
);
sqlMap
.
setParamValueLike
(
"pWOSNID"
,
wosnid
);
}
sqlMap
.
append
(
"order by GPFK_FKSJ desc, GPFK_FKGX "
);
return
sqlMap
.
queryEntity
(
GpfkVO
.
class
);
}
}
}
gavel/src/main/java/com/gavel/kwell/persistent/Gpfk.java
View file @
627a6294
...
@@ -93,10 +93,9 @@ public class Gpfk extends BaseEntity {
...
@@ -93,10 +93,9 @@ public class Gpfk extends BaseEntity {
@FieldMeta
(
fieldName
=
"GPFK_HGDJ"
,
caption
=
"合格等级"
)
@FieldMeta
(
fieldName
=
"GPFK_HGDJ"
,
caption
=
"合格等级"
)
private
String
hgdj
;
private
String
hgdj
;
@FieldMeta
(
fieldName
=
"GPFK_WLID"
,
caption
=
"物料编码"
)
@FieldMeta
(
fieldName
=
"GPFK_WLID"
,
caption
=
"物料编码"
)
private
String
wlid
;
private
String
wlid
;
public
String
getWogylx
()
{
public
String
getWogylx
()
{
return
wogylx
;
return
wogylx
;
...
...
gavel/src/main/java/com/gavel/kwell/service/GpfkService.java
View file @
627a6294
...
@@ -111,6 +111,13 @@ public interface GpfkService extends BaseEditService {
...
@@ -111,6 +111,13 @@ public interface GpfkService extends BaseEditService {
public
FkVO
jyfk
(
FkCondition
fkCondition
);
public
FkVO
jyfk
(
FkCondition
fkCondition
);
public
FkVO
wxfk
(
FkCondition
fkCondition
);
public
FkVO
wxfk
(
FkCondition
fkCondition
);
public
FkVO
zpfkUpgrade
(
FkCondition
fkCondition
);
public
FkVO
jyfkUpgrade
(
FkCondition
fkCondition
);
public
FkVO
wxfkUpgrade
(
FkCondition
fkCondition
);
public
List
<
WobomVO
>
queryWobomByWoUpgrade
(
String
wosn
,
String
bzgx
);
/** 科威尔mes工票反馈重写--end */
/** 科威尔mes工票反馈重写--end */
...
...
gavel/src/main/java/com/gavel/kwell/service/impl/GpfkServiceImpl.java
View file @
627a6294
...
@@ -49,6 +49,7 @@ import com.gavel.kwell.persistent.Gpwxmx;
...
@@ -49,6 +49,7 @@ import com.gavel.kwell.persistent.Gpwxmx;
import
com.gavel.kwell.service.GpfkService
;
import
com.gavel.kwell.service.GpfkService
;
import
com.gavel.kwell.service.GphyService
;
import
com.gavel.kwell.service.GphyService
;
import
com.gavel.kwell.utils.GpfkFklxEnum
;
import
com.gavel.kwell.utils.GpfkFklxEnum
;
import
com.gavel.kwell.utils.GpfkHgEnum
;
import
com.gavel.kwell.utils.HzGylxEnum
;
import
com.gavel.kwell.utils.HzGylxEnum
;
import
com.gavel.kwell.utils.SmCodeEnum
;
import
com.gavel.kwell.utils.SmCodeEnum
;
import
com.gavel.kwell.utils.SmCodeModel
;
import
com.gavel.kwell.utils.SmCodeModel
;
...
@@ -62,6 +63,7 @@ import com.gavel.kwell.vo.GpbhgmxVO;
...
@@ -62,6 +63,7 @@ import com.gavel.kwell.vo.GpbhgmxVO;
import
com.gavel.kwell.vo.GpfkCondition
;
import
com.gavel.kwell.vo.GpfkCondition
;
import
com.gavel.kwell.vo.GpfkVO
;
import
com.gavel.kwell.vo.GpfkVO
;
import
com.gavel.kwell.vo.GphyCondition
;
import
com.gavel.kwell.vo.GphyCondition
;
import
com.gavel.kwell.vo.WlslItem
;
import
com.gavel.kwell.vo.WosngzVO
;
import
com.gavel.kwell.vo.WosngzVO
;
import
com.gavel.kzzx.dao.UserDao
;
import
com.gavel.kzzx.dao.UserDao
;
import
com.gavel.kzzx.persistent.User
;
import
com.gavel.kzzx.persistent.User
;
...
@@ -86,7 +88,6 @@ import com.gavel.wo.vo.WobomVO;
...
@@ -86,7 +88,6 @@ import com.gavel.wo.vo.WobomVO;
@Transactional
@Transactional
public
class
GpfkServiceImpl
extends
BaseEditServiceImpl
implements
GpfkService
{
public
class
GpfkServiceImpl
extends
BaseEditServiceImpl
implements
GpfkService
{
@Autowired
@Autowired
private
GpfkDao
gpfkDao
;
private
GpfkDao
gpfkDao
;
...
@@ -123,8 +124,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -123,8 +124,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
@Autowired
@Autowired
private
UserDao
userDao
;
private
UserDao
userDao
;
@Autowired
private
WlxxService
wlxxService
;
@Override
@Override
public
void
initService
()
{
public
void
initService
()
{
...
@@ -902,9 +901,12 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -902,9 +901,12 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
}
}
return
null
;
return
null
;
}
}
@Override
@Override
public
FkVO
zp
fk
(
FkCondition
fkCondition
)
{
public
FkVO
jy
fk
(
FkCondition
fkCondition
)
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
}
}
...
@@ -928,6 +930,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -928,6 +930,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if
(
curFkVo
==
null
)
{
if
(
curFkVo
==
null
)
{
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
}
}
curFkVo
.
setSntype
(
snType
);
Wogylx
wogylx
=
gpfkDao
.
queryById
(
Wogylx
.
class
,
curFkVo
.
getWogylxid
());
Wogylx
wogylx
=
gpfkDao
.
queryById
(
Wogylx
.
class
,
curFkVo
.
getWogylxid
());
if
(!
NumberUtils
.
equals
(
wogylx
.
getXh
(),
0
)){
if
(!
NumberUtils
.
equals
(
wogylx
.
getXh
(),
0
)){
Wogylx
existLastWogylx
=
gpfkDao
.
getLastGx
(
wogylx
);
Wogylx
existLastWogylx
=
gpfkDao
.
getLastGx
(
wogylx
);
...
@@ -954,102 +957,113 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -954,102 +957,113 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if
(!
curFkVo
.
getWozt
().
equals
(
"R"
))
{
if
(!
curFkVo
.
getWozt
().
equals
(
"R"
))
{
throwReturnMessage
(
"该订单未下达无法进行反馈,请重新确认!"
);
throwReturnMessage
(
"该订单未下达无法进行反馈,请重新确认!"
);
}
}
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
GphyCondition
hyCondition
=
new
GphyCondition
();
hyCondition
.
setMid
(
curFkVo
.
getId
());
curFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
curFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
if
(
gphyDao
.
queryIfZpwc
(
hyCondition
)==
0
)
{
curFkVo
.
setZpbz
(
SmCodeEnum
.
OKBZ
.
getPrefix
());
}
}
}
curFkVo
.
setSntype
(
snType
);
return
curFkVo
;
return
curFkVo
;
}
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
WLID
.
getId
()))
{
else
if
(
snType
.
equals
(
SmCodeEnum
.
OKBZ
.
getId
()))
{
String
wlid
=
coderuleService
.
matchCodeByRule
(
fkCondition
.
getSncode
());
fkCondition
.
setWlid
(
wlid
);
if
(
gpfkDao
.
checkIfContainsWobomWl
(
fkCondition
)<=
0
)
{
throwReturnMessage
(
"该订单下不存在该发放工序物料,请重新确认!"
);
}
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
}
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
if
(
curFkVo
==
null
)
{
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
}
FkVO
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
FkVO
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
if
(
gpfkVo
==
null
)
{
if
(
gpfkVo
==
null
)
{
Gpfk
gpfk
=
new
Gpfk
();
Gpfk
gpfk
=
new
Gpfk
();
System
.
out
.
println
(
""
);
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setWlid
(
wlid
);
gpfk
.
setWlid
(
curFkVo
.
getWlid
()
);
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setBhgsl
(
0.0
);
insert
(
gpfk
);
insert
(
gpfk
);
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
}
}
else
{
else
{
Gpfk
gpfk
=
new
Gpfk
();
Gpfk
gpfk
=
new
Gpfk
();
EntityDataFactory
.
copyEntity
(
gpfkVo
,
gpfk
);
EntityDataFactory
.
copyEntity
(
gpfkVo
,
gpfk
);
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setBhgsl
(
0.0
);
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
update
(
gpfk
);
update
(
gpfk
);
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
}
}
GphyCondition
hyCondition
=
new
GphyCondition
();
FkVO
newFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
hyCondition
.
setMid
(
gpfkVo
.
getId
());
newFkVo
.
setSntype
(
snType
);
hyCondition
.
setSnid
(
fkCondition
.
getSncode
());
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
if
(
gpfkDao
.
checkIfContainsGphywl
(
hyCondition
)>
0
)
{
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
throwReturnMessage
(
"该序列号已经被扫描"
);
if
(
StringUtils
.
isNotEmpty
(
newFkVo
.
getHgbz
())&&
newFkVo
.
getHgbz
().
equals
(
"N"
))
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
}
else
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
true
);
}
}
return
newFkVo
;
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
NGBZ
.
getId
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
}
if
(
gphyService
.
compareIsZpComplete
(
gpfkVo
.
getId
(),
wlid
))
{
FkVO
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
Gphy
gphy
=
new
Gphy
();
if
(
gpfkVo
==
null
)
{
gphy
.
setFkgx
(
gpfkVo
.
getFkgx
());
Gpfk
gpfk
=
new
Gpfk
();
gphy
.
setWlid
(
wlid
);
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gphy
.
setMid
(
gpfkVo
.
getId
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gphy
.
setWlsnid
(
fkCondition
.
getSncode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gphy
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gphy
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gphy
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gphy
.
setZpsl
(
1.0
);
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gphy
.
setHylx
(
"BOM"
);
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gphyService
.
insert
(
gphy
);
gpfk
.
setHgbz
(
"N"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgsl
(
0.0
);
gpfk
.
setBhgsl
(
1.0
);
insert
(
gpfk
);
}
}
if
(
gphyDao
.
queryIfZpwc
(
hyCondition
)==
0
)
{
else
{
curFkVo
.
setZpbz
(
SmCodeEnum
.
OKBZ
.
getPrefix
());
Gpfk
gpfk
=
new
Gpfk
();
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
gpfkVo
.
getWogylx
());
EntityDataFactory
.
copyEntity
(
gpfkVo
,
gpfk
);
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
gpfk
.
setHgbz
(
"N"
);
if
(
StringUtils
.
isNotEmpty
(
gpfkVo
.
getHgbz
())&&
gpfkVo
.
getHgbz
().
equals
(
"N"
))
{
gpfk
.
setHgsl
(
0.0
);
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
gpfk
.
setBhgsl
(
1.0
);
}
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
else
{
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
true
);
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
}
update
(
gpfk
);
}
}
}
gpfkVo
.
setSntype
(
SmCodeEnum
.
WLID
.
getId
());
FkVO
newFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
Wlxx
cuwlxx
=
gpfkDao
.
queryById
(
Wlxx
.
class
,
wlid
);
newFkVo
.
setSntype
(
snType
);
gpfkVo
.
setCurwlsncode
(
cuwlxx
.
getCode
());
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
gpfkVo
.
setCurwlsnname
(
cuwlxx
.
getName
());
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
return
gpfkVo
;
if
(
StringUtils
.
isNotEmpty
(
newFkVo
.
getHgbz
())&&
newFkVo
.
getHgbz
().
equals
(
"N"
))
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
}
else
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
true
);
}
}
return
newFkVo
;
}
}
else
{
else
{
throwReturnMessage
(
"序列号类型错误,请重新确认!"
);
throwReturnMessage
(
"序列号类型错误,请重新确认!"
);
}
}
return
fkVO
;
return
fkVO
;
}
}
@Override
@Override
public
FkVO
jy
fk
(
FkCondition
fkCondition
)
{
public
FkVO
wx
fk
(
FkCondition
fkCondition
)
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
}
}
...
@@ -1103,6 +1117,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1103,6 +1117,7 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
curFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
curFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
}
}
curFkVo
.
setSntype
(
snType
);
return
curFkVo
;
return
curFkVo
;
}
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
OKBZ
.
getId
()))
{
else
if
(
snType
.
equals
(
SmCodeEnum
.
OKBZ
.
getId
()))
{
...
@@ -1112,7 +1127,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1112,7 +1127,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
FkVO
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
FkVO
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
if
(
gpfkVo
==
null
)
{
if
(
gpfkVo
==
null
)
{
Gpfk
gpfk
=
new
Gpfk
();
Gpfk
gpfk
=
new
Gpfk
();
System
.
out
.
println
(
""
);
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
...
@@ -1122,8 +1136,8 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1122,8 +1136,8 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setBhgsl
(
0.0
);
gpfk
.
setBhgsl
(
0.0
);
insert
(
gpfk
);
insert
(
gpfk
);
...
@@ -1166,10 +1180,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1166,10 +1180,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setHgbz
(
"N"
);
gpfk
.
setHgbz
(
"N"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgsl
(
0.0
);
gpfk
.
setHgsl
(
0.0
);
gpfk
.
setBhgsl
(
1.0
);
gpfk
.
setBhgsl
(
1.0
);
insert
(
gpfk
);
insert
(
gpfk
);
...
@@ -1204,9 +1218,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1204,9 +1218,9 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
return
fkVO
;
return
fkVO
;
}
}
@Override
@Override
public
FkVO
wx
fk
(
FkCondition
fkCondition
)
{
public
FkVO
zp
fk
(
FkCondition
fkCondition
)
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
}
}
...
@@ -1230,7 +1244,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1230,7 +1244,6 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if
(
curFkVo
==
null
)
{
if
(
curFkVo
==
null
)
{
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
}
}
curFkVo
.
setSntype
(
snType
);
Wogylx
wogylx
=
gpfkDao
.
queryById
(
Wogylx
.
class
,
curFkVo
.
getWogylxid
());
Wogylx
wogylx
=
gpfkDao
.
queryById
(
Wogylx
.
class
,
curFkVo
.
getWogylxid
());
if
(!
NumberUtils
.
equals
(
wogylx
.
getXh
(),
0
)){
if
(!
NumberUtils
.
equals
(
wogylx
.
getXh
(),
0
)){
Wogylx
existLastWogylx
=
gpfkDao
.
getLastGx
(
wogylx
);
Wogylx
existLastWogylx
=
gpfkDao
.
getLastGx
(
wogylx
);
...
@@ -1257,32 +1270,382 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1257,32 +1270,382 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if
(!
curFkVo
.
getWozt
().
equals
(
"R"
))
{
if
(!
curFkVo
.
getWozt
().
equals
(
"R"
))
{
throwReturnMessage
(
"该订单未下达无法进行反馈,请重新确认!"
);
throwReturnMessage
(
"该订单未下达无法进行反馈,请重新确认!"
);
}
}
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
GphyCondition
hyCondition
=
new
GphyCondition
();
hyCondition
.
setMid
(
curFkVo
.
getId
());
curFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
curFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
if
(
gphyDao
.
queryIfZpwc
(
hyCondition
)==
0
)
{
curFkVo
.
setZpbz
(
SmCodeEnum
.
OKBZ
.
getPrefix
());
}
}
}
curFkVo
.
setSntype
(
snType
);
curFkVo
.
setSntype
(
snType
);
return
curFkVo
;
return
curFkVo
;
}
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
OKBZ
.
getId
()))
{
else
if
(
snType
.
equals
(
SmCodeEnum
.
WLID
.
getId
()))
{
String
wlid
=
coderuleService
.
matchCodeByRule
(
fkCondition
.
getSncode
());
fkCondition
.
setWlid
(
wlid
);
if
(
gpfkDao
.
checkIfContainsWobomWl
(
fkCondition
)<=
0
)
{
throwReturnMessage
(
"该订单下不存在该发放工序物料,请重新确认!"
);
}
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
}
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
if
(
curFkVo
==
null
)
{
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
}
FkVO
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
FkVO
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
if
(
gpfkVo
==
null
)
{
if
(
gpfkVo
==
null
)
{
Gpfk
gpfk
=
new
Gpfk
();
Gpfk
gpfk
=
new
Gpfk
();
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setWlid
(
wlid
);
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
insert
(
gpfk
);
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
}
else
{
Gpfk
gpfk
=
new
Gpfk
();
EntityDataFactory
.
copyEntity
(
gpfkVo
,
gpfk
);
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
update
(
gpfk
);
gpfkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
}
GphyCondition
hyCondition
=
new
GphyCondition
();
hyCondition
.
setMid
(
gpfkVo
.
getId
());
hyCondition
.
setSnid
(
fkCondition
.
getSncode
());
if
(
gpfkDao
.
checkIfContainsGphywl
(
hyCondition
)>
0
)
{
throwReturnMessage
(
"该序列号已经被扫描"
);
}
if
(
gphyService
.
compareIsZpComplete
(
gpfkVo
.
getId
(),
wlid
))
{
Gphy
gphy
=
new
Gphy
();
gphy
.
setFkgx
(
gpfkVo
.
getFkgx
());
gphy
.
setWlid
(
wlid
);
gphy
.
setMid
(
gpfkVo
.
getId
());
gphy
.
setWlsnid
(
fkCondition
.
getSncode
());
gphy
.
setFkrid
(
UserInfoUtil
.
getId
());
gphy
.
setFkr
(
UserInfoUtil
.
getUserName
());
gphy
.
setFksj
(
DateUtils
.
getDateTime
());
gphy
.
setZpsl
(
1.0
);
gphy
.
setHylx
(
"BOM"
);
gphyService
.
insert
(
gphy
);
}
if
(
gphyDao
.
queryIfZpwc
(
hyCondition
)==
0
)
{
curFkVo
.
setZpbz
(
SmCodeEnum
.
OKBZ
.
getPrefix
());
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
gpfkVo
.
getWogylx
());
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
if
(
StringUtils
.
isNotEmpty
(
gpfkVo
.
getHgbz
())&&
gpfkVo
.
getHgbz
().
equals
(
"N"
))
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
}
else
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
true
);
}
}
}
gpfkVo
.
setSntype
(
SmCodeEnum
.
WLID
.
getId
());
Wlxx
cuwlxx
=
gpfkDao
.
queryById
(
Wlxx
.
class
,
wlid
);
gpfkVo
.
setCurwlsncode
(
cuwlxx
.
getCode
());
gpfkVo
.
setCurwlsnname
(
cuwlxx
.
getName
());
return
gpfkVo
;
}
else
{
throwReturnMessage
(
"序列号类型错误,请重新确认!"
);
}
return
fkVO
;
}
/************ -------------------科威尔反馈升级--BEGIN--------- ******/
/** 判断当前物料号的上一道工序是否完成 */
public
void
checkLastBzgxIfComplete
(
FkVO
curFkVo
)
{
if
(
curFkVo
==
null
)
{
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
}
Wogylx
wogylx
=
gpfkDao
.
queryById
(
Wogylx
.
class
,
curFkVo
.
getWogylxid
());
if
(!
NumberUtils
.
equals
(
wogylx
.
getXh
(),
0
)){
Wogylx
existLastWogylx
=
gpfkDao
.
getLastGx
(
wogylx
);
if
(
existLastWogylx
!=
null
){
FkCondition
fkCondition2
=
new
FkCondition
();
fkCondition2
.
setWogylx
(
existLastWogylx
.
getId
());
fkCondition2
.
setWosncode
(
curFkVo
.
getWosnCode
());
fkCondition2
.
setBzgxid
(
existLastWogylx
.
getBzgxid
());
FkVO
gpfkVo2
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
curFkVo
.
getWosnCode
(),
existLastWogylx
.
getBzgxid
());
if
(
gpfkVo2
!=
null
)
{
if
((
existLastWogylx
.
getGxlx
()).
equals
(
YymkFKEnum
.
ZP
.
getId
()))
{
GphyCondition
gphyCondition
=
new
GphyCondition
();
gphyCondition
.
setMid
(
gpfkVo2
.
getId
());
if
(
gpfkDao
.
queryIfZpwc
(
curFkVo
.
getWosnCode
(),
existLastWogylx
.
getBzgxid
())!=
0
)
{
throwReturnMessage
(
"上道工序未完成不能反馈此道工序,请重新确认!"
);
}
}
if
((
existLastWogylx
.
getGxlx
()).
equals
(
YymkFKEnum
.
JY
.
getId
()))
{
if
(
StringUtils
.
isNotEmpty
(
gpfkVo2
.
getHgbz
())&&(
gpfkVo2
.
getHgbz
().
equals
(
"Y"
)||
gpfkVo2
.
getHgdj
().
equals
(
GpfkHgEnum
.
JYHG
.
getId
())||
gpfkVo2
.
getHgdj
().
equals
(
GpfkHgEnum
.
WXHG
.
getId
())))
{
}
else
{
throwReturnMessage
(
"上道工序检验不合格不能反馈此道工序,请重新确认!"
);
}
}
}
else
{
throwReturnMessage
(
"上道工序未完成不能反馈此道工序,请重新确认!"
);
}
}
}
if
(!
curFkVo
.
getWozt
().
equals
(
"R"
))
{
throwReturnMessage
(
"该订单未下达无法进行反馈,请重新确认!"
);
}
}
/** 判断下一道工序是否存在反馈记录 */
public
void
checkNextBzgxIfExistFk
(
FkVO
curFkVo
)
{
if
(
curFkVo
==
null
)
{
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
}
Wogylx
wogylx
=
gpfkDao
.
queryById
(
Wogylx
.
class
,
curFkVo
.
getWogylxid
());
if
(!
NumberUtils
.
equals
(
wogylx
.
getXh
(),
0
)){
Wogylx
existNextWogylx
=
gpfkDao
.
getNextGxUpdate
(
wogylx
);
if
(
existNextWogylx
!=
null
){
FkCondition
fkCondition2
=
new
FkCondition
();
fkCondition2
.
setWogylx
(
existNextWogylx
.
getId
());
fkCondition2
.
setWosncode
(
curFkVo
.
getWosnCode
());
fkCondition2
.
setBzgxid
(
existNextWogylx
.
getBzgxid
());
List
<
FkVO
>
gpfkVo2
=
gpfkDao
.
queryKwellAllGpfkByWosnAndGxid
(
fkCondition2
);
if
(
gpfkVo2
!=
null
&&
gpfkVo2
.
size
()>
0
)
{
throwReturnMessage
(
"下道工序已经存在反馈记录不能装配此道工序,请重新确认!"
);
}
}
}
if
(!
curFkVo
.
getWozt
().
equals
(
"R"
))
{
throwReturnMessage
(
"该订单未下达无法进行反馈,请重新确认!"
);
}
}
/** 判断下一道工序是否存在反馈记录 */
public
boolean
checkIsCurrentGx
(
FkVO
curFkVo
)
{
boolean
flag
=
false
;
GpfkVO
gpfk
=
gpfkDao
.
queryGpfkByWosnUptoDate
(
curFkVo
.
getWosnCode
());
if
((
curFkVo
!=
null
&&
gpfk
!=
null
&&
StringUtils
.
isNotEmpty
(
gpfk
.
getFkgx
())&&
StringUtils
.
isNotEmpty
(
curFkVo
.
getWogylx
())&&
gpfk
.
getFkgx
().
equals
(
curFkVo
.
getWogylx
())))
{
flag
=
true
;
}
return
flag
;
}
/** 判断装配工序是否装配完成*/
public
boolean
checkIfZpCompleteByWosnAndBzgx
(
String
wosnid
,
String
bzgx
)
{
boolean
flag
=
false
;
if
(
gpfkDao
.
queryIfZpwc
(
wosnid
,
bzgx
)==
0
)
{
flag
=
true
;
}
return
flag
;
}
/** 判断该物料是否装配完成*/
public
void
compareIsZpComplete
(
GphyCondition
gphyCondition
)
{
WlslItem
wlslItem
=
gpfkDao
.
queryKwellZpslGphy
(
gphyCondition
);
if
(
wlslItem
!=
null
)
{
double
dwyl
=
gpfkDao
.
queryWobomZpslByDjidAndWlidUpgrade
(
gphyCondition
.
getWosncode
(),
gphyCondition
.
getBzgxid
(),
gphyCondition
.
getWlid
());
if
(
dwyl
<=
wlslItem
.
getZpsl
())
{
throwReturnMessage
(
"该物料装配完成"
);
}
}
}
/** 查询订单清单及已经装配数量 */
@Override
public
List
<
WobomVO
>
queryWobomByWoUpgrade
(
String
wosn
,
String
bzgx
)
{
return
gpfkDao
.
queryWobomByWosnAndBzgx
(
wosn
,
bzgx
);
}
/**
* 装配反馈流程升级
*/
@Override
public
FkVO
zpfkUpgrade
(
FkCondition
fkCondition
)
{
/*
* 基础判断 1.条码是否为空 2.前端是否传入标准工序 3.条码是否为已知类型条码
*/
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
}
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getBzgxid
()))
{
throwReturnMessage
(
"扫描工序出错,请重新确认!"
);
}
String
snType
=
checkSnType
(
fkCondition
.
getSncode
());
if
(
StringUtils
.
isEmpty
(
snType
))
{
throwReturnMessage
(
"该条码为未知条码,请重新确认!"
);
}
FkVO
fkVO
=
null
;
if
(
snType
.
equals
(
SmCodeEnum
.
LOGOUT
.
getId
()))
{
fkVO
=
new
FkVO
();
fkVO
.
setSntype
(
snType
);
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
WOSNID
.
getId
()))
{
GpfkCondition
gpfkCondition
=
new
GpfkCondition
();
gpfkCondition
.
setWosnid
(
fkCondition
.
getSncode
());
gpfkCondition
.
setBzgxid
(
fkCondition
.
getBzgxid
());
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnidUptoDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
checkLastBzgxIfComplete
(
curFkVo
);
checkNextBzgxIfExistFk
(
curFkVo
);
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
curFkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
if
(
checkIfZpCompleteByWosnAndBzgx
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
()))
{
curFkVo
.
setZpbz
(
SmCodeEnum
.
OKBZ
.
getPrefix
());
}
}
curFkVo
.
setSntype
(
snType
);
return
curFkVo
;
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
WLID
.
getId
()))
{
String
wlid
=
coderuleService
.
matchCodeByRule
(
fkCondition
.
getSncode
());
fkCondition
.
setWlid
(
wlid
);
if
(
gpfkDao
.
checkIfContainsWobomWl
(
fkCondition
)<=
0
)
{
throwReturnMessage
(
"该订单下不存在该发放工序物料,请重新确认!"
);
}
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnidUptoDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
if
(
curFkVo
==
null
)
{
throwReturnMessage
(
"该订单不存在对应工序,请重新确认!"
);
}
FkVO
gpfkVo
=
null
;
if
(
checkIsCurrentGx
(
curFkVo
))
{
/* 本工序为当前工序*/
gpfkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
Gpfk
gpfk
=
new
Gpfk
();
EntityDataFactory
.
copyEntity
(
gpfkVo
,
gpfk
);
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
update
(
gpfk
);
gpfkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
}
else
{
/* 本工序不为最新工序 存在情况为该订单序列号去维修 */
Gpfk
gpfk
=
new
Gpfk
();
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setWlid
(
wlid
);
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
insert
(
gpfk
);
gpfkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
}
GphyCondition
hyCondition
=
new
GphyCondition
();
hyCondition
.
setBzgxid
(
fkCondition
.
getBzgxid
());
hyCondition
.
setWosncode
(
fkCondition
.
getWosncode
());
hyCondition
.
setSnid
(
fkCondition
.
getSncode
());
hyCondition
.
setWlid
(
wlid
);
if
(
gpfkDao
.
checkIfContainsGphywl
(
hyCondition
)>
0
)
{
throwReturnMessage
(
"该序列号已经被扫描"
);
}
compareIsZpComplete
(
hyCondition
);
Gphy
gphy
=
new
Gphy
();
gphy
.
setFkgx
(
gpfkVo
.
getFkgx
());
gphy
.
setWlid
(
wlid
);
gphy
.
setMid
(
gpfkVo
.
getId
());
gphy
.
setWlsnid
(
fkCondition
.
getSncode
());
gphy
.
setFkrid
(
UserInfoUtil
.
getId
());
gphy
.
setFkr
(
UserInfoUtil
.
getUserName
());
gphy
.
setFksj
(
DateUtils
.
getDateTime
());
gphy
.
setZpsl
(
1.0
);
gphy
.
setHylx
(
"BOM"
);
gphyService
.
insert
(
gphy
);
if
(
checkIfZpCompleteByWosnAndBzgx
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
()))
{
curFkVo
.
setZpbz
(
SmCodeEnum
.
OKBZ
.
getPrefix
());
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
gpfkVo
.
getWogylx
());
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
if
(
StringUtils
.
isNotEmpty
(
gpfkVo
.
getHgbz
())&&
gpfkVo
.
getHgbz
().
equals
(
"N"
))
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
}
else
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
true
);
}
}
}
gpfkVo
.
setSntype
(
SmCodeEnum
.
WLID
.
getId
());
Wlxx
cuwlxx
=
gpfkDao
.
queryById
(
Wlxx
.
class
,
wlid
);
gpfkVo
.
setCurwlsncode
(
cuwlxx
.
getCode
());
gpfkVo
.
setCurwlsnname
(
cuwlxx
.
getName
());
return
gpfkVo
;
}
else
{
throwReturnMessage
(
"序列号类型错误,请重新确认!"
);
}
return
null
;
}
@Override
public
FkVO
jyfkUpgrade
(
FkCondition
fkCondition
)
{
/*
* 基础判断 1.条码是否为空 2.前端是否传入标准工序 3.条码是否为已知类型条码
*/
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
}
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getBzgxid
()))
{
throwReturnMessage
(
"扫描工序出错,请重新确认!"
);
}
String
snType
=
checkSnType
(
fkCondition
.
getSncode
());
if
(
StringUtils
.
isEmpty
(
snType
))
{
throwReturnMessage
(
"该条码为未知条码,请重新确认!"
);
}
FkVO
fkVO
=
null
;
if
(
snType
.
equals
(
SmCodeEnum
.
LOGOUT
.
getId
()))
{
fkVO
=
new
FkVO
();
fkVO
.
setSntype
(
snType
);
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
WOSNID
.
getId
()))
{
GpfkCondition
gpfkCondition
=
new
GpfkCondition
();
gpfkCondition
.
setWosnid
(
fkCondition
.
getSncode
());
gpfkCondition
.
setBzgxid
(
fkCondition
.
getBzgxid
());
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnidUptoDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
checkLastBzgxIfComplete
(
curFkVo
);
checkNextBzgxIfExistFk
(
curFkVo
);
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
curFkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
}
curFkVo
.
setSntype
(
snType
);
return
curFkVo
;
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
OKBZ
.
getId
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
FkVO
gpfkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
if
(
gpfkVo
==
null
)
{
Gpfk
gpfk
=
new
Gpfk
();
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnidUptoDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setBhgsl
(
0.0
);
gpfk
.
setBhgsl
(
0.0
);
gpfk
.
setHgdj
(
GpfkHgEnum
.
JYHG
.
getId
());
insert
(
gpfk
);
insert
(
gpfk
);
}
}
else
{
else
{
...
@@ -1294,9 +1657,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1294,9 +1657,10 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setHgdj
(
GpfkHgEnum
.
JYHG
.
getId
());
update
(
gpfk
);
update
(
gpfk
);
}
}
FkVO
newFkVo
=
gpfkDao
.
query
KwellGpfkByWosnAndGxid
(
fkCondition
);
FkVO
newFkVo
=
gpfkDao
.
query
WowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
()
);
newFkVo
.
setSntype
(
snType
);
newFkVo
.
setSntype
(
snType
);
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
...
@@ -1313,22 +1677,23 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1313,22 +1677,23 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
}
FkVO
gpfkVo
=
gpfkDao
.
query
KwellGpfkByWosnAndGxid
(
fkCondition
);
FkVO
gpfkVo
=
gpfkDao
.
query
WowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
()
);
if
(
gpfkVo
==
null
)
{
if
(
gpfkVo
==
null
)
{
Gpfk
gpfk
=
new
Gpfk
();
Gpfk
gpfk
=
new
Gpfk
();
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnid
UptoDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setHgbz
(
"N"
);
gpfk
.
setHgbz
(
"N"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgsl
(
0.0
);
gpfk
.
setHgsl
(
0.0
);
gpfk
.
setBhgsl
(
1.0
);
gpfk
.
setBhgsl
(
1.0
);
gpfk
.
setHgdj
(
GpfkHgEnum
.
JYBHG
.
getId
());
insert
(
gpfk
);
insert
(
gpfk
);
}
}
else
{
else
{
...
@@ -1340,12 +1705,102 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1340,12 +1705,102 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setHgdj
(
GpfkHgEnum
.
JYBHG
.
getId
());
update
(
gpfk
);
update
(
gpfk
);
}
}
FkVO
newFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
FkVO
newFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
newFkVo
.
setSntype
(
snType
);
newFkVo
.
setSntype
(
snType
);
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
if
(
StringUtils
.
isNotEmpty
(
newFkVo
.
getHgbz
())&&
newFkVo
.
getHgbz
().
equals
(
"N"
))
{
cancelPcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
}
else
{
cancelPcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
true
);
}
}
return
newFkVo
;
}
return
null
;
}
@Override
public
FkVO
wxfkUpgrade
(
FkCondition
fkCondition
)
{
/*
* 基础判断 1.条码是否为空 2.前端是否传入标准工序 3.条码是否为已知类型条码
*/
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getSncode
()))
{
throwReturnMessage
(
"未扫描到条码,请重新确认!"
);
}
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getBzgxid
()))
{
throwReturnMessage
(
"扫描工序出错,请重新确认!"
);
}
String
snType
=
checkSnType
(
fkCondition
.
getSncode
());
if
(
StringUtils
.
isEmpty
(
snType
))
{
throwReturnMessage
(
"该条码为未知条码,请重新确认!"
);
}
FkVO
fkVO
=
null
;
if
(
snType
.
equals
(
SmCodeEnum
.
LOGOUT
.
getId
()))
{
fkVO
=
new
FkVO
();
fkVO
.
setSntype
(
snType
);
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
WOSNID
.
getId
()))
{
GpfkCondition
gpfkCondition
=
new
GpfkCondition
();
gpfkCondition
.
setWosnid
(
fkCondition
.
getSncode
());
gpfkCondition
.
setBzgxid
(
fkCondition
.
getBzgxid
());
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnidUptoDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
checkLastBzgxIfComplete
(
curFkVo
);
checkNextBzgxIfExistFk
(
curFkVo
);
if
(
StringUtils
.
isNotEmpty
(
curFkVo
.
getId
()))
{
curFkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
}
curFkVo
.
setSntype
(
snType
);
return
curFkVo
;
}
else
if
(
snType
.
equals
(
SmCodeEnum
.
OKBZ
.
getId
()))
{
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
FkVO
gpfkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
if
(
gpfkVo
==
null
)
{
Gpfk
gpfk
=
new
Gpfk
();
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnidUptoDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setBhgsl
(
0.0
);
insert
(
gpfk
);
}
else
{
Gpfk
gpfk
=
new
Gpfk
();
EntityDataFactory
.
copyEntity
(
gpfkVo
,
gpfk
);
gpfk
.
setHgbz
(
"Y"
);
gpfk
.
setHgsl
(
1.0
);
gpfk
.
setBhgsl
(
0.0
);
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
update
(
gpfk
);
}
GpfkVO
jygpfkVo
=
gpfkDao
.
queryJyGpfkByWosnUptoDate
(
fkCondition
.
getWosncode
());
if
(
jygpfkVo
!=
null
)
{
Gpfk
jygpfk
=
new
Gpfk
();
EntityDataFactory
.
copyEntity
(
jygpfkVo
,
jygpfk
);
jygpfk
.
setHgdj
(
GpfkHgEnum
.
WXHG
.
getId
());
update
(
jygpfk
);
}
FkVO
newFkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
newFkVo
.
setSntype
(
snType
);
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
if
(
StringUtils
.
isNotEmpty
(
newFkVo
.
getHgbz
())&&
newFkVo
.
getHgbz
().
equals
(
"N"
))
{
if
(
StringUtils
.
isNotEmpty
(
newFkVo
.
getHgbz
())&&
newFkVo
.
getHgbz
().
equals
(
"N"
))
{
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
updatePcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
}
}
...
@@ -1355,12 +1810,54 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
...
@@ -1355,12 +1810,54 @@ public class GpfkServiceImpl extends BaseEditServiceImpl implements GpfkService
}
}
return
newFkVo
;
return
newFkVo
;
}
}
else
{
else
if
(
snType
.
equals
(
SmCodeEnum
.
NGBZ
.
getId
()))
{
throwReturnMessage
(
"序列号类型错误,请重新确认!"
);
if
(
StringUtils
.
isEmpty
(
fkCondition
.
getWosncode
()))
{
throwReturnMessage
(
"该订单序列号未输入,请重新确认!"
);
}
FkVO
gpfkVo
=
gpfkDao
.
queryWowithIfExistGpfkByWosnAndBzgxidInNewDate
(
fkCondition
.
getSncode
(),
fkCondition
.
getBzgxid
());
if
(
gpfkVo
==
null
)
{
Gpfk
gpfk
=
new
Gpfk
();
FkVO
curFkVo
=
gpfkDao
.
queryKwellWoBySnidUptoDate
(
fkCondition
.
getWosncode
(),
fkCondition
.
getBzgxid
());
gpfk
.
setWosnid
(
curFkVo
.
getWosnCode
());
gpfk
.
setWogylx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkgx
(
curFkVo
.
getWogylxid
());
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
gpfk
.
setWlid
(
curFkVo
.
getWlid
());
gpfk
.
setHgbz
(
"N"
);
gpfk
.
setFklx
(
GpfkFklxEnum
.
WO
.
getId
());
gpfk
.
setYwrq
(
DateUtils
.
getDate
());
gpfk
.
setHgsl
(
0.0
);
gpfk
.
setBhgsl
(
1.0
);
insert
(
gpfk
);
}
else
{
Gpfk
gpfk
=
new
Gpfk
();
EntityDataFactory
.
copyEntity
(
gpfkVo
,
gpfk
);
gpfk
.
setHgbz
(
"N"
);
gpfk
.
setHgsl
(
0.0
);
gpfk
.
setBhgsl
(
1.0
);
gpfk
.
setFkrid
(
UserInfoUtil
.
getId
());
gpfk
.
setFkr
(
UserInfoUtil
.
getUserName
());
gpfk
.
setFksj
(
DateUtils
.
getDateTime
());
update
(
gpfk
);
}
FkVO
newFkVo
=
gpfkDao
.
queryKwellGpfkByWosnAndGxid
(
fkCondition
);
newFkVo
.
setSntype
(
snType
);
Wogylx
wogylx
=
(
Wogylx
)
GavelSql
.
selectEntityByKey
(
Wogylx
.
class
,
newFkVo
.
getWogylxid
());
if
(
wogylx
!=
null
&&
StringUtils
.
isNotEmpty
(
wogylx
.
getGxbz
())&&(
wogylx
.
getGxbz
().
equals
(
"D"
)||
wogylx
.
getGxbz
().
equals
(
"M"
)))
{
if
(
StringUtils
.
isNotEmpty
(
newFkVo
.
getHgbz
())&&
newFkVo
.
getHgbz
().
equals
(
"N"
))
{
cancelPcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
false
);
}
else
{
cancelPcjh
(
wogylx
.
getWoid
(),
wogylx
.
getGxlx
(),
true
);
}
}
return
newFkVo
;
}
}
return
null
;
return
fkVO
;
}
}
/************ -------------------科威尔反馈升级--END--------- ******/
}
}
gavel/src/main/java/com/gavel/kwell/utils/GpfkHgEnum.java
0 → 100644
View file @
627a6294
package
com
.
gavel
.
kwell
.
utils
;
import
com.gavel.kzzx.model.GavelEnumModel
;
import
java.util.ArrayList
;
import
java.util.List
;
public
enum
GpfkHgEnum
{
JYHG
(
"JYHG"
,
"检验合格"
),
WXHG
(
"WXHG"
,
"维修合格"
),
JYBHG
(
"JYBHG"
,
"检验不合格"
);
private
String
id
;
//数据库存储
private
String
name
;
GpfkHgEnum
(
String
name
,
String
id
)
{
this
.
id
=
id
;
this
.
name
=
name
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
static
List
<
GavelEnumModel
>
toList
(){
List
<
GavelEnumModel
>
list
=
new
ArrayList
<>();
for
(
GpfkHgEnum
e
:
GpfkHgEnum
.
values
())
{
GavelEnumModel
gavelEnumModel
=
new
GavelEnumModel
();
gavelEnumModel
.
setId
(
e
.
getId
());
gavelEnumModel
.
setName
(
e
.
getName
());
list
.
add
(
gavelEnumModel
);
}
return
list
;
}
}
gavel/src/main/java/com/gavel/kwell/vo/GphyCondition.java
View file @
627a6294
...
@@ -25,8 +25,22 @@ public class GphyCondition extends BaseEntity {
...
@@ -25,8 +25,22 @@ public class GphyCondition extends BaseEntity {
private
String
fkid
;
private
String
fkid
;
private
String
wosncode
;
private
String
bzgxid
;
public
String
getWosncode
()
{
return
wosncode
;
}
public
void
setWosncode
(
String
wosncode
)
{
this
.
wosncode
=
wosncode
;
}
public
String
getBzgxid
()
{
return
bzgxid
;
}
public
void
setBzgxid
(
String
bzgxid
)
{
this
.
bzgxid
=
bzgxid
;
}
public
String
getFkid
()
{
public
String
getFkid
()
{
return
fkid
;
return
fkid
;
}
}
...
...
gavel/src/main/java/com/gavel/kwell/vo/WlslItem.java
View file @
627a6294
...
@@ -3,9 +3,23 @@ package com.gavel.kwell.vo;
...
@@ -3,9 +3,23 @@ package com.gavel.kwell.vo;
import
java.io.Serializable
;
import
java.io.Serializable
;
public
class
WlslItem
implements
Serializable
{
public
class
WlslItem
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
wlid
;
private
String
wlid
;
private
String
wosncode
;
private
String
bzgxid
;
private
Double
zpsl
;
private
Double
zpsl
;
public
String
getWosncode
()
{
return
wosncode
;
}
public
void
setWosncode
(
String
wosncode
)
{
this
.
wosncode
=
wosncode
;
}
public
String
getBzgxid
()
{
return
bzgxid
;
}
public
void
setBzgxid
(
String
bzgxid
)
{
this
.
bzgxid
=
bzgxid
;
}
public
String
getWlid
()
{
public
String
getWlid
()
{
return
wlid
;
return
wlid
;
}
}
...
...
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