更多源码下载 https://pan.baidu.com/s/1Qb1QIUZITfIPPN_WcflscA?pwd=k4tk
1.获取入库单明细 | aws_get_asft620detail | 扫描入库单号,获取ERP入库单明细填充至扫描列表 |
函式说明 | 获取入库资料接口 |
函式名称 | aws_get_asft602detail 接口名:GetAsft620detail |
aws_get_asft620detail.4gl 4GL源码
# Prog. Version..: '5.30.03-12.09.18(00000)' #
#{
# Program name...: aws_get_asft620detail.4gl
# Descriptions...: ?取完工入?單單身明細信息
# Date & Author..: 2022-12-16 By Lian
DATABASE ds
GLOBALS "../../../tiptop/config/top.global"
GLOBALS "../../../tiptop/aws/4gl/aws_ttsrv_global.4gl"
FUNCTION aws_get_asft620detail()
WHENEVER ERROR CONTINUE
CALL aws_ttsrv_preprocess() #呼叫服務前置處理程序 #FUN-860037
#--------------------------------------------------------------------------#
# 查詢 ERP 客戶編號 #
#--------------------------------------------------------------------------#
IF g_status.code = "0" THEN
CALL aws_get_asft620detail_process()
END IF
CALL aws_ttsrv_postprocess() #呼叫服務後置處理程序
END FUNCTION
FUNCTION aws_get_asft620detail_process()
DEFINE l_i LIKE type_file.num10
DEFINE l_sfb081 LIKE sfb_file.sfb081
DEFINE l_sfb39 LIKE sfb_file.sfb39
DEFINE l_sfu RECORD
sfu01 LIKE sfu_file.sfu01,
sfu02 LIKE sfu_file.sfu02,
sfv03 LIKE sfv_file.sfv03, #?次
sfv11 LIKE sfv_file.sfv11,
sfv04 LIKE sfv_file.sfv04,
ima02 LIKE ima_file.ima02,
sfv05 LIKE sfv_file.sfv05,
sfv06 LIKE sfv_file.sfv06, #add by zouhs 位
sfv07 LIKE sfv_file.sfv07, #add by zouhs 批
sfv09 LIKE sfv_file.sfv09
END RECORD
DEFINE l_node om.DomNode
#FUN-B90089 add str---
DEFINE l_wc STRING
DEFINE l_str STRING
DEFINE l_end STRING
DEFINE l_sql STRING
DEFINE l_sfa01 LIKE sfa_file.sfa01
DEFINE l_sfu01 LIKE type_file.chr1000 #add by zouhs ?入一???入???
DEFINE l_n LIKE type_file.num10
DEFINE l_sfv09 LIKE sfv_file.sfv09
DEFINE l_ima01 LIKE ima_file.ima01 #add by xiaolin No:MOD-BA0127
DEFINE l_img04 LIKE img_file.img04 #add by xiaolinNo:MOD-BA0127
DEFINE l_sfu01bk LIKE sfu_file.sfu01 #add by xiaolin No:MOD-BA0127
DEFINE l_n2 LIKE type_file.num10 #add by xiaolin No:MOD-BA0127
DEFINE l_sfu04 LIKE sfu_file.sfu04
DEFINE l_cnt LIKE type_file.num5
DEFINE l_sfuconf LIKE sfu_file.sfuconf
DEFINE l_sfupost LIKE sfu_file.sfupost
LET l_sfu01 = aws_ttsrv_getParameter("sfu01") #取由呼叫端呼叫時給予的 SQL Condition
IF cl_null(l_sfu01) THEN
LET g_status.code=-1
LET g_status.description="完工入庫單號不能為空! "
RETURN
END IF
LET l_cnt = 0
SELECT COUNT(*) INTO l_cnt FROM sfu_file WHERE sfu01 = l_sfu01
IF l_cnt <= 0 THEN
LET g_status.code = "-1"
LET g_status.description = "入庫單號不存在,請檢查! "
RETURN
END IF
INITIALIZE l_sfuconf,l_sfupost TO NULL
SELECT sfuconf,sfupost INTO l_sfuconf,l_sfupost FROM sfu_file WHERE sfu01 = l_sfu01
IF l_sfupost = 'Y' THEN
LET g_status.code = "-1"
LET g_status.description = "入庫單已過賬!"
RETURN
END IF
IF l_sfuconf = 'N' THEN
LET g_status.code = "-1"
LET g_status.description = "入庫單未審核!"
RETURN
END IF
IF l_sfuconf = 'X' THEN
LET g_status.code = "-1"
LET g_status.description = "入庫單已作廢!"
RETURN
END IF
LET l_sql=" select sfu01,sfu02,sfv03,sfv11,sfv04,ima02,sfv05,sfv06,sfv07,sfv09",
" from sfv_file",
" inner join sfu_file on sfu01=sfv01",
" inner join ima_file on ima01=sfv04",
" where sfuconf='Y'",
" AND sfu01='", l_sfu01 CLIPPED, "'",
" and sfupost='N' ",
" order by sfu02,sfu01"
DECLARE occ_cur CURSOR FROM l_sql
IF SQLCA.SQLCODE THEN
LET g_status.code = "-1"
LET g_status.sqlcode = "获取完工入庫单信息出错1"
RETURN
END IF
FOREACH occ_cur INTO l_sfu.*
LET l_node = aws_ttsrv_addMasterRecord(base.TypeInfo.create(l_sfu), "Master") #加入此筆單檔資料至 Response 中
END FOREACH
IF SQLCA.SQLCODE THEN
LET g_status.code = "-1"
LET g_status.sqlcode = "获取完工入庫单信息出错2!"
RETURN
END IF
END FUNCTION
SOAPUI提交的数据
sfu01 完工入库单号
<Request>
<Access>
<Authentication password="tiptop" user="liyuhan"/>
<Connection application="APP" source="" />
<Organization name="0TDGCS " />
<Locale language="zh_cn" />
</Access>
<RequestContent>
<Parameter>
<Record>
<Field name="sfu01" value="N3A1-23074126" />
</Record>
</Parameter>
<Document/>
</RequestContent>
</Request>
返回的信息
sfu01 完工入库单
sfu02 入库日期
sfv03 项次
sfv11 工单
sfv04 料号
ima02 品名
sfv05 仓库
sfv06 储位
sfv07 批号
sfv09 入库量
<Response>
<Execution>
<Status code="0" sqlcode="0" description=""/>
</Execution>
<ResponseContent>
<Parameter/>
<Document>
<RecordSet id="1">
<Master name="Master">
<Record>
<Field name="sfu01" value="N3A1-23074126"/>
<Field name="sfu02" value="2023/04/06"/>
<Field name="sfv03" value="1"/>
<Field name="sfv11" value="N3V1-23070043"/>
<Field name="sfv04" value="05001746"/>
<Field name="ima02" value="CFGT PART GARSH"/>
<Field name="sfv05" value="400"/>
<Field name="sfv06" value="002"/>
<Field name="sfv07" value="230715SA-A11418T11"/>
<Field name="sfv09" value="200.000"/>
</Record>
</Master>
</RecordSet>
</Document>
</ResponseContent>
</Response>