This commit is contained in:
Sunandar
2017-01-24 18:10:39 +06:30
parent 2893f33a23
commit cfb738e479
3 changed files with 5 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ class Api::BatchLineItemsController < ApplicationController
user_id=find_user.id
end
if !encrypt_key.nil?
serial_no=BatchLineItem.generate_serial_no(user_id.to_s)
str="manufacture_uid="+manufacture_uid.to_s+"&serial_no="+serial_no.to_s
digest_data= Digest::MD5.hexdigest(str)
@@ -24,8 +25,7 @@ class Api::BatchLineItemsController < ApplicationController
wristband_code=hex_str[0..15]
check_manufacture = BatchLineItem.find_by_manufacture_uid_and_wristband_code(manufacture_uid,wristband_code)
if check_manufacture.nil?
serial_no=BatchLineItem.generate_serial_no(user_id.to_s)
if check_manufacture.nil?
batchLineItem=BatchLineItem.new
batchLineItem.wristband_code=wristband_code