|
|
@@ -15,6 +15,8 @@ import com.usai.redant.raimage.Model.ManufactureListActivity;
|
|
|
import com.usai.redant.raimage.Model.ModelActivity;
|
|
|
import com.usai.redant.raimage.POP.PopActivity;
|
|
|
import com.usai.redant.raimage.PhotoList.PhotoListActivity;
|
|
|
+import com.usai.util.Crypto;
|
|
|
+import com.usai.util.MD5;
|
|
|
import com.usai.util.Network;
|
|
|
import com.usai.util.RAUtil;
|
|
|
import com.usai.util.dbUtil;
|
|
|
@@ -248,9 +250,57 @@ public class MainActivity extends AppCompatActivity
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ try {
|
|
|
|
|
|
- sendBroadcast(new Intent("REDANT.POP.REQUEST_LOCATION"));
|
|
|
- return;
|
|
|
+ Intent intent = new Intent("REDANT.RAImage.ADD_TASK");
|
|
|
+
|
|
|
+ ArrayList<Bundle> taskArr = new ArrayList<Bundle>();
|
|
|
+ String name = "POP";
|
|
|
+ if (this.getClass().equals(ModelActivity.class)) {
|
|
|
+ name = "Model";
|
|
|
+ }
|
|
|
+ for (String path : photoList) {
|
|
|
+ Bundle task = new Bundle();
|
|
|
+
|
|
|
+ task.putString("path",name);
|
|
|
+ task.putString("file",path);
|
|
|
+ task.putString("url",RedAntApplication.active_address);
|
|
|
+
|
|
|
+ String md5 = MD5.md5sum(path);
|
|
|
+ String encryptUser = Crypto.encrypt("usai",RedAntApplication.user);
|
|
|
+ String encryptPwd = Crypto.decrypt("usai",RedAntApplication.password);
|
|
|
+
|
|
|
+ Bundle params = new Bundle();
|
|
|
+ params.putString("user",encryptUser);
|
|
|
+ params.putString("password",encryptPwd);
|
|
|
+ params.putString("mode",name);
|
|
|
+ params.putString("barcode",pidval.getText().toString());
|
|
|
+ params.putString("_operate","upload");
|
|
|
+ params.putString("platform","android");
|
|
|
+ params.putString("md5",md5);
|
|
|
+
|
|
|
+ if (this.getClass().equals(ModelActivity.class)) {
|
|
|
+ if (!TextUtils.isEmpty(manufacture)) {
|
|
|
+ params.putString("manufacturer",manufacture);
|
|
|
+ }
|
|
|
+ if (!TextUtils.isEmpty(noteTextView.getText().toString())) {
|
|
|
+ params.putString("note",noteTextView.getText().toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ task.putBundle("params",params);
|
|
|
+
|
|
|
+ taskArr.add(task);
|
|
|
+ }
|
|
|
+
|
|
|
+ intent.putParcelableArrayListExtra("tasks",taskArr);
|
|
|
+
|
|
|
+ sendBroadcast(intent);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return;
|
|
|
|
|
|
}
|
|
|
});
|