Added Insertion from I001 to S001

This commit is contained in:
2019-07-05 13:06:35 +00:00
parent bbe4301696
commit 82b48e52fc
7 changed files with 45 additions and 17 deletions

17
DB.py
View File

@@ -1,4 +1,3 @@
#!/opt/local/bin/python3.0 #!/opt/local/bin/python3.0
import sqlite3 as sqlite import sqlite3 as sqlite
@@ -102,7 +101,13 @@ class DB:
file = codecs.open (self.talogfile, "a", "utf-8") file = codecs.open (self.talogfile, "a", "utf-8")
dt = datetime.now () dt = datetime.now ()
file.write (u"%4d-%02d-%02d %02d:%02d:%02d.%06d: " %(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond)) file.write (u"%4d-%02d-%02d %02d:%02d:%02d.%06d: " %(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.microsecond))
file.write (dbstring + ";\n") try:
file.write (dbstring + ";\n")
except:
try:
file.write (dbstring.decode ("utf-8") + ";\n")
except:
print ("jetzt woas i a nimmer")
file.close () file.close ()
self.db.commit () self.db.commit ()
@@ -1237,14 +1242,14 @@ class DB:
'23456' : ['Testartikel2', 'ST','1.0', 'KG', '1', '1', '1', '0', '0']} '23456' : ['Testartikel2', 'ST','1.0', 'KG', '1', '1', '1', '0', '0']}
""" """
try: try:
cursor = self.executesql ("SELECT article, caption, gtin, normammount, minammount, zone FROM Articlemaster;") cursor = self.executesql ("SELECT article, caption, gtin, normammount, minammount, zone, dest FROM Articlemaster;")
except: except:
self.log ("Couldn't read articlemaster") self.log ("Couldn't read articlemaster")
a = {} a = {}
for row in cursor.fetchall (): for row in cursor.fetchall ():
article, caption, gtin, normammount, minammount, zone = row article, caption, gtin, normammount, minammount, zone, dest = row
a [article] = [caption, gtin, normammount, minammount, zone] a [article] = [caption, gtin, normammount, minammount, zone, dest]
return a return a
@@ -1257,7 +1262,7 @@ class DB:
cursor = self.executesql (u"INSERT INTO Orders (id, customer_name, customer_address, deliverydate, state, destination, prio) VALUES (%d, '%s', '%s', '%s', '%s', '%s', %s);" \ cursor = self.executesql (u"INSERT INTO Orders (id, customer_name, customer_address, deliverydate, state, destination, prio) VALUES (%d, '%s', '%s', '%s', '%s', '%s', %s);" \
% (orderid, customer_name, customer_address, deliverydate, state, destination, prio)) % (orderid, customer_name, customer_address, deliverydate, state, destination, prio))
except sqlite.Error, msg: except sqlite.Error, msg:
self.log ("Couldn't add Order %d to Databasei %s" % (orderid, msg)) self.log ("Couldn't add Order %d to Database %s" % (orderid, msg))
def searchorder (self, id = 0, destination = '', state = ''): def searchorder (self, id = 0, destination = '', state = ''):

30
IPKT.py
View File

@@ -100,11 +100,13 @@ class IPKT:
_zone = 1 _zone = 1
else: else:
_cap, _gtin, _normam, _minam, _zone = self.articlemaster[article] _cap, _gtin, _normam, _minam, _zone, _dest = self.articlemaster[article]
#Disabled #Disabled
#_state = 93 #Younger Lots in Storage #_state = 93 #Younger Lots in Storage
#_dest 0 == T001, 1 = S00x
_deststorage = '' _deststorage = ''
if not _state: if not _state:
@@ -112,18 +114,30 @@ class IPKT:
self.message (5,' IPKT Check Pieces') self.message (5,' IPKT Check Pieces')
if not pieces: if not pieces:
_state = 90 #90 Bad weight _state = 90 #90 Bad weight
elif (pieces >= _normam) or 1: #Assume Full Pallet elif (pieces >= _normam): #Assume Full Pallet
self.message (5,' IPKT Check Pieces Ok - Full Pallet')
#Full Pallet into T001 #Full Pallet into T001
if ipoint_id in ['I001', 'I002']: if ipoint_id in ['I001', 'I002']:
_deststorage = 'T001' if _dest == 0:
self.message (5,' IPKT Check Pieces Ok - Full Pallet also for T001 in Articlemaster')
_deststorage = 'T001'
elif _dest == 1:
self.message (5,' IPKT Check Pieces Ok - Full Pallet For S001 in Articlemaster')
_deststorage = 'S001'
else: else:
_deststorage = 'S002' _deststorage = 'S002'
elif pieces >= _minam: #disabled Min Amount #elif pieces >= _minam:
else:
self.message (5,' IPKT Check Pieces Ok - Rest Pallet')
#Full Pallet into S001 #Full Pallet into S001
if ipoint_id in ['I001', 'I002']: if destination != 1:
_deststorage = 'S001' self.message (5,' IPKT Check Pieces Rest Pallet not for T001')
else: _state = 90 #90 Bad weight
_deststorage = 'S002' else:
if ipoint_id in ['I001', 'I002']:
_deststorage = 'S001'
else:
_deststorage = 'S002'
if not _state: if not _state:
#default article try to find a Place #default article try to find a Place

