대량포장된 패킹을 송장에 매핑할 때 jomtOrderDB.jomtOrderTbl 테이블에 주문정보 저장

> 홈페이지 정품번호 업데이트할 때 일반포장과 동일하게 정품번호 조회되어 처리됨
This commit is contained in:
KwakJooYoung 2025-10-02 13:47:02 +09:00
parent c915111a3f
commit 948604b0ca

View File

@ -5,7 +5,7 @@ Imports Newtonsoft.Json.Linq
Public Class frm_Main Public Class frm_Main
Public programName As String = "DUALSONIC Mapping Or Search Program Ver. " Public programName As String = "DUALSONIC Mapping Or Search Program Ver. "
Private programVer As String = "1.2.0" Private programVer As String = "1.3.0"
Private apiItemOutURL As String = "item-outflows/page" Private apiItemOutURL As String = "item-outflows/page"
@ -57,7 +57,8 @@ Public Class frm_Main
face face
eye eye
id_Serial '' 전표 : api id 코드, 맵핑 : 제품 시리얼 번호 id_Serial '' 전표 : api id 코드, 맵핑 : 제품 시리얼 번호
invoice invoice_number
packing_code
pk_Type '' 전표 : pk 코드, 맵핑 : 물품 타입(완제품 혹은 구성품) pk_Type '' 전표 : pk 코드, 맵핑 : 물품 타입(완제품 혹은 구성품)
type '' 정보 종합 물품 타입 저장 type '' 정보 종합 물품 타입 저장
@ -662,7 +663,8 @@ Public Class frm_Main
txbLeftOver.ForeColor = Color.Red txbLeftOver.ForeColor = Color.Red
For i = 0 To packItemSet.GetLength(1) - 1 For i = 0 To packItemSet.GetLength(1) - 1
packItemSet(itemInfoList.invoice, i) = codeData packItemSet(itemInfoList.invoice_number, i) = codeData
packItemSet(itemInfoList.packing_code, i) = txbMsPacking.Text
Next Next
mapping_list.Add(packItemSet) mapping_list.Add(packItemSet)
@ -726,6 +728,7 @@ Public Class frm_Main
setCodeUse = False setCodeUse = False
stateFullCount = 0 stateFullCount = 0
mapping_list.Clear()
If ckbAPIUse.Checked = True Then If ckbAPIUse.Checked = True Then
@ -1843,6 +1846,7 @@ Public Class frm_Main
For i = 0 To ChkItemSet.GetLength(1) - 1 For i = 0 To ChkItemSet.GetLength(1) - 1
If ChkItemSet(itemInfoList.code, i) = chkItem(itemInfoList.code) And ChkItemSet(itemInfoList.face, i) = chkItem(itemInfoList.face) And ChkItemSet(itemInfoList.eye, i) = chkItem(itemInfoList.eye) Then If ChkItemSet(itemInfoList.code, i) = chkItem(itemInfoList.code) And ChkItemSet(itemInfoList.face, i) = chkItem(itemInfoList.face) And ChkItemSet(itemInfoList.eye, i) = chkItem(itemInfoList.eye) Then
ChkItemSet(itemInfoList.count, i) += 1 ChkItemSet(itemInfoList.count, i) += 1
ChkItemSet(itemInfoList.id_Serial, i) = ChkItemSet(itemInfoList.id_Serial, i) & "/" & chkItem(itemInfoList.id_Serial)
successSwitch = True successSwitch = True
Exit For Exit For
End If End If
@ -1877,6 +1881,7 @@ Public Class frm_Main
For i = 0 To packItemSet.GetLength(1) - 1 For i = 0 To packItemSet.GetLength(1) - 1
If packItemSet(itemInfoList.code, i) = chkItem(itemInfoList.code) And packItemSet(itemInfoList.face, i) = chkItem(itemInfoList.face) And packItemSet(itemInfoList.eye, i) = chkItem(itemInfoList.eye) Then If packItemSet(itemInfoList.code, i) = chkItem(itemInfoList.code) And packItemSet(itemInfoList.face, i) = chkItem(itemInfoList.face) And packItemSet(itemInfoList.eye, i) = chkItem(itemInfoList.eye) Then
packItemSet(itemInfoList.count, i) += 1 packItemSet(itemInfoList.count, i) += 1
packItemSet(itemInfoList.id_Serial, i) = packItemSet(itemInfoList.id_Serial, i) & "/" & chkItem(itemInfoList.id_Serial)
successSwitch = True successSwitch = True
Exit For Exit For
End If End If
@ -3046,14 +3051,65 @@ Public Class frm_Main
Private Function apiMassSave() As Boolean Private Function apiMassSave() As Boolean
Dim jsonData As String Dim jsonData As String
Dim apiResult As String Dim apiResult As String
Dim packItemSet(,) As String
Dim serial_number As String
For i = 0 To mapping_list.Count - 1 For i = 0 To mapping_list.Count - 1
packItemSet = mapping_list(i) Dim packItemSet(,) As String = mapping_list(i)
serial_number = "" Dim serial_number As String = ""
Dim order_code As String = ProdSelect(ProdList.OrderCode) & "/" & i + 1
Dim buy_date As String = Mid(ProdSelect(ProdList.BuyDate), 1, InStr(ProdSelect(ProdList.BuyDate), " ") - 1)
Dim nowToday As String = Format(Now, "yyyy") & "-" & Format(Now, "MM") & "-" & Format(Now, "dd")
For j = 0 To packItemSet.GetLength(1) - 1 For j = 0 To packItemSet.GetLength(1) - 1
DBCmd = "INSERT INTO " & applyOrderDB & "( DATETIME
, Order_Code
, DATE
, Account_Code
, Account_Name
, Orderer_Code
, Orderer_Name
, Receiver_Name
, Phone_Number
, ZipCode
, Address
, Shipment_Date
, Item_Code
, Item_Name
, Item_Count
, Apply_Face
, Apply_Eye
, Invoice_Number
, Packing_Code
, Serial_Number
, release_state
)
VALUE ( Now() " &
", '" & order_code & "'" &
", '" & buy_date & "'" &
", '" & ProdSelect(ProdList.AccountCode) & "'" &
", '" & ProdSelect(ProdList.AccountName) & "'" &
", '" & ProdSelect(ProdList.OrdererCode) & "'" &
", '" & ProdSelect(ProdList.OrdererName) & "'" &
", '" & ProdSelect(ProdList.OrdererName) & "'" &
", '" & ProdSelect(ProdList.phone) & "'" &
", '" & ProdSelect(ProdList.zip) & "'" &
", '" & ProdSelect(ProdList.Address) & "'" &
", '" & nowToday & "'" &
", '" & packItemSet(itemInfoList.code, j) & "'" &
", '" & packItemSet(itemInfoList.name, j) & "'" &
", '" & packItemSet(itemInfoList.count, j) & "'" &
", '" & packItemSet(itemInfoList.face, j) & "'" &
", '" & packItemSet(itemInfoList.eye, j) & "'" &
", '" & packItemSet(itemInfoList.invoice_number, 0) & "'" &
", '" & packItemSet(itemInfoList.packing_code, 0) & "'" &
", '" & packItemSet(itemInfoList.id_Serial, j) & "'" &
", 'release'" &
")"
If DBCommand(DBCmd) = False Then
'errorOut("등록오류")
MsgBox("전표 데이터 등록 도중 오류가 발생하였습니다.", vbExclamation)
Return False
End If
If packItemSet(itemInfoList.id_Serial, j) <> Nothing And packItemSet(itemInfoList.id_Serial, j) <> "" Then If packItemSet(itemInfoList.id_Serial, j) <> Nothing And packItemSet(itemInfoList.id_Serial, j) <> "" Then
If serial_number = "" Then If serial_number = "" Then
serial_number = packItemSet(itemInfoList.id_Serial, j) serial_number = packItemSet(itemInfoList.id_Serial, j)
@ -3063,7 +3119,7 @@ Public Class frm_Main
End If End If
Next Next
jsonData = "{""expectedOutCount"": 1,""serialNumber"":""" & serial_number & """,""invoiceNumber"":""" & packItemSet(itemInfoList.invoice, 0) & """}" jsonData = "{""expectedOutCount"": 1,""serialNumber"":""" & serial_number & """,""invoiceNumber"":""" & packItemSet(itemInfoList.invoice_number, 0) & """}"
apiResult = apiRequest_PUT(jsonData, SetIdCode(i)) apiResult = apiRequest_PUT(jsonData, SetIdCode(i))