View File

@@ -39,7 +39,7 @@ def fromstring (data):
tel.attrib['lotnr'] = data [66:66 + ord (data [65])].strip ().lstrip ('0') tel.attrib['lotnr'] = data [66:66 + ord (data [65])].strip ().lstrip ('0')
tel.attrib['lotnr2'] = data [74:74 + ord (data [73])].replace (' ','0') #99,99 Kilos tel.attrib['lotnr2'] = data [74:74 + ord (data [73])].replace (' ','0') #99,99 Kilos
tel.attrib['pieces'] = data [82:82 + ord (data [81])].replace (' ','0').lstrip ('0') tel.attrib['pieces'] = data [82:82 + ord (data [81])].replace (' ','0').lstrip ('0')
#tel.attrib['destination'] = (ord (data [60]) << 8) + ord (data [59]) tel.attrib['destination'] = (ord (data [86]) << 8) + ord (data [87])
return tel return tel

View File

@@ -6,4 +6,10 @@ BEGIN TRANSACTION;
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (129, 'Pizza Salame', '4250414150715', 81, 50, 1); INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (129, 'Pizza Salame', '4250414150715', 81, 50, 1);
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (218, 'Pizza Tonno e Cipolla', '4260414150722', 81, 50, 1); INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (218, 'Pizza Tonno e Cipolla', '4260414150722', 81, 50, 1);
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (342, 'Pizza Spinaci e Ricotta', '4260414150623', 81, 50, 1); INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (342, 'Pizza Spinaci e Ricotta', '4260414150623', 81, 50, 1);
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (274, 'B-WARE Pizza Margherita', '4260414150685', 81, 50, 1);
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (275, 'B-WARE Pizza Prosciutto Funghi', '4260414150692', 81, 50, 1);
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (276, 'B-WARE Pizza Salame', '4250414150715', 81, 50, 1);
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (277, 'B-WARE Pizza Tonno e Cipolla', '4260414150722', 81, 50, 1);
INSERT INTO Articlemaster (article, caption, gtin, normammount, minammount, zone) VALUES (361, 'B-WARE Pizza Spinaci e Ricotta', '4260414150623', 81, 50, 1);
END TRANSACTION; END TRANSACTION;

View File

@@ -1,5 +1,7 @@
--Locked Slots Karnerta -Wurst-- --Locked Slots Franco Fresco--
DELETE FROM Lockedslots; DELETE FROM Lockedslots;
INSERT INTO Lockedslots VALUES ('S001', 1, 3, 'blocked');
INSERT INTO Lockedslots VALUES ('S001', 2, 3, 'blocked');
--INSERT INTO Lockedslots VALUES ('T001', 16, 2, 'dummy'); --INSERT INTO Lockedslots VALUES ('T001', 16, 2, 'dummy');
-- INSERT INTO Lockedslots VALUES ('T001', 17, 5, 'express'); -- INSERT INTO Lockedslots VALUES ('T001', 17, 5, 'express');
-- INSERT INTO Lockedslots VALUES ('T001', 18, 7, 'error'); -- INSERT INTO Lockedslots VALUES ('T001', 18, 7, 'error');

View File

@@ -16,7 +16,7 @@ INSERT INTO Physics VALUES ('Z_T001','21');
-- Singleplace shelf configured -- Singleplace shelf configured
INSERT INTO Physics VALUES ('Storage1', 'S001'); INSERT INTO Physics VALUES ('Storage1', 'S001');
INSERT INTO Physics VALUES ('Z_S001','1'); INSERT INTO Physics VALUES ('Z_S001','1');
INSERT INTO Physics VALUES ('X_S001','10'); INSERT INTO Physics VALUES ('X_S001','13');
INSERT INTO Physics VALUES ('Y_S001','3'); INSERT INTO Physics VALUES ('Y_S001','3');
INSERT INTO Physics VALUES ('ZONES_S001','1'); INSERT INTO Physics VALUES ('ZONES_S001','1');
INSERT INTO Physics VALUES ('ZONESTART_S001_1','1'); INSERT INTO Physics VALUES ('ZONESTART_S001_1','1');

View File

@@ -5,5 +5,6 @@ CREATE TABLE Articlemaster (
normammount INTEGER NULL default '', normammount INTEGER NULL default '',
minammount INTEGER NULL default '', minammount INTEGER NULL default '',
zone INTEGER NOT NULL default '1', zone INTEGER NOT NULL default '1',
dest INTEGER NOT NILL default '0',
PRIMARY KEY (article) PRIMARY KEY (article)
); );